%% Elliptic Filter as Second-Order Sections
% Design a second-order sections, direct-form II, transposed discrete-time filter starting from a 6th-order lowpass elliptic filter. Specify a passband edge frequency of 0.4\pi rad/sample, a passband ripple of 1 dB, and a stopband attenuation of 60 dB. Visualize the filter response.

[z,p,k] = ellip(6,1,60,0.4);    % Obtain filter coefficients
[s,g] = zp2sos(z,p,k);          % Convert to SOS

Hd = dfilt.df2tsos(s,g);

fvtool(Hd)

% Copyright 2015 The MathWorks, Inc.