Proposal and Prototype of a GUI-Based Algorithm for R-Wave Correction and Immediate R-R Interval Updating
Discuss this preprint
Start a discussion What are Sciety discussions?Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Electrocardiography (ECG) is a representative biosensor that noninvasively records weak bioelectrical signals of the heart. It is widely used to assess cardiac function, autonomic activity, and exercise responses. Accurate detection of R-wave peaks and precise calculation of R-R intervals (RRIs) are essential for heart rate variability (HRV) analysis, which is applied to stress assessment, sleep stage evaluation, and the detection of subtle cardiac changes. Automated R-peak detection algorithms, ranging from the classical Pan–Tompkins method to recent deep learning approaches, enable rapid processing of large datasets but remain susceptible to misdetections caused by noise, baseline fluctuations, or prominent T-waves. Conventional correction methods often rely on adjusting filters or thresholds, but these approaches risk introducing new errors in other regions, highlighting a trade-off problem and emphasizing the need for a user-friendly manual correction function. To overcome these limitations, we proposed a prototype graphical user interface (GUI)-based ECG viewer implemented in Fortran to ensure high computational efficiency. The system enables interactive insertion or deletion of R-wave peaks, followed by immediate recalculation of RRIs and automatic updates of associated analyses, including power spectral density, histograms, Lorenz plots, and polar plots. Validation with synthetic ECG signals at four sampling frequencies (125, 250, 500, and 1000 Hz) and three time scales (2, 5, and 10 s) demonstrated correction errors below 0.7% and stable update times within 20–30 ms. These results demonstrate reliable, immediate feedback that may be applicable in future contexts. Accordingly, the proposed algorithm may further support applications in research, clinical, and educational domains of biosignal processing.