(8.D.1.2) BiquadCascadeHPFract32
Overview
2nd order cascaded IIR filter, high precision
Discussion
Second order cascaded 5 multiply recursive filter with algorithm precision uses 24x24 with 56-bit accumulator. The module is designed to operate on multiple channels and applies the same coefficients across all channels. The state array is allocated to contain 6*numStages*numChannels values. The frequency response of the module is determined by the values of the 5 coefficients, and the coefficients come directly from the MATLAB second order representation. The leading a0 coefficient is not supplied and is assumed to equal 1.0. The module 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].$
Type Definition
typedef struct _ModuleBiquadCascadeHPFract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 numStages; // Number of cascaded stages of the second order filter.
INT32 bShift; // Number of bits to shift of Numerator coefficients
INT32 aShift; // Number of bits to shift of Denominator coefficients
FLOAT32* coeffs; // coefficients
fract32* coeffsFract32; // coefficients in Fract32
fract32* state; // State variables. 6 per channel.
} ModuleBiquadCascadeHPFract32Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
numStages | int | const | 0 | 1 | 1:1:32 | Â |
bShift | int | parameter | 1 | 1 | Unrestricted | Â |
aShift | int | parameter | 1 | 1 | Unrestricted | Â |
coeffs | float* | parameter | 0 | [5 x 1] | Unrestricted | Â |
coeffsFract32 | fract32* | derived | 0 | [5 x 1] | Unrestricted | Â |
state | fract32* | state | 1 | [6 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_cascadeHP_fract32_module.m
M=biquad_cascadeHP_fract32_module(NAME, NUMSTAGES)
Creates a second order IIR cascaded filter Fract32 (biquad) for use with the Audio
Weaver. Arguments:
NAME - name of the module.
NUMSTAGES - number of second order filter stages.
Â