hi there,
I have a problem,
I compare the result of psd and pwelch, but they showed the different result, why this happened? My matlab version is R2009, unfortunately the matlab delete the description of psd, so would someone tell me why the result of psd and pwelch differs even use the same window? here is my code: ----------------
clear;
Fs=1000;
n=0:1/Fs:1;
y=cos(2*pi*40*n)+3*cos(2*pi*100*n)+randn(size(n));
Nfft=1000;
window=hanning(100);
noverlap=20;
dflag='none';
[Pxx,f]=psd(y,Nfft,Fs,window,noverlap);
figure
plot(f,10*log10(Pxx));
xlabel('frequency/Hz');ylabel('PSD/dB');
title('PSD-Welch method')
hold on;
[Pxx1,f1]=pwelch(y,window,noverlap,Nfft,Fs);
plot(f1,10*log10(Pxx1),'r');

답변 (2개)

Jun
Jun 2015년 5월 26일

0 개 추천

If someone knows the answer, please tell me, thanks again.
Honglei Chen
Honglei Chen 2015년 5월 27일

0 개 추천

You should use pwelch. In R2009b, psd is deprecated because the resulting power spectral density is not properly normalized. The shape is correct though.

댓글 수: 1

Jun
Jun 2015년 6월 1일
Thank you Honglei, That really helps.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

질문:

Jun
2015년 5월 26일

댓글:

Jun
2015년 6월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by