(8.D.2.5) GraphicEQBandHpFract32
Overview
Single band of a cascade graphic equalizer with High Precision Biquad fract32 algorithm
Discussion
This module implements a single stage of a graphic equalizer. The stage provides boost or cut over a specified frequency range. A multistage graphic EQ subsystem is constructed as a series cascade of these modules. The multistage graphic EQ is contained within graphic_eq_subsystem.m. This module is typically not used directly. Instead, use the graphic_eq_subsystem.m
The variables .lowerEdge and .upperEdge specify the range of frequencies, in Hz, over which the filter is effective. The variable .gain specifies the boost or cut in dB.
The design of the module is based upon the paper "Graphic Equalizer Design User Higher-Order Recursive Filters" by Holters and Zoelzer. The order of the filter, either 4, 8, or 12, is specified upon instantiation. Higher order filters provide sharper cutoffs at the expense of additional computation. As a rule of thumb, you can use 4th order filters until you have approximately 5 filter bands; 8th order filters until you have 15 filter bands; and 12th order filters for up to 31 bands. The order of the filter can only be set at instantiation time.
Internally, the filter is implemented as a cascade of High Precision second order biquad sections. These filters are smoothly updating based upon the variable .smoothingTime. Note, some low frequency filters may go unstable if the smoothingTime is too large.
Type Definition
typedef struct _ModuleGraphicEQBandHpFract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
FLOAT32 gain; // Gain in the center of the band, in dB
FLOAT32 lowerEdge; // Lower frequency edge of the band, in Hz
FLOAT32 upperEdge; // Upper frequency edge of the band, in Hz
FLOAT32 smoothingTime; // Time constant of the smoothing process.
INT32 numStages; // Number of 2nd order stages in the filter
INT32 updateActive; // Specifies whether the filter coefficients are updating (=1) or fixed (=0).
INT32 bShift; // Number of bits to shift of Numerator coefficients
INT32 aShift; // Number of bits to shift of Denominator coefficients
fract32 smoothingCoeff; // Smoothing coefficient
FLOAT32* coeffs; // Matrix of filter coefficients. The size of the matrix is 5 x numStages. Each column contains the variables for a biquad arranged as [b0; b1; b2; a1; a2].
fract32* coeffsFract32; // Matrix of filter coefficients. The size of the matrix is 5 x numStages. Each column contains the variables for a biquad arranged as [b0; b1; b2; a1; a2].
fract32* currentCoeffsFract32; // Matrix of filter coefficients. The size of the matrix is 5 x numStages. Each column contains the variables for a biquad arranged as [b0; b1; b2; a1; a2].
fract32* state; // State variables. 6 per channel.
} ModuleGraphicEQBandHpFract32Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
gain | float | parameter | 0 | 0 | -12:12 | dB |
lowerEdge | float | parameter | 0 | 100 | 10:20000 | Hz |
upperEdge | float | parameter | 0 | 500 | 10:20000 | Hz |
smoothingTime | float | parameter | 0 | 50 | 0:1000 | msec |
numStages | int | const | 0 | 4 | Unrestricted | Â |
updateActive | int | state | 0 | 1 | 0:1 | Â |
bShift | int | derived | 1 | 4 | Unrestricted | Â |
aShift | int | derived | 1 | 1 | Unrestricted | Â |
smoothingCoeff | fract32 | derived | 1 | 0.01324 | Unrestricted | Â |
coeffs | float* | derived | 1 | [5 x 4] | Unrestricted | Â |
coeffsFract32 | fract32* | derived | 1 | [5 x 4] | Unrestricted | Â |
currentCoeffsFract32 | fract32* | state | 1 | [5 x 4] | Unrestricted | Â |
state | fract32* | state | 1 | [24 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
MATLAB Usage
File Name: graphic_eq_band_hp_fract32_module.m
M=graphic_eq_band_hp_fract32_module(NAME, ORDER)
Implements a single band of a cascade graphic equalizer. This modules
forms part of the overall graphic_eq_hp_fract32_subsystem. Arguments:
NAME - name of the module.
ORDER - filter order of the stage. This must be either 4, 8, or 12.
By default, ORDER=8.
Â