Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

Scales a signal and then adds an offset

Discussion

The ScaleOffset module scales the input signal, and adds a fixed (DC) offset. The module is useful for specific nonlinearities, as well as in dynamics processing, where the scale and offset can occur in the log domain.

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 Block
typedef struct _ModuleScaleOffset
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    FLOAT32 gain;                                 // Linear gain.
    FLOAT32 offset;                               // DC offset.
} ModuleScaleOffsetClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

gain

float

parameter

0

1

-10:10

offset

float

parameter

0

1

-10:10

Pins

Input Pins

Name: in

Description: Input signal

...

Complex support: Real and Complex

Output Pins

Name: out

Description: Output signal

Data type: float

MATLAB Usage

File Name: scale_offset_module.m

...