%% Impulse Response of Elliptic Lowpass Filter
% Design a fourth-order lowpass elliptic filter with normalized passband frequency 0.4 rad/sample. Specify a passband ripple of 0.5 dB and a stopband attenuation of 20 dB. Plot the first 50 samples of the impulse response.

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

%
% Design the same filter using designfilt. Plot the first 50 samples of its impulse response.

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

% Copyright 2015 The MathWorks, Inc.