如何在信号图中将对应于同一山丘的峰值点分组

How to group peak points corresponding to the same hill in signal plot

我有一个点列表,我需要在其中找到峰值点并将它们分组。我正在使用 scipy.signal 中的 find_peak() 函数来查找峰值点,现在我需要对对应于同一山丘的峰值点进行分组(如下所述)。我们如何做到这一点,任何建议都会有很大帮助。

示例图片

代码

from matplotlib import pyplot as plt
from scipy.signal import find_peaks

# lst has list of points
A = np.array(lst)
peaks, _ = find_peaks(A)

plt.figure()
plt.plot(lst)
plt.plot(peaks, A[peaks], "ro")
plt.grid()
plt.show()

对峰值进行分组的典型方法是low-pass 过滤波形。降低 low-pass 过滤器的频率 cut-off,直到您认为属于 "hills" 合并的峰。然后尝试查找峰值功能。