Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help! simple question on windowed fft analysis

Status
Not open for further replies.

qslazio

Full Member level 3
Joined
May 23, 2004
Messages
175
Helped
18
Reputation
36
Reaction score
7
Trophy points
1,298
Activity points
1,420
I create a sine-wave in matlab and do fft
fbin = 11;
n = 512;
u = 1/2 * sin(2*pi*fbin/n*[0:n-1]);
w = hann(n);
w1 = norm(w,1);
U = fft(w.*u)/(w1); % scale for sine-wave
psd = abs(U).^2;
pow = sum(psd);

but I get the wrong answer, pow supposed to be 0.125 which is 0.5^2/2.
The reason is that there are two extra non-zero bins around signal bin which contributes the extra power for my pow summation.

I cannot understand this:
the signal data is precisely integer number of period. where comes from these two extra bins.
if i use rectangle window, no this problem. why?
can anyone explain this to me "mathematically"?

thanks very much!
 

hi,
there is error in your code: U = fft(w.*u)/(w1);
i guess what you mean is: U = fft(w'.*u)/(w1);
right?

value in matlab are in format double float.
signl 'u' can not have infinite precision, that means: there exist quantization error, therefor even with retangle windowing the fft floor still not exactly flat.
hann(n) compose with quantization error too.
fft with retangle windowing have non-zero bin aside 12 too, but it get more serious with hann windowing because of quantization error get's larger.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top