我有以下程序来检测线图上的所有峰值。它成功地检测到了峰值,但我只想让它检测到那些明显的峰值(大到可以看到)。有什么建议吗?
import numpy as np
b = (X[1:]-X[:-1])[:-1]
c = (X[:-1]-X[1:])[1:]
minima = np.where(np.bitwise_and(b<0, c<0))[0]+1
maxima = np.where(np.bitwise_and(b>0, c>0))[0]+1
all_peaks = np.where((b*c)>0)[0]+1
del b,c
print(minima)
print(maxima)
print(all_peaks)
目前没有回答
相关问题 更多 >
编程相关推荐