heart-monitor.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ECG_Respiratory_Monitor 作者: gabrielibagon 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号