(8.D.1.2) ThreeBandToneControlFract32
Overview
Three band equalizer
Discussion
This module implements a three band tone control fixed 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 normalised gain with respect to mid gain. Finally scale smoothely the entire signal with mid band gain.
Type Definition
typedef struct _ModuleThreeBandToneControlFract32
{
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 headRoomBits; // Head room bits. This prevents internal clipping in the filter stages
INT32 postShift; // postShift controls the headroom within the fixed-point filtering
FLOAT32 twoPowMinusPostShift; // Two power -postShift value
INT32 filterUpdateActive; // Boolean that is set when updating coefficients
fract32 smoothingCoeff; // Smoothing coefficient for the filter coefficients
fract32 midTargetGain; // Target gain of the mid frequency gain
fract32 midCurrentGain; // Current gain of the mid frequency gain
fract32 midSmoothingCoeff; // Sample-by-sample smoothing coefficient of the mid frequency gain
fract32* lowerTargetCoeffs; // Target coefficients for the low frequency shelf
fract32* lowerCurrentCoeffs; // Current coefficients for the low frequency shelf
fract32* lowerState; // State variables for the low frequency shelf
fract32* upperTargetCoeffs; // Target coefficients for the high frequency shelf
fract32* upperCurrentCoeffs; // Current coefficients for the high frequency shelf
fract32* upperState; // State variables for the high frequency shelf
} ModuleThreeBandToneControlFract32Class;
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 |
headRoomBits | int | parameter | 1 | 2 | Unrestricted | Â |
postShift | int | parameter | 1 | 5 | Unrestricted | Â |
twoPowMinusPostShift | float | parameter | 1 | 0.03125 | Unrestricted | Â |
filterUpdateActive | int | parameter | 1 | 1 | Unrestricted | Â |
smoothingCoeff | fract32 | parameter | 1 | 0.03278 | Unrestricted | Â |
midTargetGain | fract32 | parameter | 1 | 0.03125 | Unrestricted | Â |
midCurrentGain | fract32 | parameter | 1 | 0.03125 | Unrestricted | Â |
midSmoothingCoeff | fract32 | parameter | 1 | 0.001041 | Unrestricted | Â |
lowerTargetCoeffs | fract32* | parameter | 1 | [5 x 1] | Unrestricted | Â |
lowerCurrentCoeffs | fract32* | parameter | 1 | [5 x 1] | Unrestricted | Â |
lowerState | fract32* | state | 1 | [4 x 1] | Unrestricted | Â |
upperTargetCoeffs | fract32* | parameter | 1 | [5 x 1] | Unrestricted | Â |
upperCurrentCoeffs | fract32* | parameter | 1 | [5 x 1] | Unrestricted | Â |
upperState | fract32* | state | 1 | [4 x 1] | Unrestricted | Â |
Pins
Input Pins
Name: in
Description: audio input
Data type: fract32
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: fract32
Scratch Pins
Channel count: 1
Block size: 32
Sample rate: 48000
MATLAB Usage
File Name: three_band_tone_control_fract32_module.m
M=three_band_tone_control_fract32_module(NAME)
Implements a three band tone control module.
Arguments:
NAME - name of the module.
Â