Overview
Volume control with Fletcher-Munson loudness compensation
Discussion
Volume control subsystem with built in loudness compensation. The system has one multichannel input pin and one multichannel output pin. Input and output pins must have the same dimensions. All processing is smoothed for clickless operation.
...
4.) Intead of using a seperate biquad and mixer, we dyanmically vary biquad coefficients so its transfer function implements the combined mixer biquad system described above. We need the original biquad numerator coefficients for calculation each time SYS.gain is varied, thus we keep them in the constants: SYS.b0_LPF, SYS.b1_LPF, SYS.b2_LPF.
Type Definition
Code Block |
---|
typedef struct _ModuleVolumeControl { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure FLOAT32 gain; // Gain through the volume control, in dB. FLOAT32 centerFreq; // Center frequency of the low frequency resonance, in Hz. FLOAT32 c2; // X^2 coefficient. FLOAT32 c1; // X^1 coefficient. FLOAT32 c0; // X^0 coefficient. FLOAT32 b0_LPF; // First numerator coefficient. FLOAT32 b1_LPF; // Second numerator coefficient. FLOAT32 b2_LPF; // Third numerator coefficient. awe_modBiquadSmoothedInstance *mixerFilt; // 2nd order smoothly updating IIR filter } ModuleVolumeControlClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
gain | float | parameter | 0 | 0 | -90:0.1:0 | dB |
centerFreq | float | const | 0 | 62.5 | 30:120 | Hz |
c2 | float | const | 0 | 0.001904 | Unrestricted | |
c1 | float | const | 0 | -0.09575 | Unrestricted | |
c0 | float | const | 0 | -0.2614 | Unrestricted | |
b0_LPF | float | const | 0 | 0.004074 | Unrestricted | |
b1_LPF | float | const | 0 | -6.224e-12 | Unrestricted | |
b2_LPF | float | const | 0 | -0.004074 | Unrestricted |
Pins
Input Pins
Name: in
Description: Audio Input
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: Audio output
Data type: float
MATLAB Usage
File Name: volume_control_module.m
...