Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Overview

2nd order IIR filter

Discussion

Standard second order 5 multiply recursive 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 4*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 _ModuleBiquadFract32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 updateActive;                           // Specifies whether the filter coefficients are updating (=1) or fixed (=0).
    INT32 postShift;                              // Number of bits to shift
    INT32 currentPostShift;                       // Current post shift
    FLOAT32* coeffs;                              // coefficients
    fract32* coeffsFract32;                       // coefficients in Fract32
    fract32* state;                               // State variables. 4 per channel.
    fract32* currentCoeffsFract32;                // Current coefficients in Fract32
} ModuleBiquadFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

updateActive

int

state

0

1

0:1

postShift

int

derived

1

1

Unrestricted

currentPostShift

int

state

1

1

Unrestricted

coeffs

float*

parameter

0

[5 x 1]

Unrestricted

coeffsFract32

fract32*

derived

0

[5 x 1]

Unrestricted

state

fract32*

state

1

[4 x 1]

Unrestricted

currentCoeffsFract32

fract32*

state

0

[5 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_fract32_module.m

 M=biquad_fract32_module(NAME)
 Creates a second order IIR filter Fract32 (biquad) for use with the Audio
 Weaver.  Arguments:
     NAME - name of the module.
  • No labels