PSD question
2 ビュー (過去 30 日間)
古いコメントを表示
What are the units of the Y axis of this code? I think it's dB/Hz but I'm not sure.
fs=2000;
Hs=spectrum.periodogram; % Use default values
psdest = psd(Hs,Signal,'Fs',fs);
semilogx(psdest.Frequencies,10*log10(psdest.Data));
grid on;
0 件のコメント
採用された回答
Wayne King
2011 年 11 月 1 日
Yes, it is dB/Hz.
psdest.Data are the power estimate, proportional to magnitude-squared of the DFT. So 10*log10() is in dB
0 件のコメント
その他の回答 (1 件)
Wayne King
2011 年 11 月 1 日
Hi, below I provide an example using just the DFT and then applying the proper scaling and the spectrum.periodogram object, so you can see how to do it the "brute force" way.
dt=1/10000;
t=0:dt:.1024-dt; %time vector of length 1024
y=cos(2*pi*1000*t)+randn(size(t));
h=spectrum.periodogram; %spectrum object (periodogram)
psd_est_1side=psd(h,y,'spectrumtype','onesided','Fs',10000);
y_fft=abs(fft(y)).^2;
Y_fft=y_fft(1:513); % we only keep the positive frequencies.
Y_fft=(dt/1024)*Y_fft;
Y_fft(2:end-1)=2*Y_fft(2:end-1);
%compare
plot(psd_est_1side.Frequencies./1000,10*log10(Y_fft));
xlabel('kHz'); ylabel('Power/Hz (dB)'); grid on;
figure;
plot(psd_est_1side);
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!