简体   繁体   中英

Difference between scipy periodogram and self implemented power spectral density

I am trying to evaluate the frequency domain of several signals. For this I used the PSD implementation given in this answer . As a comparison I used the signal.periodogram function provided in scipy:

from scipy.signal import tukey
import scipy as sp
f, Pxx_den = sp.signal.periodogram(a_gtrend_orig,12,window=tukey( len(a_gtrend_orig) ))

However when I plot this next to the self-implemented PSD they look significantly different:

PSD算法的比较

As the same window function is used and the periodogram function should also use an FFT where does this difference coming from?

The example that you are comparing this to, is graphing the amplitude at each frequency bin, ie, abs(fft())

The periodogram produces a power spectral density, that means it is the square of the amplitude at each frequency bin.

The label "windowed psd" is from an early edit, and was corrected later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM