scipy signal find_peaks_cwt not finding the peaks accurately?

后端 未结 3 1886
一整个雨季
一整个雨季 2020-12-14 02:20

I\'ve got a 1-D signal in which I\'m trying to find the peaks. I\'m looking to find them perfectly.

I\'m currently doing:

import scipy.signal as sign         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 03:08

    Edited after getting the raw data.

    argelmax and arglextrma are out of the race.

    The curve is very noisy, so you have to play with small peak width (as pv. mentioned) and the noise.

    The best I found looks not very good.

    import numpy as np
    import scipy.signal as signal
    
    peakidx = signal.find_peaks_cwt(y_array, np.arange(10,15), noise_perc=0.1)
    print peakidx
    
    [10, 100, 132, 187, 287, 351, 523, 597, 800, 1157, 1451, 1673, 1742, 1836]
    

    enter image description here

提交回复
热议问题