Figure 3:
Schematic of the R-peak detection algorithm