%% Impulse Response Length for Filter System Objects
% Design an IIR Butterworth and an FIR equiripple filter for data sampled at 1 kHz. Set the passband frequency is 100 Hz and the stopband frequency is 150 Hz. Set the passband ripple to 0.5 dB and the stopband attenuation to 60 dB. Create System objects for the filters and compare the filter impulse response sequence lengths.

d = fdesign.lowpass('Fp,Fst,Ap,Ast',100,150,0.5,60,1000);
Hd1 = design(d,'butter','SystemObject',true);
Hd2 = design(d,'equiripple','SystemObject',true);
len = [impzlength(Hd1) impzlength(Hd2)]

% Copyright 2012 The MathWorks, Inc.