用scipy在python中检测峰值

时间:2017-07-04 12:17:39

标签: python numpy scipy

我有一个名为det1的numpy数组,这是一个有许多峰值的信号。我想检测峰值(局部最大值)并保存值。

我正在尝试这个:

from scipy.signal import find_peaks_cwt
from scipy import signal
peakind = signal.find_peaks_cwt(det1, np.arange(1000,2000))

我收到此错误:

Traceback (most recent call last):
  File "mobility.py", line 49, in <module>
    peakind = signal.find_peaks_cwt(det1, np.arange(1000,2000))
  File "/usr/lib/python2.7/dist-packages/scipy/signal/_peak_finding.py", line 514, in find_peaks_cwt
    cwt_dat = cwt(vector, wavelet, widths)
  File "/usr/lib/python2.7/dist-packages/scipy/signal/wavelets.py", line 357, in cwt
    output = np.zeros([len(widths), len(data)])
MemoryError
我在做错了什么?你能建议一种更好的方法来检测峰值吗?

0 个答案:

没有答案