Denoising and R-Peak Detection in ECG Signals: A Performance Evaluation

An electrocardiogram (ECG) is a continuous electrical signal from the heart that is recorded to understand the activity and condition of the heart. A recorded ECG signal always follows a defined pattern for a normal heart condition. Variation in the normal ECG pattern can be seen in cases of numerous cardiac abnormalities. A recorded ECG is also affected by a number of noises and distortions, resulting in a low SNR. A variation in ECG pattern can lead to incorrect study and improper diagnosis of heart condition. Thus, to perform an efficient analysis, it is necessary to preprocess the ECG waveform. ECG preprocessing requires noise removal and analysis of necessary features needed to study cardiac activity. In this paper, ECG preprocessing is evaluated by using two noise removal techniques, i


Introduction
As a diagnostic tool in clinical medicine, ECG monitoring has become one of the most commonly used tools over the course of the past century.In fact, it can be used in a variety of settings, such as prehospital, intensive care, emergency rooms, and many others (Stam et al., 2023).To capture the ECG signal, electrodes are positioned on the body surface to gauge the voltage produced by the heart's electrical activity.Figure 1 delineates the five waves representing the cardiac cycle, namely, P, Q, R, S, and T. Within these waves, the Q, R, and S waves form a unified QRS complex ((X.Xu & Liu, 2020); (Izmozherov & Smirnov, 2019)).A standard ECG signal generally exhibits a peak amplitude of 1 mV and operates within a bandwidth ranging from 0.05 Hz to 100 Hz (Buendía-Fuentes et al., 2012).
ECG analysis generally consists of three stages: preprocessing for the provision of cleaning the ECG signals, feature recognition and extraction for the identification of specific ECG components, and the final stage, which includes professional consultation for the final diagnosis (Siontis et al., 2021).This paper discusses the preprocessing stage, which is designed to provide a signal free of unrelated noises or artifacts to extract features.AC power line interference and BLW resulting from patient movement and respiration are the dominant sources of this noise.QRS detection, despite being a separate operation, can be considered a part of the preprocessing stage since it serves as a reference for the extraction of features (Costa et al., 2021).Typically, a single cycle of the ECG signal encompasses the P-QRS-T waves.Deviations in these waves, observed on the ECG, indicate an irregularity known as arrhythmia (Zhao et al., 2021).Individuals with arrhythmia may encounter alterations in both heart rate and rhythm.The identification of arrhythmias can be achieved through ECG signals, with a focus on their R-peak component.
A well -obtained ECG signal is prominent for identifying and interpreting arrhythmias.ECG signals are commonly distorted by baseline wander, machine -induced noise, motion artifacts, and interference from power lines in real-time (Yang et al., 2023).Poor channel conditions in remote health systems and halter monitoring systems can cause noise interference (Dai et al., 2019).To improve the treatment of cardiac diseases, it is necessary to remove these artifacts from recorded ECGs.When ECG signals are corrupted by noise during acquisition, accurate analysis is impossible.Therefore, signal preprocessing is needed for better analysis and characterization (Dora & Biswal, 2019).Numerous approaches have been suggested in scholarly works to improve ECGs.Diverse signal processing methodologies and algorithms are applied in techniques aimed at enhancing the quality of electrocardiograms.
ECG signal improvement techniques use signal processing and filtering algorithms to improve the visual interpretation of the signals.Several ECG signal-based diagnoses require precise detection of wave patterns and low amplitudes (Dong et al., 2020).Analyzing the difference between the two Rpeaks, the RR-interval is calculated from the QRS complex of ECG signals (do Vale Madeiro et al., 2020).The standard procedure for measuring heart rate is based on observed RR-intervals.
The analysis of heart rate variability can be conducted through parameters in either the time domain or frequency domain, as indicated by (Catai et al., 2020).Time domain analysis involves examining the time intervals generated by heart rate variations.Parameters in the time domain, such as mean square error, signal-to-noise ratio, and accuracy, are computed for analysis purposes (Gupta et al., 2022).In frequency domain analysis, heart rates are categorized into distinct groups based on their frequency ranges.
The following are the main observations that have been made from the literature on ECG signal preprocessing ( (Uwaechia & Ramli, 2021); (Tychkov et al., 2019); (Rahman et al., 2019) b) Filtering from FIR ranges at a very high frequency, which makes it more time consuming and requires large storage.c) Filtering from IIR ranges at a low frequency, which makes the high -frequency noise still intact.

ECG Datasets
In this paper, the PhysioNet/ Computing in Cardiology Challenge 2017 (Reyna et al., 2021) database for ECG signals was used.

Finite Impulse Response (FIR)
In the realm of signal preprocessing, FIR filters stand out as linear, finite, time-invariant, and causal filters (Olivier & Barnard, 2023).These filters find widespread applications, particularly in domains such as image processing and noise removal.Their linearity ensures a consistent response to varying inputs, their finite nature enables practical implementation, time invariance guarantees stability over time, and their causality ensures that the output is dependent only on present and past inputs (Kwon & Kim, 2023).FIR filters play a significant role in enhancing signal quality, especially in tasks involving image enhancement and the reduction of unwanted noise (Pak, 2022).

Infinite Impulse Response (IIR)
The infinite impulse response (IIR) filter critically evaluates outcomes by considering both current and past inputs, as well as previous outputs, introducing a feedback mechanism into the filter structure (Asraf et al., 2021).This design incorporates the utilization of past output values, reflecting a dependency on historical information.The IIR filter is constructed with a pulse transfer function G(z), ensuring adherence to the specified requirements for IIR filter specifications (Ho et al., 2006).This approach enables a dynamic and recursive processing of input data, offering versatility in addressing signal characteristics over time.

R-Peak Detection
One of the characteristics of an ECG signal is its R peak, which is a prominent part of the analysis of the ECG signal.Various computerized approach utilized to analyze the R-peak more efficiently are summarized in the subsection below.

Discrete Wavelet Transform (DWT)
In the contemporary landscape, the DWT has garnered substantial acclaim, particularly within the realms of computerized diagnostics and signal processing applications (Zhang, 2023).This methodological approach has become increasingly prevalent due to its versatility and efficacy in handling diverse signal processing tasks (Liu et al., 2019).The DWT methodology involves a sophisticated interplay of high-pass and low-pass filters during the stages of data decomposition and subsequent reconstruction (Kefalas et al., 2022).This strategic use of filters contributes to the adaptability and robustness of the DWT technique, making it a prominent choice in the modern landscape of diagnostic and signal processing applications.

Maximum Overlap Discrete Wavelet Transform (MODWT)
The Multi-Resolution Analysis using the MODWT provides a comprehensive exploration of signal behavior from a scale-dependent viewpoint (Abdulwahab et al., 2021).This involves transforming the signal into coefficients that capture differences over a spectrum of scales.The filtering process within MODWT is inherently linear, facilitating a detailed examination of the signal's characteristics across different scales (Ghaemi et al., 2019).MODWT stands as a modification of the traditional DWT, embodying a time shift-invariant methodology, as noted by (AL-Musaylh et al., 2020).This temporal shift invariance ensures that alterations in the signal induce analogous changes in the wavelet coefficients, emphasizing the method's consistency and reliability in capturing temporal variations within the signal ( (Yaacob et al., 2021); (P.Xu et al., 2022)).

Principal Component Analysis (PCA)
An important application of PCA is in the analysis of large, multidimensional datasets with many features per observation.By ensuring that as much information as possible is preserved while maximizing interpretability (Rojas-Valverde et al., 2020), it reduces the dimensionality of a dataset.In addition to allowing the visualization of multidimensional data, PCA is also a statistical technique.Specifically, (Mahmoudi et al., 2021); (Gupta & Mittal, 2021) transform the data linearly into a revised coordinate system for achieving this goal.This is because the difference in the data can be defined with fewer features than the previous coordinate system in which the data were initially expressed.

Independent Component Analysis (ICA)
Within the domain of signal processing, ICA serves as a technique employed to decompose a signal, comprised of multiple components, into subcomponents.These subcomponents are extracted in a manner that allows them to be additively combined (Tharwat, 2018).ICA is a powerful method used to unveil the underlying sources or independent elements contributing to a composite signal, offering insights into the individual components that collectively form the observed signal (Hyvärinen & Oja, 2000).This technique is particularly valuable in scenarios where signals are composed of various distinct sources, enabling a more granular understanding of the signal's composition (Westad & Kermit, 2020).This allows the creation of a signal that is composed of multiple components (Sompairac et al., 2019).The analysis assumes that only one component is Gaussian, and that the subcomponents are statistically independent of each other.

Proposed Methodology
This paper introduces a novel approach for denoising and R-peak detection in ECG signals, combining the Savitzky-Golay (S-Golay) filter with DWT.The S-Golay filter is employed to enhance the signal quality by reducing noise, and subsequently, the DWT is utilized for precise detection of the R-peaks.This integrated methodology aims to improve the accuracy and effectiveness of denoising while enhancing the identification of critical features in ECG signals, particularly the R-peaks.

S-Golay Filter
The application of the S-Golay filter to a set of digital data points aims to enhance their precision without altering their inherent trends ((Samann & Schanze, 2019); (Raheja & Manocha, 2021)).This process involves employing linear least squares, where successive subsets of adjacent data points are fitted with a low-degree polynomial.This polynomial serves as a fitting mechanism for successive subsets of adjacent data points.When the data points are evenly spaced, an analytical solution can be derived for the least-squares equation (Chinomso et al., 2022).The resulting smoothed signal at the center of each subset can be estimated using a singular set of "convolution coefficients" applicable to all data subsets ( (Agarwal et al., 2017); (Samann & Schanze, 2019).

Performance Evaluation Parameters
Various parameters have been employed to evaluate the efficacy of the R-peak detection algorithm in the ECG dataset for accurately identifying the peaks (Rajani Kumari et al., 2021).Some of these parameters explicated in this paper are as follows:  =

Results and Discussion
A variety of parameters have been used for the analysis of the performance of the R-peak detection algorithm in the ECG dataset to detect the peak (Nakajima et al., 2022).Some of these parameters explicated in this paper are as follows: Filtered ECG signal using FIR with R-peak detection using DWT, MODWT, PCA and ICA is shown in figure 3. The SNR is the representation of the variation between the desired signal and the actual noisy signal.It is considered that the higher the value of SNR is, the better the developed model.Based on this concept, it is found that the value of the SNR for the ECG signal is higher in the case of the proposed methodology, which means for the S-Golay filtering method.
Similar to the concept of SNR, MSE is the representation of variation between the actual and filtered signals.It is considered that the lower the value of MSE is, the better the developed model.Predicated on this concept, it is found that the value of MSE for the ECG signal is lowest in the case of the proposed methodology, which means for the S-Golay filtering method.This study holds significant potential for the in-depth analysis of various cardiac abnormalities and associated diseases.The findings of this research can serve as a valuable foundation for the development of a computerized model geared towards the precise and early detection of heart diseases, including but not limited to atrial fibrillation, catheter ablation, and various others.This research lays the groundwork for advancing the field of computer-aided diagnostics in cardiology.

Conclusion
Early analysis of cardiac abnormalities and associated disease is a prominent concept in the healthcare system, and to succeed, this computerized approach has drawn much attention.Developing a potential computerized approach is a prominent need of time and technology.Based on these concepts, this paper utilizes various ECG reports to develop an efficient computerized solution for decoding the information from them.Various methods on the same are studied and analyzed, where the proposed method indicated excellent results compared to other methods discussed in the literature thus far.This paper shows that the SNR and MSE of the proposed method are better than those of other methods, with accuracies above 90%.The conclusion can be drawn from this that, being a mature methodology, many issues are prompted with the preprocessing of ECG signals due to the noise and disturbance prompted by them, but with sequential development and upgradation in these fields, the computerized approach in the detection of AF has the capability to govern the healthcare system.

Ethics approval and consent to participate: Not Applicable
Consent for publication: Not Applicable Figure 1: ECG Signal ); a) Limited time-frequency localization and resolution of ECG signals have led to poor analysis from traditional transform methods.

( a )
Signal to noise ratio (SNR):The SNR is defined as follows(Krishnan & Seelamantula, 2013): Square error (MSE): It is defined as follows(Alam et al., 2022): It is defined as follows:

Figure 2 :
Figure 2: R-peak detection in the A00015 file using the proposed methodology

Figure 3 :
Figure 3: R-peak detection in the A00015 file using DWT, MODWT, PCA and ICA The proposed methodology indicated an accuracy of above 90% for the 27 input ECG signals of PhysioNet/ Computing in Cardiology Challenge 2017.The estimated SNR and MSE using FIR, IIR and S-Golay are summarized in Table 1.The estimated result of accuracy (in %) from DWT, MODWT, PCA, ICA and the proposed methodology.