A novel approach for denoising electrocardiogram signals to detect cardiovascular diseases using an efficient hybrid scheme

Background Electrocardiogram (ECG) signals are inevitably contaminated with various kinds of noises during acquisition and transmission. The presence of noises may produce the inappropriate information on cardiac health, thereby preventing specialists from making correct analysis. Methods In this paper, an efficient strategy is proposed to denoise ECG signals, which employs a time-frequency framework based on S-transform (ST) and combines bi-dimensional empirical mode decomposition (BEMD) and non-local means (NLM). In the method, the ST maps an ECG signal into a subspace in the time frequency domain, then the BEMD decomposes the ST-based time-frequency representation (TFR) into a series of sub-TFRs at different scales, finally the NLM removes noise and restores ECG signal characteristics based on structural self-similarity. Results The proposed method is validated using numerous ECG signals from the MIT-BIH arrhythmia database, and several different types of noises with varying signal-to-noise (SNR) are taken into account. The experimental results show that the proposed technique is superior to the existing wavelet based approach and NLM filtering, with the higher SNR and structure similarity index measure (SSIM), the lower root mean squared error (RMSE) and percent root mean square difference (PRD). Conclusions The proposed method not only significantly suppresses the noise presented in ECG signals, but also preserves the characteristics of ECG signals better, thus, it is more suitable for ECG signals processing.


Introduction
The Electrocardiogram (ECG) is a powerful tool to reflect the state of cardiovascular health, and is currently extensively applied in the diagnosis of cardiac diseases.In reality, the ECG is usually susceptible to various types of noises and artifacts (1-5), including power line interference (PLI), Gaussian noise, baseline wander (BW), electrode motion noise (EM) and muscle artifacts (MA), which severely distort the ECG signal and bring more challenging for proper treatment of patients.
To extract the correct information associated with physiology of the heart, various techniques have been proposed toward removing the content of noise in the ECG signals, such as Wiener filter, adaptive filtering, wavelet transform (WT), independent component analysis (ICA), principal component analysis (PCA), empirical mode decomposition (EMD), variational mode decomposition (VMD) and non-local mean (NLM).The key idea of Wiener filter is to minimize the energy spectral density between the target signal and the measured signal (6), which was previously used in stationary signal analysis (7,8).Since Wiener filter does not need extra sensor information with noisy ECG signals, it has been applied in removal of noise from the ECG signals (9).However, the denoising performance of Wiener filter is not ideal for ECG signals, as the ECG signal is non-stationary.Adaptive filtering makes the denoised ECG signal close to the reference signal by minimizing the mean square error (10,11).It has been used to suppress motion artifact, electromyogram, power line interference, and baseline wander.It is worth noting that adaptive filtering might be less efficient due to the effect of error in the reference signal that is required, thus, it is difficult to deal with some continuous vibration artifacts (12).Wavelet transform is a popular ECG denoising technique.It can remove the noise from the ECG signals by using the characteristics of noise in the frequency domain (13,14).Although wavelet transform has many advantages over traditional filtering algorithms, there are still some drawbacks.First, it fails to preserve the edges of the ECG signals.
Second, a trade-off exists between accuracy and computational efficiency.Third, the choice of the basis function is also a troublesome task (15).Independent component analysis is a method suitable for separating independent components from ECG complex signals, and principal component analysis is able to reduce dimensionality for feature extraction of the ECG data (16).ICA and PCA denoise the in-band artifacts and noise of the ECG signals by removing the dimensions that correspond to noise (17).Both of them do not produce good results with single-lead ECG recording because they are based on correlation and uncorrelation ideas (18).Empirical mode decomposition is an adaptive and efficient decomposition method capable of decomposing an ECG signal into a series of finite intrinsic mode function (IMF) (19), which is suitable for analyzing nonlinear and non-stationary signals.Denoising by the EMD is usually is achieved by removing lower-order IMFs based on the assumption that the signal and noise are well-separated in frequency bands (20).Nevertheless, for ECG signals, although most signals are concentrated in lower frequencies, the QRS complex spreads across the mid-high frequency bands.Therefore, EMD only reduces the noise but cannot completely remove the noise from the ECG signals.In addition, EMD suffers from an important defect, named mode mixing.To address the problem, several variants of EMD were proposed, e.g., ensemble empirical mode decomposition (EEMD) (21) and complete ensemble empirical mode decomposition (CEEMD) (22).Variational mode decomposition is an enhanced version of EMD (23), which can decompose a noisy ECG signal into a set of narrow-band variational mode functions (VMFs), and then the noise from these narrow-band VMFs is filtered out.The main advantage of VMD is to solve the mode mixing effectively.Furthermore, VMD also provides some useful features such as phase angle that helps to classify the heart rhythm with abnormalities (24, 25).Non-local means is an effective image processing technique by averaging the different regions with similar features (26).The NLM is capable of preserving edge information, but it relies too much on the local width and half width of neighborhood.Therefore, the denoising performance of NLM is reduced with the increasing noise in the ECG signals.
The aforementioned techniques are mainly based on the difference between ECG signal and noise in the time domain, frequency domain or time-frequency domain for denoising ECG signals.However, such methods often have limitations in characterizing the deeper feature differences between ECG signal and noise.The main aim of this study is to propose a novel denoising method, named multi-scale time-frequency decomposition, to remove noise in ECG signals, where the characteristics of ECG signal and noise are refined and easier to identify in the multi-scale time-frequency domain.It combines S-transform (ST), bidimensional empirical mode decomposition (BEMD) and non-local means (NLM).Within this method, BEMD decomposes time-frequency map from ST into subtime-frequency map of different scales, and then NLM is employed to eliminate noise at different scales.The proposed method is evaluated in various noises such as PLI, Gaussian noise, BW, EM and MA.The major contributions of this paper are summarized as follows: (1) We present a robust and efficient time-frequency denoising framework for noise removal in ECG signals.(2) The presented method produces an improved SNR and the low RMSE and PRD.(3) The proposed method does not require any prior information and preserves the structural characteristics of ECG signals well.
The paper is organized as follow.Section 2 describes the theoretical basis and the presented time-frequency denoising framework.Section 3 demonstrates the effectiveness of the proposed method by comparing the denoising results obtained by wavelet transform based approach and NLM filtering.Section 4 presents the discussion.Section 5 concludes the work in this study.

S-transform
The S-transform, first proposed by Stockwell et al. (27), can provide frequency-dependent resolution while maintaining a direct relationship with the Fourier spectrum, as well as the extraction of phases the compose the analyzed signal.In fact, the ST is a generalization of the short-time Fourier transform (STFT) by using a moving and scalable localizing Gaussian window.Moreover, it is similar to a continuous wavelet transform (CWT) in having progressive resolution and retains absolutely referenced phase information.Thus, it has found applications in a range of fields.
The ST of a signal x(t) is defined as follows: where t and f denote time and frequency, respectively.τ is a time parameter that controls the location of window function g in time, g(t, f ) is Gaussian window function, which is represented as: The signal x(t) can be reconstructed from ST(t, f ).

Bi-dimensional empirical mode decomposition
Bi-dimensional empirical mode decomposition (BEMD) (28) is an extended EMD in two dimensions (2D), where the iteration and sifting operations are the same with EMD.It can extract the different frequency components of image, and adaptively decompose a 2D signal into a set of bi-dimensional IMFs (BIMFs) with a residue.The core idea of the BEMD is to find the intrinsic multi-scale oscillations in the input signal, the details are described as follows (Figure 1): (1) Search for all local minima and maxima of the 2D signal ST(t, f ) based on cubic spline algorithm.(2) Utilize the obtained the extrema to construct the maxima envelope E max (t, f ) and minima envelope E min (t, f ).(3) Calculate the average envelope avgE 1 (t, f ) (4) Subtract the average envelope from the original signal ST(t, f ) Step ( 4) is repeated n times until the BIMF decomposition condition is met, thus, we have (5) The first separated BIMF 1 and the residue are obtained The residue is treated as a new input of the sifting processing, and then the procedure is repeated m times until the stopping criterion is satisfied, so we obtain a set of BIMFs.Let H ij (t, f ) represent the jth iteration in the ith sifting processing, thus

Non-local means
Non-local means (NLM) filtering (29), originally proposed for image denoising (30), is a popular denoising algorithm, and it has been widely applied for noise removal in ECG signals.The key of the NIM algorithm is based on the self-similarity of the image.It estimates the value of the current pixel in the image by taking a weighted average of surrounding pixels with similar neighborhood structure.In fact, the time-frequency map reflects the evolution of signal energy over time and frequency, and the energy density between adjacent samples has a certain similarity.Therefore, the characteristics of time-frequency map are consistent with the one of the image required by NLM.In this study, the BIMFs are filtered by NLM to remove the noise at different scales.
Consider a noisy ECG signal where y(n) is the noisy signal, s(n) is the desired signal and y(n) is the noise.For a given sample s(m), the estimate ŝ(m) is a weighted sum of values within a neighborhood N(m), namely where Z(m) ¼ P n v(m, n), and the weights are Flowchart of BEMD algorithm.where λ denotes a bandwidth parameter, Δ represents the local patch of samples surrounding m, which is composed of L D samples, d 2 is the sum of squared point-by point difference between samples of two patches that are centered on m and n, respectively.It is worth noting that there are three key parameters that should be determined in the NLM algorithm, e.g., the bandwidth λ, the patch half-width P and the neighborhood half-width Q.The parameter λ controls the degree of smoothing, and the denoising performance mainly relies on the selection of λ.Specifically, a smaller λ will cause noise fluctuations while a larger λ will result in dissimilar patch to appear similarly.Vile and Kocher (31) suggested that the optimal bandwidth is 0.5σ, σ is the standard variance of noise.Tracey and Miller (32) suggested the parameter Q is equals to the high amplitude Rwave in QRS complex.The parameter Q is suggested to be large, but the computation cost will be raised.

Preprocessing
The MIT-BIH arrhythmia database is a well-known publicly available data.It is worth noting that they contain the raw noise, not clean signals.Therefore, in order to evaluate the proposed method more fairly, we first employ median filtering to remove the raw noise.Figure 2 shows the original signal with raw noise (part of record 103) and the corresponding denoised signal by median filtering.As can be clearly seen, the raw noise has been effectively suppressed, thereby facilitating subsequent processing.

Proposed method
An efficient denoising method can reduce the impact of noise, so that the specialists accurately diagnose cardiac disease based on the extracted ECG characteristics.In this study, a hybrid denoising scheme in the time-frequency domain is proposed to denoise the ECG signals.Figure 3 shows the flowchart of the proposed method.The main steps are summarized as follows: (1) Calculate the time-frequency representation (TFR) of an ECG signal using the ST method.(2) Separate the magnitude spectrum and phase spectrum of the TFR.(3) Decompose the magnitude spectrum of TFR using the BEMD algorithm into a set of BIMFs (including the residue component).( 4) Apply the NLM filer to each BIMF.
(5) Reconstruct the denoised magnitude spectrum by superimposing the processed BIMFs.(6) Transform back the denoised magnitude spectrum into the time domain for recovering the denoised ECG signal by using the inverse ST (IST) method.
The BEMD decomposition results are depicted in Figure 4.It can be clearly seen that a noisy time-frequency signal is decomposed into four BIMFs by BEMD algorithm, and the contents of frequency gradually decrease from BIMF1 to BIMF4.Then, we perform the IST on the noisy BIMFs to obtain the noisy time-domain IMFs.Similarly, the frequencies of time-domain IMFs are also gradually reduced from IMF1 to IMF4. Figure 5 shows the denoised BIMFs by the NLM filtering.The comparison between the noisy BIMFs and the denoised BIMFs indicates that most of noise has been successfully removed and the time-frequency energy is more concentrated.Also, we perform the IST on the denoised BIMFs and obtain the denoised time-domain IMFs.Compared with the noisy IMFs, the denoised IMFs are smoother, and ECG characteristics are significantly highlighted.

Results
The proposed method is evaluated on ECG signals collected from MIT-BIH arrhythmia database (33) and noise stress test database (34).The MIT-BIH arrhythmia database contains 48 records of 30 min each.They are digitized with a sampling  Flowchart of the proposed hybrid denoising scheme.The noisy BIMFs decomposed by BEMD.
where y j (n) is the original signal, ŷj (n) is the denoised signal, M denotes the length of the ECG signal.x is the original image, y is the denoised image, m x and s x are the mean and standard The denoised BIMFs by NLM.
L is the range of pixel values, and It should be mentioned that the SNR measures the quality of the denoised ECG signal.The higher the output SNR, the better the denoising performance.The RMSE evaluates the variance between the real ECG signal and the denoised ECG signal.A lower RMSE means a smaller difference.The PRD indicates the distortion in the denoised ECG signal.A lower PRD represents a better recovery performance.The range of SSIM is between 0 and 1, and the larger the value, the better the quality of the image.

Power line interference
PLI is the most common noise with a frequency of 50 or 60 Hz and an amplitude of up to 50% peak-to peak ECG amplitude (35).In this study, the 60 Hz PLI is chosen as target.The comparison of the proposed method and some classic techniques such as WTbased method and NLM filtering for denoising PLI from ECG signals is shown in Table 1.As reported in Table 1, in removing PLI noise, the proposed method performs clearly well, with the higher output SNR, lower RMSE and PRD compared to WTbased method and NLM filtering.For example, for record 105, the proposed method produces an output SNR of 11.141 dB and a SSIM of 0.985, a RMSE of 0.0135 and a PRD of 30.96 at 5 dB input SNR (See Figure 6D).In contrast, the WT-based method (See Figure 6B) and NLM (See Figure 6C) obtain the output SNR of 5.059 dB and 9.560 dB, the RMSE of 0.0295 and 0.0283, the PRD of 44.15 and 38.48, and the SSIM of 0.708 and 0.876, respectively.

Gaussian noise
In Table 2, a comparison is shown for SNR, RMSE, PRD and SSIM of the proposed method and WT-based method and NLM filtering using five ECG records.The results demonstrate that the proposed method gives the higher values of output SNR and lower values of RMSE and PRD.For instance, for record 212 with input SNR of 5 dB and 10 dB (See Figure 7A), the proposed method (See Figure 7D) produces an output SNR of 13.296 dB and 16.099 dB, however, the WT-based method (See Figure 7B) and NLM filtering (See Figure 7C) give 10.107 dB, 11.783 dB and 9.074 dB, 10.112 dB, respectively.Similarly, the RMSE results also show better performance of the proposed method with the RMSE of 0.0297 and 0.0078, which are less than the values of the WT-based method and NLM filtering, which are 0.0309, 0.0210 and 0.0980, 0.0300, respectively.Moreover, the PRD values of the proposed method with 23.64 and 12.12 are the smallest among the comparison methods for the same record 212.In addition, the proposed method has the largest SSIM values, 0.967 and 0.976, respectively.

Baseline wander
Baseline wander is a low-frequency noise within 0.15-0.3Hz with an amplitude of 15% of peak-peak ECG amplitude (15).It is very necessary to remove this noise from ECG signals, which makes interpreting ECG signal more difficult.The proposed method is applied to remove the BW, and we make a comparison with the other existing techniques, including the WT-based method and NLM filtering.Table 3 presents the values of parameters SNR, RMSE and PRD.The results show that the proposed method (See Figure 8D) provides better output results at the different input SNRs.For record 117, the output SNR and SSIM by our method is 14.001 dB and 0.972 when the input SNR is 10 dB, which is better than the WT-based method (See Figure 8B) and NLM filtering (See Figure 8C) by 8.454 dB, 0.752 and 8.055 dB, 0.727, respectively.For the same input SNR, the RMSE and PRD values for the selected ECG record 117 obtained by the proposed method are 0.0062, 10.47, respectively, which are lower than those of the WT-based method and NLM filtering with 0.0115, 12.51 and 0.0161, 13.43, respectively.

Muscle artifact
Muscle artifact with the low amplitude can mimic the baseline in atrial fibrillation that makes diagnosis difficult.Therefore, MA removal from ECG signals is a key task in the field of signal processing.The comparison of evaluation parameters such as SNR, RMSE, PRD and SSIM are listed in Table 4.It can be observed that the proposed method (See Figure 9D) brings a large improvement in the SNR, RMSE and PRD values compared with the WT-based method and NLM filtering.For example, the record 230 with an input SNR of 5 dB, the proposed method results (See Figure 9D) in an output SNR of 9.268 dB and a SSIM of 0.787, while the WT-based method (See Figure 9B) and NLM filtering (See Figure 9C) provide the output SNR and SSIM of 5.414 dB, 5.029 dB, and 0.370, 0.381, respectively.Similarly, Table 4 also indicates that the RMSE and PRD values obtained by the proposed method are 0.0045, 33.90.These values are lesser than the results from the WT-based method and NLM filtering, that is, 0.0175, 41.92 and 0.0208, 43.83, respectively.

Electrode motion
Electrode motion noise is common in practice, and it can be mistaken for ectopic beat.However, it is very difficult to tackle Gaussian noise removal, (A) noisy signal, (B) denoised signal by WT, (C) denoised signal by NLM, (D) denoised signal by the proposed method.
Bing et al. 10.3389/fcvm.2024.1277123using the traditional filtering techniques.Table 5 lists the values of parameters SNR, RMSE, PRD and SSIM of the denoised ECG signals obtained by the WT-based method, NLM filtering and the proposed method.The comparison indicates that the WTbased method and NLM filtering bring some improvements to some extent in terms of ECG signals enhancement.Nevertheless, the proposed method (See Figure 10D) does a better job, with higher SNR, SSIM and lower RMSE, PRD.It can be observed that the record 232 with an input SNR of 10 dB provides an output SNR and a SSIM of 12.520 dB, 0.950, respectively, while for the same record the WT-based method (See Figure 10B) and NLM filtering (See Figure 10C) provide the output SNR of 7.402 dB, 7.974 dB, and the SSIM of 0.861, 0.887, respectively.Similarly, the RMSE and PRD values given by the proposed method are 0.0047, 22.54, which are lower than those of the WT-based method and NLM filtering, that is, 0.0152, 32.61 and 0.0144, 31.20,respectively.

Discussion
The non-stationary and nonlinear characteristics of ECG signals and various noise interferences make the analysis of ECG signals a very challenging task (36).The noise removal becomes an important research topic in ECG signals analysis.For ECG signals, it is necessary not only to analyze the frequency content of the signal, but also to characterize how the frequency changes with time.
The aim of this study is to address the problem of noise interference in the ECG signals by using an efficient hybrid denoising scheme in the time-frequency domain.We propose a new ECG signal denoising method by transforming a onedimensional time-domain ECG signal into a two-dimensional time-frequency map using ST, BEMD and NLM approaches.The In the paper, two classic ECG denoising techniques including the WT-based method and NLM filtering are employed to compare the denoising performance.In our experiments, the proposed denoising scheme performs clearly better, with the higher output SNR and SSIM, lower RMSE and PRD for all the noises at different levels of input SNR.In fact, there are two important problems for the WT-based method (37).First, the filtered result depends on the selection of the mother wavelet, and it is difficult to find a suitable mother wavelet that is able to provide good filtered result in practice.Second, the WT may cause oscillation in the reconstructed ECG signal and the reduced amplitude of ECG waveform.The performance of NLM filtering relies on the selection of a parameter's bandwidth (38), which mainly depends on the noise standard deviation that might not be properly determined for ECG signals corrupted by a number of noises in the time domain.
The multi-scale time-frequency denoising method proposed in the paper exhibits outstanding performance.Our results show that the waveform variation trend of the signal after multi-scale timefrequency denoising fit well to the original signal with a smoother waveform.It is noteworthy that there are not too many parameters involved in the proposed algorithm, which makes it easier to embed into wearable ECG signal acquisition and analysis system as an effective complementary tool to traditional ECG denoising approaches in practice.In addition,

Conclusion
In this paper, an efficient approach is proposed based on a hybrid scheme to remove various noises in ECG signals.The performance of the proposed method is investigated by comparing it with the existing techniques such as the WT-based method and NLM filtering.Experimental results on a wide variety of ECG signals demonstrate that the proposed method achieves the higher output SNR and SSIM and lower RMSE and PRD than the comparative methods for PLI, Gaussian noise, BW, MA and EM noise.The proposed method not only significantly suppresses the noise presented in ECG signals, but also preserves the characteristics of ECG signals better, thus, facilitating ECG signals analysis and processing for cardiovascular diseases detection.

TABLE 1 A
comparison of removing PLI at different input SNRs.respectively, m y and s y are the mean and standard deviation of y, respectively.s xy is the covariance of x and y, C 1

TABLE 2 A
comparison of removing Gaussian noise at different input SNRs.

TABLE 3 A
comparison of removing BW at different input SNRs.-frequency map obtained by ST can better exhibit the characteristics of ECG signal and noise.BEMD can adaptively decompose the time-frequency signal into a series of BIMFs of different scales, thus, the characteristics of ECG signal and noise can be finely described at multiple scales.Subsequently, the noise can be removed at different scales by denoising the BIMFs using NLM algorithm based on structural self-similarity.Analysis of the results indicates that the proposed method can not only effectively suppress the noise in the ECG signals, but also better preserve the characteristics of ECG signals.
FIGURE 8 Baseline wander removal, (A) noisy signal, (B) denoised signal by WT, (C) denoised signal by NLM, (D) denoised signal by the proposed method.time

TABLE 4 A
comparison of removing MA at different input SNRs.there are several potential directions for future work.First, many image denoising algorithms and deep learning framework can help ECG signals analysis and processing in the multi-scale timefrequency domain.Second, time-frequency analysis is suitable for non-stationary and non-linear signals, thus, feature extraction and cardiovascular disease classification for ECG signals can be considered in the multi-scale time-frequency domain.In a word, the multi-scale time-frequency analysis of ECG signals has broad application prospects, and future work will focus on the combined use of multiple strategies to improve the quality of ECG signals and enhance the diagnosis accuracy of cardiovascular diseases.

TABLE 5 A
comparison of removing EM at different input SNRs.