Fast implementation of Pan & Tompkins (1985). It is programmed relatively efficiently, using
RcppArmadillo to process long ecg data much faster than alternatives. Default processing parameters are taken directly from the original paper.
This package gratefully borrows parts of the processing code from
NB: use at your own risk. This method has not been officially validated!
This algorithm uses a butterworth filter of order 1 for the band-pass step, and a 3rd-order length-5 Savitzky-Golay smoothing filter to compute the derivative of the band-passed signal. Peak detection on the preprocessed signal works in a simplified way: we take the first value above the lower bound (3 * the mean signal value) which is higher than its neighbours, and not within the refractory period after the previous R peak.
Pan, J., & Tompkins, W. J. (1985). A real-time QRS detection algorithm. IEEE transactions on biomedical engineering, (3), 230-236.