Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

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 4*numChannels*numStages values. Each 2nd order section implements the difference equation:

...

The filter coefficients 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].$

Type Definition

Code Block
typedef struct _ModuleBiquadCascadeFract32
{
    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].
    fract32* coeffsFract32;                       // 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].
    fract32* state;                               // State variables. 4 per channel.
    INT32* postShift;                             // Number of bits to shift
} ModuleBiquadCascadeFract32Class;

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

coeffsFract32

fract32*

derived

1

[5 x 1]

Unrestricted

state

fract32*

state

1

[4 x 1]

Unrestricted

postShift

int*

derived

1

[1 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: fract32

MATLAB Usage

File Name: biquad_cascade_fract32_module.m

...