How can I compute power spectrum from psd using periodogram function?

조회 수: 15 (최근 30일)
zitao
zitao 2020년 12월 30일
댓글: Mathieu NOE 2020년 12월 30일
The periodogram function provides two options, which are 'psd' and 'power'. However I find the magnitude of the outputs very confusing. How can I compute power spectrum which is identical to the 'power' results from the 'psd' results?
The codes of the comparision are below:
fs=3072e6/2;
fc = 200e6;
N1 = 4096;
N2 = 2048;
df1 = fs/N1;
df2 = fs/N2;
t1 = (1/fs:1/fs:N1/fs);
t2 = (1/fs:1/fs:N2/fs);
signal1 = sin(2*pi*fc.*t1)+sin(2*pi*(fc-10e6).*t1);
[pxx1,f1] = periodogram(signal1,flattopwin(length(signal1)),length(signal1),fs,'psd');
subplot(2,1,1)
plot(f1./1e6,pxx1);
xlabel('MHz')
title('psd')
[pxx1,f1] = periodogram(signal1,flattopwin(length(signal1)),length(signal1),fs,'power');
subplot(2,1,2)
plot(f1./1e6,pxx1)
title('power')
xlabel('MHz')
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2020년 12월 30일
hello
you should use the 'psd' option only when you are dealing with random / broadband signals like white noise or colored noises; as it says, psd means power density that is a power per Hertz ; if I analyse a white noise, the psd is constant whatever the frequency resolution i choose (related to nfft and Fs)
for narrow band signals like sine waves (also with harmonics), , all their power is concentrated in one or several discrete frequencies only, so computing a power density is not meaningful, it would give infinity; in this case , you should use 'power' ; nota bene : the power computed by the fft is constant and will not change if you change the frequency resolution (related to nfft and Fs) for this kind of signals
all signals analyser are doing the math the same way : from the time signal , they will compute the power first and then the psd by dividing the power by the frequency resolution df :
df = Fs/NFFT;
pow = fft(x).*fft'(x);
PSD = pow/df;

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

답변 (0개)

카테고리

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