简体   繁体   English

scipy周期图和自实现功率谱密度之间的差异

[英]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 .为此,我使用了这个答案中给出的 PSD 实现。 As a comparison I used the signal.periodogram function provided in scipy:作为比较,我使用了signal.periodogram提供的signal.periodogram函数:

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 旁边时,它们看起来明显不同:

PSD算法的比较

As the same window function is used and the periodogram function should also use an FFT where does this difference coming from?由于使用了相同的窗口函数,并且周期图函数也应该使用 FFT,这种差异从何而来?

The example that you are comparing this to, is graphing the amplitude at each frequency bin, ie, abs(fft())您与之进行比较的示例是绘制每个频率区间的幅度,即 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.标签“windowed psd”来自早期编辑,后来更正。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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