Hello,
I'm trying to understand better how periodogram works by using it with pure sinusoids.
Fs = 1000;t = 0:1/Fs:1-1/Fs;x = sin(2*pi*100*t);[psdestx,Fxx] = periodogram(x,[],length(x),Fs);plot(Fxx,psdestx); grid on;xlabel('Hz');title('Periodogram Power Spectral Density Estimate');
I took most of the above code from a MATLAB example in the documentation center: http://www.mathworks.com/help/signal/ug/psd-estimate-using-fft.html
The response, 0.5 peak at 100 Hz, seems correct to me, since the theoretical average power of a sinusoid is (A^2)/2. It's also the same answer I get when I type:
mean(x.^2)
My doubt arises when I increase data length, from the code's second line:
t = 0:1/Fs:2-1/Fs;
Why does this change my PSD estimate? Since I'm dealing with a periodic signal, shouldn't the average power remains constant, despite data length?
Thank you, VinÃcius
Best Answer