## 3 Methodology
### Performance Metrics  
In this study, three sets of performance measures were used to evaluate the proposed approach and provide a robust evaluation framework for ECG denoising, ensuring the reconstructed signals are clinically relevant and diagnostically accurate [20; 21; 22]. These metrics include the signal-to-noise ratio (SNR\({}_{\text{dB}}\)), the Pearson correlation coefficient (PCC), and the normalized mean squared error (NMSE).  
**Signal-to-Noise Ratio (SNR\({}_{\text{dB}}\))** quantifies the strength of the clean signal (\(X\)) relative to the noise (\(N=X-Y\)) introduced during the denoising process. SNR is typically expressed in decibels (dB) and is defined as:  
\[\text{SNR}_{\text{dB}}=10\log_{10}\left(\frac{X_{2}^{2}}{N_{2}^{2}}\right) \tag{4}\]  
where:  
* \(X_{2}^{2}=\sum_{i=1}^{n}x_{i}^{2}\) is the signal power
* \(N_{2}^{2}=\sum_{i=1}^{n}(x_{i}-y_{i})^{2}\) is the noise power In expanded form: \[\text{SNR}_{\text{dB}}=10\log_{10}\left(\frac{\sum_{i=1}^{n}x_{i}^{2}}{\sum_{ i=1}^{n}(x_{i}-y_{i})^{2}}\right)\] (5)  
A higher SNR\({}_{\text{dB}}\) indicates that the noise introduced by the denoising algorithm is minimal, preserving the integrity of the original ECG signal. Conversely, a low SNR\({}_{\text{dB}}\) indicates that the denoising process has introduced significant distortions.  
**Normalized Mean Squared Error (NMSE)** quantifies the deviation between the clean signal (\(X\)) and the denoised signal (\(\gamma\)), normalized by the energy (squared norm) of the clean signal. The NMSE is given by:  
\[\text{NMSE}=\frac{||X-\gamma||^{2}}{||X||^{2}}=\frac{\sum_{i=1}^{n}(x_{i}-y_{ i})^{2}}{\sum_{i=1}^{n}x_{i}^{2}} \tag{6}\]  
NMSE penalizes larger deviations more significantly than smaller ones. A lower NMSE value indicates that the denoised signal closely approximates the clean signal. For normalization and interpretability, a complementary metric can be defined:  
\[\text{Reconstruction Score}=1-\text{NMSE} \tag{7}\]  
This score ranges from 0 to 1, where:  
* 1: Perfect reconstruction (denoised signal is identical to the clean signal)
* 0: Maximum error (denoised signal completely deviates from the clean signal)  
**Pearson Correlation Coefficient (PCC)** measures the degree of linear association between the clean ECG signal (\(X\)) and the denoised ECG signal (\(\gamma\)). It evaluates how well the variations in one signal correspond to variations in the other. PCC is computed as:\[\text{PCC}=\frac{\text{Cov}(X,Y)}{\sigma_{X}\sigma_{Y}} \tag{8}\]  
where:  
* \(\text{Cov}(X,Y)\) is the covariance
* \(\sigma_{X}\) and \(\sigma_{Y}\) are the standard deviations of \(X\) and \(Y\), respectively The covariance is defined as: \[\text{Cov}(X,Y)=\frac{1}{n}\sum_{i=1}^{n}(y_{i}-g)(x_{i}-\bar{x})\] (9) where:
* \(x_{i}\) and \(y_{i}\) are the individual samples of \(X\) and \(Y\)
* \(\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_{i}\) and \(\bar{y}=\frac{1}{n}\sum_{i=1}^{n}y_{i}\) are the means of \(X\) and \(Y\)
* \(n\) is the number of data points Substituting the covariance into the PCC formula: \[\text{PCC}=\frac{\sum_{i=1}^{n}(x_{i}-\bar{x})(y_{i}-\bar{y})}{\sqrt{\sum_{i=1 }^{n}(x_{i}-\bar{x})^{2}}\sqrt{\sum_{i=1}^{n}(y_{i}-\bar{y})^{2}}}\] (10) The PCC ranges between:
* PCC = 1: A perfect positive linear relationship
* PCC = 0: No linear relationship
* PCC = \(-1\): A perfect negative linear relationship  
In the context of ECG denoising, PCC quantifies how closely the reconstructed (denoised) signal aligns with the clean reference signal in terms of waveform similarity.