Overview
Smooth scaler in which the gain (in dB) is taken from an input pin
Discussion
Scales all input channels by a single gain value. The first pin is the control pin. The gain (in dB) value is provided at the first sample of first pin. So the module has N+1 number of input pins and N number of output pins 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 _ModuleScalerDBControl { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure FLOAT32 smoothingTime; // Time constant of the smoothing process FLOAT32 currentGain; // Instantaneous gain applied by the module. This is also the starting gain of the module. FLOAT32 smoothingCoeff; // Smoothing coefficient } ModuleScalerDBControlClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
smoothingTime | float | parameter | 0 | 10 | 0:1000 | msec |
currentGain | float | state | 1 | 0 | Unrestricted | |
smoothingCoeff | float | derived | 1 | 0.002081 | Unrestricted |
Pins
Input Pins
Name: g
Description: gain (in dB)
...
Complex support: Real and Complex
Output Pins
Name: out1
Description: audio output
Data type: float
MATLAB Usage
File Name: scaler_db_control_module.m
...