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

    %% Design a Lowpass Filter with Transition Band  
% The following illustrates how to design a lowpass filter of order 225
% with transition band.   

%% 
% Create the frequency and amplitude vectors, |f| and |a|. 
f = [0 0.25 0.3 1]
a = [1 1 0 0]   

%% 
% Use |firls| to obtain the |n+1| coefficients of the order |n| lowpass
% FIR filter. 
b = firls(255,f,a);   

%% 
% Show the impulse response of the filter
fvtool(b,'impulse')