Filters a series with an IIR digital filter in the time domain where the filter coefficients are represented in cascaded second order stages.
CASCADE(series, iircoef)
(y, zf) = CASCADE(series, iircoef, zi)
series 
 
A series, the input data to filter. 
iircoef 
 
A series, the IIR coefficients in 2^{nd} order cascade form. 
zi 
 
Optional. A series, the initial conditions. 
A filtered series.
(y, zf) = CASCADE(series, iircoef, zi) returns the filtered series and final conditions.
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.
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.
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
To minimize roundoff 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
or equivalently:
where G is the system gain, b_{k} and a_{k} are the filter coefficients for the k^{th} 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, b_{10}, b_{11}, b_{12}, a_{11}, a_{12}, b_{20}, b_{21}, b_{22}, a_{21}, a_{22}, ... , b_{N0}, b_{N1}, b_{N2}, a_{N1}, a_{N2}}
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.
[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 