Document toolboxDocument toolbox

(8.D.2.7) 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]= gain * x[n] + offset

Type Definition

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

Output Pins

Name: out

Description: Output signal

Data type: int

MATLAB Usage

File Name: scale_offset_int_module.m

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.

Â