An efficient threshold method for detecting R-peaks in electrocardiogram

Mykola Yefremov, Andrey Liashko, Iurii Krak, Oleg Stelia

Abstract


Automated R-peak detection in electrocardiogram (ECG) signals is essential to heart rhythm analysis, with applications in heart rate monitoring, heart rate variability (HRV) assessment, arrhythmia diagnosis ets. Its accuracy, however, is highly sensitive to noise and artifacts present in the ECG recording. The study proposes a method and its software implementation for R-peak detection, based on signal smoothing followed by differentiation and the application of a thresholding approach. The method is designed for use in resource-constrained environments, such as portable and embedded monitoring systems. The objective of the study is to develop a computationally efficient and accurate method for the automatic detection of R-peaks in ECG signals, tailored to a personalized patient approach. The primary focus is on robustness to noise and QRS complex morphology, as well as the algorithm’s ability to operate under limited computational resources and in real-time conditions. The proposed method relies on staged ECG signal processing. To validate the approach and compare its effectiveness, existing studies in the field were analysed. The subject of the study involves processing ECG signals and addressing challenges in R-peak detection in ECGs recorded via Holter monitors by constructing a smoothed continuous signal based on discrete data obtained during digitization. The discrete nature of the initial signal complicates differentiation and the precise identification of characteristic points, specifically R-peaks, which play a crucial role in diagnosing cardiac conditions. The scientific novelty of this investigation lies in the use of a second-order piecewise polynomial approximation to represent the ECG signal. This approach enables noise reduction in the signal and represents the discrete signal as a continuous function together with its first derivative, thereby permitting the analytical computation of its derivative. Results involve the detection of R-peaks by analysing the derivative of the smoothed signal: regions with sharp changes characteristic of the QRS complex were identified, and an iterative smoothing scheme was developed, with the number of iterations determined by a proposed stopping criterion. The proposed method was implemented in software and tested on data from the open-access MIT-BIH Arrhythmia Database, which includes over 60 recordings and more than 100,000 annotated R-peaks. The results were compared with studies by other authors using the  metric, based on standard precision and sensitivity metrics. Conclusions: The study proposes an effective and adaptive approach to ECG signal processing, ensuring reliable R-peak detection under conditions of significant noise, baseline drift, and physiological variability across patients. The obtained results demonstrated high performance metrics: up to 99.5% (average above 99.1%),  consistently exceeding 99%, and in some recordings reaching 100%. Thus, the proposed approach is competitive, demonstrating high accuracy in detecting R-peaks in cases of arrhythmias, peak inversions, non-standard QRS complex morphology, and other challenging signal conditions. The study’s results can be applied in ECG analysis practice, particularly in the development of automated diagnostic systems or signal preprocessing before the application of classification methods.

Keywords


electrocardiogram; piecewise-polynomial approximation; R-peaks; smoothing; differentiation; MIT-BIH

Full Text:

PDF

References


Pan, J., & Tompkins, W., J. A Real-Time QRS Detection Algorithm. IEEE Transactions on Biomedical Engineering, 1985, vol. BME-32, no. 3, pp. 230-236. DOI: 10.1109/TBME.1985.325532.

Imtiaz, M. N., & Khan, N. Pan-Tompkins++: A Robust Approach to Detect R-peaks in ECG Signals. IEEE International Conference on Bioinformatics and Biomedicine (BIBM), Las Vegas, NV, USA, IEEE, 2022, pp. 2905-2912. DOI: 10.1109/BIBM55620.2022.9995552.

Dogan, H., & Dogan, R.O. A Comprehensive Review of Computer-based Techniques for R-Peaks/QRS Complex Detection in ECG Signal, Arch Computat Methods Eng, 2023, vol. 30, pp. 3703–3721. DOI: 10.1007/s11831-023-09916-x.

Yadav, A., & Grover, N. A Review of R Peak Detection Techniques of Electrocardiogram (ECG), Journal of engineering and technology, 2017, vol. 8, iss. 2 pp. 115-134. Available at^ https://jet.utem.edu.my/jet/article/ view/1946. (accessed 10.11.2025).

Guo, T., Zhang, T., Lim, E., López-Benítez, M., Ma, F., & Yu, L. A Review of Wavelet Analysis and Its Applications: Challenges and Opportunities, IEEE Access, 2022, vol. 10, pp. 58869-58903, DOI: 10.1109/ACCESS.2022.3179517.

Krak, Iu., Stelia, O., Pashko, A., Horozov, O., & Efremov, M. Electrocardiogram Classification Using Wavelet Transformations, IEEE 15th International Conference on Advanced Trends in Radioelectronics, Telecommunications and Computer Engineering (TCSET), IEEE, 2020, pp. 930-933. DOI: 10.1109/TCSET49122.2020. 235573.

Farrokhi, S., Dargie, W., & Poellabauer, C. Reliable peak detection and feature extraction for wireless electrocardiograms, Computers in Biology and Medicine, 2025, vol. 185, 9 p, DOI: 10.1016/j.compbiomed.2024.109478.

Bensegueni, S. A New Method for Electrocardiogram Features Extraction Using Slope Change Coefficients, International Journal of Electronics and Telecommunications, 2023, vol 39, iss. 1, pp. 33-39. DOI: 10.24425/ijet.2023.144328.

Abdullah, Al. Z.M., Thapa, K., & Yang, S.-H. Improving R Peak Detection in ECG Signal Using Dynamic Mode Selected Energy and Adaptive Window Sizing Algorithm with Decision Tree Algorithm, Sensors, 2021, vol. 21, article no. 6682, 17 p. DOI: 10.3390/s21196682.

Arora, N., & Mishra, B. Detection and classification of atrial and ventricular cardiovascular diseases to improve the cardiac health literacy for resource constrained regions, Healthcare Technology Letters, 2023, vol 10, iss. 3, pp. 35-52. DOI: 10.1049/htl2.12043.

Fariha, Z., Ikeura, R., Hayakawa, S., & Tsutsumi, S. Analysis of Pan-Tompkins Algorithm Performance with Noisy ECG Signals, Journal of Physics Conference Series, 2020, vol. 1532, 11 p. DOI: 10.1088/1742-6596/1532/1/012022.

Balta, D., & Akyemis, E. Arrhythmia Detection using Pan-Tompkins Algorithm and Hilbert Transform with Real-Time ECG Signals, Academic Perspective Procedia, vol. 4. iss, 1. pp. 307-315. DOI: 10.33793/acperpro.04.01.45.

Yen, H. T., Tiep, V. T., Hoang, V. P., Trinh, Q. K., Nguyen, H. D., Tuyen, N. T., & Sun, G. Radar-based contactless heart beat detection with a modified Pan–Tompkin’s algorithm. Biomedical Physics & Engineering Express, 2024, vol. 11 iss. 1, 12 p. DOI: 10.1088/2057-1976/ad8c48.

Porr, B., & Howell, L. R-peak detector stress test with a new noisy ECG database reveals significant performance differences amongst popular detectors, PLOS ONE, 2019. 27 p, DOI: 10.1101/722397.

Moody, G. B., & Mark R. G. The impact of the MIT-BIH Arrhythmia Database. IEEE Engineering in Medicine and Biology Magazine, 2001, vol. 20, iss. 3, pp. 43-50, DOI: 10.1109/51.932724.

Goldberger, A., Amaral, L., Glass L., Hausdorff, J. M., Ivanov, P. C., Mark, R. G., Mietus, J. E., Moody, G. B., Peng, C. K., & Stanley. H. E. PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals. Circulation, 2000, vol. 101, no. 23, article no. e215-e220. DOI: 10.1161/01. CIR.101.23. e215.

Ali, S. T. A., Kim, S., & Kim, Y.-J. Towards Reliable ECG Analysis: Addressing Validation Gaps in the Electrocardiographic R-Peak Detection, Applied Sciences, 2024, vol. 14 iss. 21, article 10078, DOI: 10.3390/app142110078.

Astre-Domínguez, C., Shmaliy, Y. S., Ibarra-Manzano, O., Muñoz-Minjares, J., & Morales-Mendoza, L. ECG Signal Denoising and Features Extraction Using Unbiased FIR Smoothing, BioMed Research International, 2019, article no. 2608547. 16 p. DOI: 10.1155/2019/2608547.

Shmaliy, Y., & Morales-Mendoza, L. FIR Smoothing of Discrete-Time Polynomial Signals in State Space. IEEE Transactions on Signal Processing, 2010, vol. 58, pp. 2544-2555. DOI: 10.1109/TSP.2010. 2041595.

Niedźwiecki, M., J., Ciołek, M., Gańcza, A., & Kaczmarek, P. Application of regularized Savitzky–Golay filters to identification of time-varying systems, Automatica, 2021, vol. 133. 9 p. DOI: 10.1016/j.automatica.2021.109865.

Chatterjee, S., Thakur, R. S., Yadav, R. N., Gupta, L., & Raghuvanshi, D., K. Review of noise removal techniques in ECG signals, IET Signal Processing, 2020, vol. 14, iss, 9, pp 569-590, DOI: 10.1049/iet-spr.2020.0104f.

Ardeti, V. A., Kolluru, V. R., Varghere, G. T., & Patjoshi, R. K. An overview on state-of-the-art electrocardiogram signal processing methods: Traditional to AI-based approaches, Expert Systems with Applications, 2023, vol. 217. DOI: 10.1016/j.eswa.2023.119561.

Krak, I., Pashko A., Stelia O., Barmak, O., & Pavlov, S. Selection Parameters in the ECG Signals for Analysis of QRS Complexes. 1st International Workshop on Intelligent Information Technologies and Systems of Information Security, InteIITSIS, 2020, vol. 2623. 13 p. Available at https://ceur-ws.org/Vol-2623/paper1.pdf. (accessed 15.12.2025).

Association for the Advancement of Medical Instrumentation (R2020) ANSI/AAMI EC57:2012; Testing and Reporting Performance Results of Cardiac Rhythm and ST Segment Measurement Algorithms. Available at: https: //webstore.ansi.org/standards/aami/ ansiaamiec572012r2020 (accessed 11.09.2025).

Zhai, D., Bao, X., Xi Long, X., Ru, T., & Zhou, G. Precise detection and localization of R-peaks from ECG signals, Mathematical Biosciences and Engineering, 2023, vol. 20, iss. 11, pp. 19191-19208. DOI: 10.3934/mbe.2023848.

Hsieh, F., & Chen, T. -L. A Novel R-Peak Detection Algorithm. IEEE Access, 2025, vol. 13, pp. 210351-210359. DOI: 10.1109/ACCESS.2025.3643153.




DOI: https://doi.org/10.32620/reks.2026.1.02

Refbacks

  • There are currently no refbacks.