%% Transform Lowpass Filter to Multiband Filters
% Design a prototype real IIR lowpass elliptic filter with a gain of about –3 dB at 0.5π rad/sample.

[b,a] = ellip(3,0.1,30,0.409);

%
% Create a real multiband filter with two passbands.

[num1,den1] = iirlp2mb(b,a,0.5,[2 4 6 8]/10);

%
% Create a real multiband filter with two stopbands.

[num2,den2] = iirlp2mb(b,a,0.5,[2 4 6 8]/10, 'stop');

%
% Compare the magnitude responses of the filters using FVTool.

hvft = fvtool(b,a,num1,den1,num2,den2);
legend(hvft,'Prototype','Two passbands','Two stopbands')

% Copyright 2012 The MathWorks, Inc.