%% Steiglitz-McBride Approximation of a Filter
% Approximate the impulse response of an IIR filter with a system of lower order.
% Specify a 6th-order Butterworth filter with normalized 3-dB frequency 0.2\pi rad/sample.

d = designfilt('lowpassiir','FilterOrder',6, ...
    'HalfPowerFrequency',0.2,'DesignMethod','butter');

%
% Use the Steiglitz-McBride iteration to approximate the filter with a 4th-order system.

h = impz(d);
[bb,aa] = stmcb(h,4,4);

%
% Plot the frequency responses of the two systems.

hfvt = fvtool(d,bb,aa,'Analysis','freq');
legend(hfvt,'Butterworth','Steiglitz-McBride')

% Copyright 2015 The MathWorks, Inc.