python - scipy周期图和自行实现的功率谱密度的区别

标签 python scipy

我正在尝试评估几个信号的频域。为此,我使用了 this answer 中给出的 PSD 实现。 。作为比较,我使用了 scipy 中提供的 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) ))

但是,当我将其绘制在自行实现的 PSD 旁边时,它们看起来明显不同:

Comparison of PSD algorithms

由于使用相同的窗口函数,并且周期图函数也应该使用 FFT,这种差异从何而来?

最佳答案

您与之比较的示例是绘制每个频率仓的幅度,即,abs(fft())

周期图产生功率谱密度,这意味着它是每个频率仓的振幅的平方

标签“windowed psd”来自早期编辑,后来更正。

关于python - scipy周期图和自行实现的功率谱密度的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52723383/

相关文章:

python 查找特定元素位置并返回其前面的所有不同元素

python - Keras 和交叉验证

python - 如何从大的稀疏 csc 矩阵中获取列

python - Python中基于中值的线性回归

python - 在 python 中以递归方式对文件进行 glob 的干净方法

python - Pandas:将索引更改为列

javascript - python socket - 无法从javascript获取发送的数据

python - 如何获得 NumPy 数组的描述性统计信息?

python - 与 Scipy : shifted identity kernel - how is the computation done? 的图像卷积

python - 使用 `numpy.digitize` 分割 NumPy 数组后如何计算每个 bin 的平均值?