www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/DesignAChebyshevTypeIIFilterExample.m

    %% Design a Chebyshev Type II Filter
% Construct a default lowpass filter specification object and design a 
% Chebyshev Type II filter. 
d = fdesign.lowpass;

%%
% Use |matchexactly| option to ensure the performance of the filter in the
% passband.
LowpassCheb2 = design(d,'cheby2','matchexactly','passband');

%%
% Use |fvtool| to view the resulting filter
fvtool(LowpassCheb2) 
%%
% Construct a highpass filter specification object and design a 
% Chebyshev Type II filter.
%  Specify the filter order, stopband edge frequency, and the stopband 
%  attenuation to get the filter exactly as required.
d = fdesign.highpass('n,fst,ast',5,20,55,50);
HighpassCheb2 = design(d,'cheby2');
%%
% Use |fvtool| to view the resulting filter
fvtool(HighpassCheb2)
%%
% By design, |cheby2| returns filters that use second-order sections (SOS).
% For many applications, and for most fixed-point applications, SOS filters
% are particularly well-suited.