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

9 views (last 30 days)
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 Comment
Mathieu NOE
Mathieu NOE on 30 Dec 2020
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;

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!