ScaleOffset
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
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
Data type: float
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: float
MATLAB Usage
File Name: scale_offset_module.m
M=scale_offset_module(NAME)
Creates a scale and offset object for use with the Audio Weaver
environment.
Arguments:
NAME - name of the module.