2

I'm searching a function in Python, which return the multitaper power spectral density, like pmtm for Matlab (http://fr.mathworks.com/help/signal/ref/pmtm.html)

Anybody knows one ? I tried to install mtspec but without success on Python 3. Any other option ?

Thanks

GeoffreyB
  • 536
  • 1
  • 7
  • 17

1 Answers1

4

You can use pmtm from spectrum which returns the multitapering spectral estimation

Install it using pip:

pip install spectrum

And use like the documentation example:

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)
Kobi K
  • 7,743
  • 6
  • 42
  • 86