%% IIR Filter Effective Impulse Response Length — Digital Filter
% Use designfilt to design a 4th-order lowpass elliptic filter with normalized passband frequency 0.4π rad/sample. Specify 1 dB of passband ripple and 60 dB of stopband attenuation. Determine the effective impulse response sequence length and visualize it.

d = designfilt('lowpassiir','FilterOrder',4,'PassbandFrequency',0.4, ...
               'PassbandRipple',1,'StopbandAttenuation',60, ...
               'DesignMethod','ellip');
len = impzlength(d)
impz(d)

% Copyright 2012 The MathWorks, Inc.