def pan_tompkins(self,data_buf):
'''
1) 3rd differential of the data_buffer (512 samples)
2) square of that
3) integrate -> integrate(data_buffer)
4) take the pulse from that
'''
order = 3
diff = np.diff(data_buf,3)
for i in range(order):
diff = np.insert(diff,0,0)
square = np.square(diff)
window = 64
integral = np.zeros((len(square)))
for i in range(len(square)):
integral[i] = np.trapz(square[i:i+window])
# print(integral)
return integral
heart-monitor.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录