GUI-Based ECG Viewer for R-Wave Correction and Fast Updating of R-R Interval Time Series
Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Electrocardiogram (ECG) 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 (RRI) are essential for heart rate variability (HRV) analysis, which is applied to stress assessment, sleep stage evaluation, and 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 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, histogram, Lorenz, 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. Beyond R-wave correction, the viewer allows manual extraction of arbitrary waveform landmarks, such as P- or T-wave peaks, facilitating diverse applications such as QT/PR interval measurement, gold-standard dataset creation, and interactive teaching. Overall, the proposed platform provides a reliable, fast, and versatile tool for ECG editing, with strong potential for research, clinical arrhythmia correction, and educational use.