Overview
Smooth scaler with independent gain per channel with gain (in linear units) is taken from an input pin
Discussion
The Scaler Control module smoothly scales multichannel input data by a independent gain value. The first pin is the control pin with gain values. The size of the control pin (i.e. number of gain values) is same as number of channels on input data. So the module has 2 input pins and 1 output pin Internally, currentGain represents the instantaneous smoothed gain that is applied. currentGain exponentially approaches gain with a time constant equal to smoothingTime.
Type Definition
Code Block |
---|
typedef struct _ModuleScalerNControl { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure FLOAT32 smoothingTime; // Time constant of the smoothing process FLOAT32 smoothingCoeff; // Smoothing coefficient FLOAT32* currentGain; // Array of instantaneous linear gains, one per channel. } ModuleScalerNControlClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
smoothingTime | float | parameter | 0 | 10 | 0:1000 | msec |
smoothingCoeff | float | derived | 1 | 0.002081 | Unrestricted | |
currentGain | float* | state | 0 | [1 x 1] | -10:10 | linear |
Pins
Input Pins
Name: g
Description: linear gain to apply
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: Output signal
Data type: float
MATLAB Usage
File Name: scalern_control_module.m
...