Filters implemented using the structure defined by the below equations directly are known as direct form IIR filters. Direct form implementations are often sensitive to errors introduced by coefficient quantization and by computational, precision limits. Additionally, a filter designed to be stable can become unstable with increasing coefficient length, which is proportional to filter order.
A less sensitive structure can be obtained by breaking up the direct form transfer function into lower order sections, or filter stages. The direct form transfer function of the filter given by the following equation (with a0 = 1) can be written as a ratio of z transforms, as follows
.
By factoring the above equation into second-order sections, the transfer function of the filter becomes a product of second-order filter functions
where is the largest integer
Na/2, and Na
Nb. (Ns is the number of stages.) This new filter structure can be described as a cascade of second-order filters.
Each individual stage is implemented using the direct form II filter structure because it requires a minimum number of arithmetic operations and a minimum number of delay elements (internal filter states). Each stage has one input, one output, and two past internal states (sk[i1] and sk[i2]).
If n is the number of samples in the input sequence, the filtering operation proceeds as in the following equations.
for each sample
i = 0, 1, 2, , n-1.
For filters with a single cutoff frequency (lowpass and highpass), second-order filter stages can be designed directly. The overall IIR lowpass or highpass filter contains cascaded second-order filters.
For filters with two cutoff frequencies (bandpass and bandstop), fourth-order filter stages are a more natural form. The overall IIR bandpass or bandstop filter is cascaded fourth-order filters. The filtering operation for fourth-order stages proceeds as in the following equations.
Notice that in the case of fourth-order filter stages,