%% Step Response of an Elliptic Filter
% Design a fourth-order lowpass elliptic filter with normalized passband frequency 0.4\pi rad/sample. Specify a passband ripple of 0.5 dB and a stopband attenuation of 20 dB. Plot the first 50 samples of the filter's step response.

[b,a] = ellip(4,0.5,20,0.4);
stepz(b,a,50)
grid

%
% Create the same filter using designfilt and display its step response using fvtool.

d = designfilt('lowpassiir','FilterOrder',4,'PassbandFrequency',0.4, ...
               'PassbandRipple',0.5,'StopbandAttenuation',20, ...
               'DesignMethod','ellip');
stepz(d,50)

% Copyright 2015 The MathWorks, Inc.