Why does periodogram varies with data length?
6 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Wayne King
2013-10-14
编辑:Wayne King
2013-10-14
Because the periodogram is strictly a PSD estimate unless you specify the 'power' option. By doubling the time interval you are integrating over twice the interval.
If you specify the 'power' option, you'll get what you expect 0.5
Fs = 1000;
t = 0:1/Fs:2-1/Fs;
x = sin(2*pi*100*t);
[psdestx,Fxx] = periodogram(x,[],length(x),Fs,'power');
plot(Fxx,psdestx); grid on;
xlabel('Hz');
title('Periodogram Power Estimate');
0 个评论
更多回答(3 个)
Wayne King
2013-10-14
In R2012a, you can use spectrum.periodogram and then msspectrum
Fs = 1000;
t = 0:1/Fs:2-1/Fs;
x = 0.5*cos(2*pi*100*t)+2*sin(2*pi*200*t);
hper = spectrum.periodogram;
hper.Windowname = 'Flat top';
hms = msspectrum(hper,x,'Fs',Fs);
plot(hms.Frequencies,hms.Data)
Looking at the plot (this is a one-sided power spectrum), the intepretation is this, the power at 100 Hz is 0.125 so you have a cosine (ignoring phase) with an amplitude of
sqrt(2*0.125)
The power estimate at 200 Hz is 2 so you have a sinusoid with an amplitude of
sqrt(2*2)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parametric Spectral Estimation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!