Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Mar 11;46(3):035002.
doi: 10.1088/1361-6579/adb89e.

The MSPTDfast photoplethysmography beat detection algorithm: design, benchmarking, and open-source distribution

Affiliations

The MSPTDfast photoplethysmography beat detection algorithm: design, benchmarking, and open-source distribution

Peter H Charlton et al. Physiol Meas. .

Abstract

Objective:photoplethysmography is widely used for physiological monitoring, whether in clinical devices such as pulse oximeters, or consumer devices such as smartwatches. A key step in the analysis of photoplethysmogram (PPG) signals is detecting heartbeats. The multi-scale peak & trough detection (MSPTD) algorithm has been found to be one of the most accurate PPG beat detection algorithms, but is less computationally efficient than other algorithms. Therefore, the aim of this study was to develop a more efficient, open-source implementation of theMSPTDalgorithm for PPG beat detection, namedMSPTDfast (v.2).Approach.five potential improvements toMSPTDwere identified and evaluated on four datasets.MSPTDfast (v.2)was designed by incorporating each improvement which on its own reduced execution time whilst maintaining a highF1-score. After internal validation,MSPTDfast (v.2)was benchmarked against state-of-the-art beat detection algorithms on four additional datasets.Main results.MSPTDfast (v.2)incorporated two key improvements: pre-processing PPG signals to reduce the sampling frequency to 20 Hz; and only calculating scalogram scales corresponding to heart rates >30 bpm. During internal validationMSPTDfast (v.2)was found to have an execution time of between approximately one-third and one-twentieth ofMSPTD, and a comparableF1-score. During benchmarkingMSPTDfast (v.2)was found to have the highestF1-score alongsideMSPTD, and amongst one of the lowest execution times with onlyMSPTDfast (v.1),qppgfastandMMPD (v.2)achieving shorter execution times.Significance.MSPTDfast (v.2)is an accurate and efficient PPG beat detection algorithm, available in an open-source Matlab toolbox.

Keywords: atrial fibrillation; beat detection; heart rate; interbeat interval; patient monitoring; signal processing; wearable devices.

PubMed Disclaimer

Figures

Figure 1.
Figure 1.
The development of MSPTDfast (v.2). The flowcharts show the main steps in three PPG beat detection algorithms (as implemented in the ppg-beats toolbox (Charlton 2024)), with changes from one algorithm to the next shown in red. The algorithms are: (i) the automatic multiscale peak detection (AMPD) algorithm (Scholkmann et al 2012); (ii) the multi-scale peak & trough detection (MSPTD) algorithm (Bishop and Ercole 2018), which improved the efficiency of AMPD; and (iii) the MSPTDfast (v.2) algorithm [this publication], which improved the efficiency of MSPTD.
Figure 2.
Figure 2.
The performance of different algorithm configurations: (a)–(e) show performance when using different potential improvements, where squares indicate the configurations used in MSPTDfast (v.2).
Figure 3.
Figure 3.
Internal validation of MSPTDfast (v.2) against MSPTD on the development datasets: Performance is shown in terms of (a) beat detection accuracy; and (b) efficiency. Corresponding results for sensitivity and positive predictive value are shown in appendix A.
Figure 4.
Figure 4.
Benchmarking MSPTDfast (v.2) against leading beat detection algorithms: Performance is shown in terms of (a) beat detection accuracy; and (b) efficiency. Corresponding results for sensitivity and positive predictive value are shown in appendix B.
Figure 5.
Figure 5.
Associations between beat detection accuracy and patient characteristics: (a) atrial fibrillation (AF) vs non-AF; (b) adults vs neonates; and (c) Black vs White subjects. p< 0.05 indicates a significant difference before correction for multiple comparisons, whereas a p< 0.003 indicates a significant difference after correction for multiple comparisons. Corresponding results for sensitivity and positive predictive value are shown in appendix C.
Figure 6.
Figure 6.
The robustness of the beat detection algorithms to noise: The mean absolute percentage error (MAPE) in heart rates calculated from detected beats is shown for each beat detection algorithm at different levels of noise. Noise levels are categorised according to the signal-to-noise ratio, SNR.
Figure 7.
Figure 7.
Examples of PPG beat detections provided by MSPTDfast (v.2) on segments of different noise levels from the WESAD dataset.
Figure 8.
Figure 8.
Internal validation of MSPTDfast (v.2) against MSPTD on the development datasets: additional results showing the sensitivity and positive predictive value of the algorithms.
Figure 9.
Figure 9.
Benchmarking MSPTDfast (v.2) against leading beat detection algorithms: additional results showing the sensitivity and positive predictive value of the algorithms.
Figure 10.
Figure 10.
Associations between beat detection accuracy and patient characteristics: (a) atrial fibrillation (AF) vs non-AF; (b) adults vs neonates; and (c) Black vs White subjects. p< 0.05 indicates a significant difference (no correction was made for multiple comparisons in this analysis).

References

    1. Aboy M, McNames J, Thong T, Tsunami D, Ellenby M S, Goldstein B. An automatic beat detection algorithm for pressure signals. IEEE Trans. Biomed. Eng. 2005;52:1662–70. doi: 10.1109/TBME.2005.855725. - DOI - PubMed
    1. Allen J. Photoplethysmography and its application in clinical physiological measurement. Physiol. Meas. 2007;28:R1–R39. doi: 10.1088/0967-3334/28/3/R01. - DOI - PubMed
    1. Association for the Advancement of Medical Instrumentation (ANSI/AAMI EC13:2002) American National Standard; 2002. Cardiac monitors, heart rate meters, and alarms; pp. 1–87.
    1. Bashar S K. Atrial Fibrillation annotations of electrocardiogram from MIMIC III matched subset. figshare. 2020 doi: 10.6084/m9.figshare.12149091.v1. - DOI
    1. Bashar S K, Ding E, Walkey A J, McManus D D, Chon K H. Noise detection in electrocardiogram signals for intensive care unit patients. IEEE Access. 2019;7:88357–68. doi: 10.1109/ACCESS.2019.2926199. - DOI - PMC - PubMed