qslazio
Full Member level 3
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;
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!
fbin = 11;
n = 512;
u = 1/2 * sin(2*pi*fbin/n*[0:n-1]);
w = hann;
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!