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. If the input is complex, the same gain and offset are applied equally to both the real and imaginary parts.

The output is computed on a sample by sample basis according to the formula: y[n]=gain * x[n] + 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

...