Overview
General purpose scaler with a single gain
Discussion
General purpose scaler (or gain) module for floating-point signals. This module has a single parameter "gain" which specifies the gain to apply. The same gain is applied to all channels.
...
The description above applies to real data. The module can also handle complex data but in the case of complex data no smoothing is performed.
Type Definition
Code Block |
---|
typedef struct _ModuleScalerV2 { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure FLOAT32 gain; // Gain in either linear or dB units. FLOAT32 smoothingTime; // Time constant of the smoothing process (0 = unsmoothed). INT32 isDB; // Selects between linear (=0) and dB (=1) operation FLOAT32 targetGain; // Target gain in linear units. FLOAT32 currentGain; // Instantaneous gain applied by the module. FLOAT32 smoothingCoeff; // Smoothing coefficient. } ModuleScalerV2Class; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
gain | float | parameter | 0 | 0 | -24:24 | dB |
smoothingTime | float | parameter | 0 | 10 | 0:1000 | msec |
isDB | int | parameter | 0 | 1 | 0:1 | |
targetGain | float | derived | 1 | 1 | Unrestricted | |
currentGain | float | state | 1 | 0 | Unrestricted | |
smoothingCoeff | float | derived | 1 | 0.002081 | Unrestricted |
Pins
Input Pins
Name: gain
Description:
Data type: float
...
Complex support: Real and Complex
Output Pins
Name: out1
Description: audio output
Data type: float
MATLAB Usage
File Name: scaler_v2_module.m
...