BiquadCascade
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 2*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 are 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].
On the ADI SHARC+ platforms, the module make use of IIR Accelerators to optimize the processing time. The processing load is distributed as 1 channel processing in IIRA is equivalent to 2 channel core processing. i.e. the IIRA channels=floor(numChannels/3). As the accelerators access data by DMA, when the dm and pm caches are enabled, extra cycles are needed to maintain cache coherence. It is highly recommended to increase the allocation priority of this module instance in the signal flow to have a larger chance to allocate in the AWE fast heaps. In this way, the overhead from accelerator can be minimized. If any of this module instances allocated in the AWE slow heap, please note that the CPU load might be higher than without IIRA due to cache coherence maintenance. Maximum number of channels that can be processed in IIR Accelerator is limited to 32 and the remaining channels are processed by the core. i.e. IIRA channels=min(floor(numChannels/3), 32)
Type Definition
typedef struct _ModuleBiquadCascade
{
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].
FLOAT32* state; // State variables. 2 per channel.
void * hardware_specific_struct_pointer; // Usually NULL, but for optimizations that use 3rd party optimizations (like ne10), this may point to the required instance structure
} ModuleBiquadCascadeClass;
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 | |
state | float* | state | 1 | [2 x 1] | Unrestricted | |
hardware_specific_struct_pointer | void * | state | 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: biquad_cascade_module.m
M=biquad_cascade_module(NAME, NUMSTAGES)
Creates a 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.