CASCADE

Purpose:

Filters a series with an IIR digital filter in the time domain where the filter coefficients are represented in cascaded second order stages.

Syntax:

CASCADE(series, iircoef)

(y, zf) = CASCADE(series, iircoef, zi)

series

-

A series, the input data to filter.

iircoef

-

A series, the IIR coefficients in 2nd order cascade form.

zi

-

Optional. A series, the initial conditions.

Returns:

A filtered series.

 

(y, zf) = CASCADE(series, iircoef, zi) returns the filtered series and final conditions.

Example:

W1: butterworth(1, 100.0, 10)

W2: gsin(100, 1/100, 4.0) + gsin(100, 1/100, 40.0)

W3: cascade(w2, w1)

 

W1 contains a 10 Hz lowpass Butterworth filter. W2 contains the sum of a 4 Hz and 40 Hz sinewave. W3 removes the 40 Hz component by applying the cascade IIR filter coefficients.

Example:

W1: butterworth(1, 100.0, 10)

W2: gsin(200, 1/100, 4.0) + gsin(200, 1/100, 40.0)

W3: extract(w2, 1, 100)

W4: extract(w2, 101, -1)

W5: (y, zf) = cascade(w3, w1);y

W6: cascade(w4, w1, zf)

W7: concat(w5, w6)

W8: cascade(w2, w1)

W9: w7 - w8

 

W1 contains a 10 Hz lowpass Butterworth filter.

W2 contains 200 samples of the sum of a 4 Hz and 40 Hz sinewave.

W3 and W4 split the input series into two sections.

W5 and W6 filter each section where the final conditions of the first section are used as the initial conditions of the second section.

W7 combines the filtered sections and W8 filters the original data in one step.

W9 shows the data filtered in sections is identical to the unsectioned filtered data.

Remarks:

An Infinite Impulse Response (IIR) filter can be implemented with the following difference equation:

 

 

where y[n] is the output data, x[n] the input and a[k] and b[k] are the filter coefficients.

 

The equivalent Z-transform form of the filter is represented by:

 

 

To minimize round-off error, enhance stability and provide a system more resistant to coefficient quantization noise, CASCADE implements the filter in terms of cascaded second order stages or bi-quads:

 

 

or equivalently:

 

 

where G is the system gain, bk and ak are the filter coefficients for the kth stage.

Thus, the filter can be thought of as a system of cascaded processing stages, represented schematically as:

 

 

 

CASCADE implements each stage in the 2nd order transposed Form II depicted below:

 

 

 

 

To implement the transposed Form II structure, CASCADE expects the filter coefficients of input parameter iircoef to be provided in the following order:

 

{G, b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ... , bN0, bN1, bN2, aN1, aN2}

 

This coefficient form is produced by the BESSEL, BUTTERWORTH, CHEBY1, CHEBY2 and ELLIPTIC IIR filters design functions provided by DADiSP/Filters.

 

See SOSFILT to process a filter implemented with coefficients in second order section form. Note the series and filter coefficient input arguments are reversed for SOSFILT and CASCADE.

 

See FILTEQ to process a filter implemented as a standard difference equation.

See Also:

BESSEL

BUTTERWORTH

CHEBY1

CHEBY2

CLOGMAG

CPHASE

DADiSP/Filters

ELLIPTIC

FILTEQ

SOSFILT

ZPFCOEF

References:

 

[1]

Oppenheim and Schafer

 

Digital Signal Processing

 

Prentice Hall, 1975

 

[2]

Digital Signal Processing Committee

 

Programs for Digital Signal Processing

 

I.E.E.E. Press, 1979