Skip to main content
Skip table of contents

ScaleOffsetInt32

Overview

Scales a signal by integer gain and then adds an integer offset

Discussion

The ScaleOffsetInt32 module scales the input signal by an integer scale factor, and adds a fixed (DC) offset. The module is useful for logic and control signals.

The output is computed on a sample by sample basis according to the formula: $y[n]=\textrm{gain} \times x[n] + \textrm{offset}$

Type Definition

CODE
typedef struct _ModuleScaleOffsetInt32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 gain;                                   // Linear integer scale factor.
    INT32 offset;                                 // DC offset.
} ModuleScaleOffsetInt32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

gain

int

parameter

0

1

Unrestricted

offset

int

parameter

0

1

Unrestricted

Pins

Input Pins

Name: in

Description: Input signal

Data type: int

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real and Complex

Output Pins

Name: out

Description: Output signal

Data type: int

MATLAB Usage

File Name: scale_offset_int_module.m

CODE
 M=scale_offset_int_module(NAME)
 Creates a integer scale and offset object for use with the Audio Weaver
 environment.

 Arguments:
    NAME - name of the module.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.