Multichannel Biquad filter
Standard 5 coefficient Biquad filter that operates on multichannel data. The module uses a Transposed Direct Form 2 implementation using the difference equation:
wN = a1*wNm1 + a2*wNm2 + x[n] y[n] = b0*wN + b1*wNm1 + b2*wNm2 wNm2 = wNm1 wNm1 = wN
The module has built in smoothing on a block-by-block basis. The user sets the .coeffs and the processing function updates the .currentCoeffs at the start of each block.
This module is an example to be used with the documentation.
typedef struct _ModuleTutorialBiquadSmoothed
{
    ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
    FLOAT32 smoothingTime; // Time constant of the smoothing process.
    FLOAT32 smoothingCoeff; // Smoothing coefficient. This is computed based on the smoothingTime, sample rate, and block size of the module.
    FLOAT32* coeffs; // Filter coefficients [b0; b1; b2; a1; a2]
    FLOAT32* currentCoeffs; // Smoothed filter coefficients [b0; b1; b2; a1; a2]
    FLOAT32* state; // State variables. 2 per channel.
} ModuleTutorialBiquadSmoothedClass;
Name |
Type |
Usage |
isHidden |
Default value |
Range |
Units |
smoothingTime |
float |
parameter |
0 |
10 |
0:1000 |
msec |
smoothingCoeff |
float |
derived |
1 |
0.064493 |
Unrestricted |
|
coeffs |
float* |
parameter |
0 |
[5 x 1] |
Unrestricted |
|
currentCoeffs |
float* |
state |
1 |
[5 x 1] |
Unrestricted |
|
state |
float* |
state |
1 |
[2 x 1] |
Unrestricted |
|
Name: in
Description: Input signal
Data type: float
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Name: out
Description: Output signal
Data type: float
File Name: tutorial_biquad_smoothed_module.m
M = tutorial_biquad_smoothed_module(NAME)
Example showing how to implement a multichannel Biquad filter with
coefficient smoothing. Arguments:
NAME - name of the module.
© DSP Concepts - 2019