Overview
2nd order smoothly updating IIR filter with high precision implementation
Discussion
Smoothly varying 5 coefficient biquad filter. 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 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 order of the coefficients in coeffs array must be [b0 b1 b2 a1 a2]. In the set function the coefficients will be mapped from Biquad form to High Precision representation [Fb; Gaa; Gab; K; Fa].
...
The rate of smoothing is controlled by the .smoothingTime instance variable.
Type Definition
Code Block |
---|
typedef struct _ModuleBiquadSmoothedHP { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 updateActive; // Specifies whether the filter coefficients are updating (=1) or fixed (=0). 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; // Biquad filter coefficients arranged as [b0; b1; b2; a1; a2]. FLOAT32* targetCoeffs; // Array of filter target coefficients. The size of the array is 5 and contains the variables for a biquad arranged as [Fb; Gaa; Gab; K; Fa]. FLOAT32* currentCoeffs; // Array of filter current coefficients. The size of the array is 5 and contains the variables for a biquad. FLOAT32* state; // State variables. 2 per channel. } ModuleBiquadSmoothedHPClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
updateActive | int | parameter | 0 | 1 | 0:1 | |
smoothingTime | float | parameter | 0 | 10 | 0:1000 | msec |
smoothingCoeff | float | derived | 1 | 0.06449 | Unrestricted | |
coeffs | float* | parameter | 0 | [5 x 1] | Unrestricted | |
targetCoeffs | float* | derived | 1 | [5 x 1] | Unrestricted | |
currentCoeffs | float* | state | 1 | [5 x 1] | Unrestricted | |
state | float* | state | 1 | [2 x 1] | Unrestricted |
Pins
Input Pins
Name: in
Description: audio input
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: float
MATLAB Usage
File Name: biquad_smoothedHP_module.m
...