PSD question

조회 수: 4 (최근 30일)
Baba
Baba 2011년 11월 1일
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;

채택된 답변

Wayne King
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

추가 답변 (1개)

Wayne King
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);

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by