(8.D.2.2) STBiquadCascade
Overview
ST Biquad Cascade
Discussion
The BIQ module is a cascade (up to 10) of infinite impulse response second order filters. The coefficients of each second order section can be configured independently. The overall BIQ transfer function can thus be designed for many purposes. It implements a direct-form I, with the coefficients normalized over a0. A post-shift parameter per cell allows the coefficients to exceed the range of [-1.0 : 1.0]. The BIQ module supports mono and stereo interleaved 32 bit I/O data. The minimum input frame is 96 and the maximum input frame is 480 stereo samples. Post shift is calculated internally.
Current implementation follows this formula :
y(n) = [b0.x(n) + b1.x(n-1) + b2.x(n-2) + a1.y(n-1) + a2.y(n-2)]*2^post_shift
As a consequence, compared to the canonical formula, a1 and a2 coefficients sign is inverted.
The ordering of coefficients is:
b0
b1
b2
a1
a2
Type Definition
typedef struct _ModuleSTBiquadCascade
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 nAPIResult; // Return status for last call into the ST API
INT32 numStages; // Number of stages in the filter. The filter order = 2 * numStages
INT32 enable; // Block enable
FLOAT32* coeffs; // Matrix of filter coefficients. The size of the matrix is 5 x [no stages]. Each col contains the variables for a biquad arranged as [b0; b1; b2; a1; a2].
void * pGlobals; // Points to the global variables structure
} ModuleSTBiquadCascadeClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
nAPIResult | int | state | 0 | 1 | Unrestricted | Â |
numStages | int | const | 0 | 1 | 1:1:10 | Â |
enable | int | parameter | 0 | 1 | 0:1:1 | Â |
coeffs | float* | parameter | 0 | [5 x 1] | Unrestricted | Â |
pGlobals | void * | state | 1 | Â | Unrestricted | Â |
Pins
Input Pins
Name: in
Description: audio input
Data type: fract32
Channel range: 1, 2
Block size range: 96:480
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: fract32
MATLAB Usage
File Name: st_biquad_cascade_module.m
M = st_biquad_cascade_module(NAME, NUMSTAGES)
Audio Weaver wrapper for the ST Biquad Cascade module. Arguments:
NAME - name of the module.
NUMSTAGES - Number of second order stages up to a maximum of 10.
Copyright (c) 2017 DSP Concepts, Inc. All Rights Reserved.
Author: Chris Perry
Â