%% IIR Filter Effective Impulse Response Length — Second-Order Sections
% Design a 4th-order lowpass elliptic filter with a cutoff frequency of 0.4π rad/sample. Specify 1 dB of passband ripple and 60 dB of stopband attenuation. Design the filter in pole-zero-gain form and obtain the second-order section matrix using zp2sos. Determine the effective impulse response sequence length from the second-order section matrix.

[z,p,k] = ellip(4,1,60,.4);
[sos,g] = zp2sos(z,p,k);
len = impzlength(sos)

% Copyright 2012 The MathWorks, Inc.