%% 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.

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

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

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

% Copyright 2012 The MathWorks, Inc.