Python 中的多锥函数?

Multitaper function in Python?

我正在 Python 中搜索函数,其中 return 多锥功率谱密度,例如 matlab 的 pmtm (http://fr.mathworks.com/help/signal/ref/pmtm.html)

有人知道吗?我尝试安装 mtspec 但在 Python 上没有成功 3. 还有其他选择吗?

谢谢

您可以使用 pmtm from spectrum 其中 returns 多锥化光谱估计

使用 pip 安装它:

pip install spectrum

并像文档示例一样使用:

from spectrum import *

data = data_cosine(N=2048, A=0.1, sampling=1024, freq=200)
# If you already have the DPSS windows
[tapers, eigen] = dpss(2048, 2.5, 4)
res = pmtm(data, e=tapers, v=eigen, show=False)
# You do not need to compute the DPSS before end
res = pmtm(data, NW=2.5, show=False)
res = pmtm(data, NW=2.5, k=4, show=True)