www.gusucode.com > signal 案例源码程序 matlab代码 > signal/LowpassFilterDesignWithCellOptionExample.m

    %% Lowpass Filter Design with 'cell' Option
% Design a lowpass filter with a passband cutoff of 1500 Hz, a stopband
% cutoff of 2000 Hz, a passband ripple of 0.01, a stopband ripple of 0.1,
% and a sample rate of 8000 Hz. Design an equivalent filter using the
% |'cell'| option.

[n,Wn,beta,ftype] = kaiserord([1500 2000],[1 0],...
    [0.01 0.1],8000);
b = fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale');

c = kaiserord([1500 2000],[1 0],[0.01 0.1],8000,'cell');
bcell = fir1(c{:});

hfvt = fvtool(b,1,bcell,1);
legend(hfvt,'b','bcell')