%% Determine the Order Difference Between FIR and IIR Designs
% Design FIR equiripple and IIR Butterworth filters from the same set of specifications. Determine the difference in filter order between the two designs.

fir = designfilt('lowpassfir','DesignMethod','equiripple','SampleRate',1e3, ...
                 'PassbandFrequency',100,'StopbandFrequency',120, ...
                 'PassbandRipple',0.5,'StopbandAttenuation',60);
iir = designfilt('lowpassiir','DesignMethod','butter','SampleRate',1e3, ...
                 'PassbandFrequency',100,'StopbandFrequency',120, ...
                 'PassbandRipple',0.5,'StopbandAttenuation',60);
FIR = filtord(fir)
IIR = filtord(iir)

% Copyright 2015 The MathWorks, Inc.