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

    %% Design a Chebyshev Type I Filter
% Construct a default lowpass filter specification object and design a 
% Chebyshev Type I filter. 
d = fdesign.lowpass; designopts(d,'cheby1');

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

%%
% Use |fvtool| to view the resulting filter
fvtool(LowpassCheb1) 
%%
% Construct a highpass filter specification object and design a 
% Chebyshev Type I filter.
%  Specify the filter order, passband edge frequency, and the passband 
%  ripple to get the filter exactly as required.
d = fdesign.highpass('n,fp,ap',7,20,.4,50); 
HighpassCheb1 = design(d,'cheby1');
%%
% Use |fvtool| to view the resulting filter
fvtool(HighpassCheb1)
%%
% By design, |cheby1| returns filters that use second-order sections (SOS).
% For many applications, and for most fixed-point applications, SOS filters
% are particularly well-suited.