Professional Documents
Culture Documents
% Write A Matlab Code For Designing of Hamming Window
% Write A Matlab Code For Designing of Hamming Window
clc;
clear;
fc= 250;
fs=1000;
M=61
hd=zeros(1,M)
n=-(M-1)/2:1:(M-1)/2;
for i=1:1:length(n)
hd(i)=(sin((n(i)+0.000001)*pi/2)/(2*((n(i)+0.000001)*
pi/2)))
end
whm=zeros(1,length(n))
for k= 1:1:M
whm(k)=0.54-0.46*cos(2*pi*(k-1)/(M-1))
end
hn=whm.*hd;
Hf=fft(hn,512);
plot(10*log10(abs(Hf))); axis([ 0 256 -40 5]);