线性低通滤波器的MATLAB仿真程序 clear; close all; % MATLAB PROGRAM %Window-based FIR filter design %Per foments parameter wp=0.5*pi; ws=0.8*pi; % width of the transition band wdelta=ws-wp; %Length of the filter N=cei1(8*pi/wdelta) if rem(N,2)一0 N=N+1; end %Length of the window Nvr-N; %Cutof Frequency of the filter wc=(wp+ws)/2; %Computeim pulsere sponseo fth eid ealfi lter n=O:N-1; alpha-(N-I)/2; m=n-alpha+0.00001; hd=sin(wc*m)./(pi*m); %Compute time response of the Hanning window win=hanning(Nw); %Computea ctureim pulsere sponseo fth efi lter h=hd.*win; b=h; freqz(b,1,512)
clear; close all;
% MATLAB PROGRAM
%Window-based FIR filter design
%Per foments parameter
wp=0.5*pi;
ws=0.8*pi;
% width of the transition band
wdelta=ws-wp;
%Length of the filter
N=cei1(8*pi/wdelta)
if rem(N,2)一0
N=N+1;
end
%Length of the window
Nvr-N;
%Cutof Frequency of the filter
wc=(wp+ws)/2;
%Computeim pulsere sponseo fth eid ealfi lter
n=O:N-1;
alpha-(N-I)/2;
m=n-alpha+0.00001;
hd=sin(wc*m)./(pi*m);
%Compute time response of the Hanning window
win=hanning(Nw);
%Computea ctureim pulsere sponseo fth efi lter
h=hd.*win;
b=h;
freqz(b,1,512)