(8.D.1.2) BiquadCascadeFract32
Overview
Cascade of second order Biquad filters
Discussion
A cascade of second order 5 multiply recursive filters. The module is designed to operate on multiple channels and applies the same coefficients across all channels. The state array is allocated to contain 4*numChannels*numStages values. Each 2nd order section implements the difference equation:
$y[n]=b_0x[n]+b_1x[n-1]+b_2x[n-2]-a_1y[n-1]-a_2y[n-2].$
The filter coefficients stored in the matrix .coeffs. This matrix is of dimension 5 x numStages and each column of the matrix corresponds to an individual 2nd order Biquad stage. Within each column, the coefficients are ordered as: $[b0; b1; b2; a1; a2].$
Type Definition
typedef struct _ModuleBiquadCascadeFract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 numStages; // Number of stages in the filter. The filter order = 2 * numStages
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* state; // State variables. 4 per channel.
INT32* postShift; // Number of bits to shift
} ModuleBiquadCascadeFract32Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
numStages | int | const | 0 | 1 | 1:1:32 | Â |
coeffs | float* | parameter | 0 | [5 x 1] | Unrestricted | Â |
coeffsFract32 | fract32* | derived | 1 | [5 x 1] | Unrestricted | Â |
state | fract32* | state | 1 | [4 x 1] | Unrestricted | Â |
postShift | int* | derived | 1 | [1 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: biquad_cascade_fract32_module.m
M=biquad_cascade_fract32_module(NAME, NUMSTAGES)
Creates a fract32 module that implements a cascade of second order Biquad
stages. This module can be used to implement high order IIR filters.
The module operates on multiple channels and uses the same set of
coefficients across channels. Arguments:
NAME - name of the module.
NUMSTAGES - number of biquad stages. The overall filter order
is 2*NUMSTAGES.
Â