dsp
w=boxcar(N);
stem(w)
title('矩形窗')
subplot(2,3,2);
w=hanning(N);
stem(w)
title('Hanning窗')
subplot(2,3,3);
w=hamming(N);
stem(w)
title('Hamming窗')
subplot(2,3,4);
w=blackman(N);
stem(w)
title('blackman窗')
subplot(2,3,5);
w=bartlett(N);
stem(w)
title('三角形窗')
subplot(2,3,6);
w=kaiser(N);
stem(w)
title('kaiser窗')
2,利用fft函数分析常用窗函数的频域特性
clear;
N=51;
w=boxcar(N);
y=fft(w,200);
subplot(3,3,1);
stem([0:N-1],w);title('时域波形');
subplot(3,3,2);
y0= abs(fftshift(y));
plot([-100:99],y0);title('矩形窗频域');
subplot(3,3,3);
w=hanning(N);
y=fft(w,200);
y0= abs(fftshift(y));
plot([-100:99],y0);title('hanning窗频域');
subplot(3,3,4);
w=hamming(N);
y=fft(w,200);