(8.D.2.5) ThreeBandToneControl
Overview
Three band equalizer
Discussion
This module implements a three band tone control floating point module. Low shelf filter is used for low frequency band with normalised gain with respect to mid band gain. Similarly for high frequency band, high shelf filter is used with normalized gain with respect to mid gain. Finally scale smoothly the entire signal with mid band gain.
Type Definition
typedef struct _ModuleThreeBandToneControl
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
FLOAT32 smoothingTime; // Time constant of the smoothing process.
FLOAT32 lowFreq; // Low band center frequency, in Hz.
FLOAT32 midFreq; // Mid band center frequency, in Hz.
FLOAT32 highFreq; // High band center frequency, in Hz.
FLOAT32 lowGain; // Low band gain, in dB.
FLOAT32 midGain; // Mid band gain, in dB.
FLOAT32 highGain; // High band gain, in dB.
INT32 filterUpdateActive; // Boolean that is set when updating coefficients.
FLOAT32 smoothingCoeff; // Smoothing coefficient for the filter coefficients.
FLOAT32 midTargetGain; // Target gain of the mid frequency gain.
FLOAT32 midCurrentGain; // Current gain of the mid frequency gain.
FLOAT32 midSmoothingCoeff; // Sample-by-sample smoothing coefficient of the mid frequency gain.
FLOAT32* lowerTargetCoeffs; // Target coefficients for the low frequency shelf.
FLOAT32* lowerCurrentCoeffs; // Current coefficients for the low frequency shelf.
FLOAT32* lowerState; // State variables for the low frequency shelf.
FLOAT32* upperTargetCoeffs; // Target coefficients for the high frequency shelf.
FLOAT32* upperCurrentCoeffs; // Current coefficients for the high frequency shelf.
FLOAT32* upperState; // State variables for the high frequency shelf.
} ModuleThreeBandToneControlClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
smoothingTime | float | parameter | 0 | 20 | 0:1000 | msec |
lowFreq | float | parameter | 0 | 60 | 30:200 | Hz |
midFreq | float | parameter | 0 | 600 | 200:4000 | Hz |
highFreq | float | parameter | 0 | 6000 | 4000:20000 | Hz |
lowGain | float | parameter | 0 | 0 | -12:12 | dB |
midGain | float | parameter | 0 | 0 | -12:12 | dB |
highGain | float | parameter | 0 | 0 | -12:12 | dB |
filterUpdateActive | int | parameter | 1 | 1 | Unrestricted | Â |
smoothingCoeff | float | parameter | 1 | 0.03278 | Unrestricted | Â |
midTargetGain | float | parameter | 1 | 1 | Unrestricted | Â |
midCurrentGain | float | parameter | 1 | 1 | Unrestricted | Â |
midSmoothingCoeff | float | parameter | 1 | 0.001041 | Unrestricted | Â |
lowerTargetCoeffs | float* | parameter | 1 | [5 x 1] | Unrestricted | Â |
lowerCurrentCoeffs | float* | parameter | 1 | [5 x 1] | Unrestricted | Â |
lowerState | float* | state | 1 | [2 x 1] | Unrestricted | Â |
upperTargetCoeffs | float* | parameter | 1 | [5 x 1] | Unrestricted | Â |
upperCurrentCoeffs | float* | parameter | 1 | [5 x 1] | Unrestricted | Â |
upperState | float* | state | 1 | [2 x 1] | Unrestricted | Â |
Pins
Input Pins
Name: in
Description: audio input
Data type: float
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: float
MATLAB Usage
File Name: three_band_tone_control_module.m
M=three_band_tone_control_module(NAME)
Implements a three band tone control module. Arguments:
NAME - name of the module.
Â