python波形峰值检测
1、效果图
2、简介
获取一段波形的峰值,可以通过科学计算库scipy来实现,
函数:
scipy.signal.find_peaks(x, height=None, threshold=None, distance=None, prominence=None, width=None, wlen=None, rel_height=0.5, plateau_size=None)
参数:
x: 带有峰值的信号序列
height: 低于指定height的信号都不考虑
threshold: 其与相邻样本的垂直距离
distance: 相邻峰之间的最小水平距离, 先移除较小的峰,直到所有剩余峰的条件都满足为止。
prominence: 突起程度
width: 波峰的宽度,详见peak_widths
plateau_size: 保证峰对应的平顶数目大于给定值
返回:
一个二元元组(列表peaks, 字典properties)
peaks: x对应的峰值的索引
properties:
height--> ‘peak_heights’
thresho