Académique Documents
Professionnel Documents
Culture Documents
% 1. plot the frequency response in figure 1 the following window functions (41-
point
% window)
% 1.1 hanning window
n=41;
n=[-20:20]+eps;
wc=pi/4;
h=sin(wc*n)./(pi*n);
h1=hanning(n).*h';
n1=0:n-1;
[h1,w]=freqz(h1,1);
figure(1);
% 1.2 hamming window
h2=hamming(n).*h';
n2=0:n-1;
[h2,w]=freqz(h2,1);
% 1.3 bartlett window
h3=bartlett(n).*h';
n3=0:n-1;
[h3,w]=freqz(h3,1);
% 1.4 blackman window
h4=blackman(n).*h';
n4=0:n-1;
[h4,w]=freqz(h4,1);
% 1.5 boxcar window
h5=boxcar(n).*h';
n5=0:n-1;
[h5,w]=freqz(h5,1);
plot(w/pi,20*log10([h1 h2 h3 h4 h5]));grid on
legend('hanning','hamming','bartlett','blackman','boxcar');