viernes, 27 de abril de 2012

FFT Window Tradeoffs

Problem 5-4:  Window Tradeoffs

Generate the following signal
Window x(n) with

i)                     A rectangular window of length 128
ii)                   A Hamming window of length 128 

Using J-DSP, plot the FFT of size N=128 for both cases (use dB scaling).  Why is the shape of the FFT different?  Which window would you choose and why?



n=1:128;
y=0.4*sin(2*pi*0.125*n)+sin(2*pi*0.111*n);
y1=fft(y);%ventana rectangular
y2=fft(y.*hamming(128)');%ventana de hamming
plot(abs(y1))
hold on
plot(abs(y2),'r')





plot(10*log(abs(y1)))
hold on
plot(10*log(abs(y2)),'r')
xlabel('f')
ylabel('dB=10*log(abs(y1))')



No hay comentarios:

Publicar un comentario