%% Transform Lowpass Filter to Bandstop Filter
% 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 bandstop filter by placing the cutoff frequencies of the prototype filter at 0.25π and 0.75π.

[num,den] = iirlp2bs(b,a,0.5,[0.25 0.75]);

% Compare the magnitude responses of the filters using FVTool.

fvt = fvtool(b,a,num,den);
legend(fvt,'Prototype','Target')

% Copyright 2012 The MathWorks, Inc.