Document toolboxDocument toolbox

ButterworthFilter

Overview

Butterworth filter

Discussion

The module provides Butterworth low pass, high pass, or all pass filters, from 1st order to 8th order. The module operates on 32-bit floating-point data. The order of the filter is determined by the ORDER argument when instantiated, and the filterType parameter is used to select which type of filter is designed. Once ORDER is set, it cannot be changed. filterType, on the other hand, can be changed at run-time. filterType=0 designs a low pass filter. filterType=1 designs a high pass filter. filterType=2 designs an allpass filter.

Note that only odd order allpass filters are supported. If you try and build an even order allpass, you will get a warning message.

Type Definition

typedef struct _ModuleButterworthFilter { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 filterType; // Specifies what type of filter is designed (lowpass=0, highpass=1, allpass=2). INT32 order; // Order of the filter. FLOAT32 cutoff; // Cutoff frequency of the filter in Hz - range clamped to calc based on sample rate awe_modBiquadCascadeInstance *filt; // Cascade of second order Biquad filters } ModuleButterworthFilterClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

filterType

int

parameter

0

0

0:2

 

order

int

const

0

2

1:8

 

cutoff

float

parameter

0

250

1:0.1:20000

Hz

Pins

Input Pins

Name: in

Description: audio input

Data type: float

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: float

MATLAB Usage

File Name: butter_filter_module.m

SYS=butter_filter_module(NAME, ORDER) Creates a Butterworth high-pass or low-pass filter. Arguments: NAME - name of the module. ORDER - filter order.

Â