Skip to contents

Bandpass (5-15 Hz) -> differentiate -> square -> moving-window integrate -> adaptive threshold with refractory period. Requires signal for the Butterworth bandpass.

Usage

morie_dsp_pan_tompkins(ecg, fs = 360)

Arguments

ecg

ECG vector.

fs

Sampling frequency (Hz). Default 360.

Value

Integer vector of QRS sample indices.

References

Rangayyan & Krishnan (2015), Ch. 4, sec. 4.7; Pan & Tompkins (1985).

Examples

set.seed(1)
beat <- c(rep(0, 130), 0.1, 0.4, 1.2, -0.3, rep(0, 40), 0.25, rep(0, 185))
ecg <- rep(beat, 5) + rnorm(1800, 0, 0.02)
str(morie_dsp_pan_tompkins(ecg, fs = 360), max.level = 1)
#>  int [1:5] 108 467 828 1184 1548