ECG signal denoising using a novel approach of adaptive filters for real-time processing

Received Aug 16, 2019 Revised Jul 14, 2020 Accepted Sep 22, 2020 Electrocardiogram (ECG) is considered as the main signal that can be used to diagnose different kinds of diseases related to human heart. During the recording process, it is usually contaminated with different kinds of noise which includes power-line interference, baseline wandering and muscle contraction. In order to clean the ECG signal, several noise removal techniques have been used such as adaptive filters, empirical mode decomposition, Hilbert-Huang transform, wavelet-based algorithm, discrete wavelet transforms, modulus maxima of wavelet transform, patch based method, and many more. Unfortunately, all the presented methods cannot be used for online processing since it takes long time to clean the ECG signal. The current research presents a unique method for ECG denoising using a novel approach of adaptive filters. The suggested method was tested by using a simulated signal using MATLAB software under different scenarios. Instead of using a reference signal for ECG signal denoising, the presented model uses a unite delay and the primary ECG signal itself. Least mean square (LMS), normalized least mean square (NLMS), and Leaky LMS were used as adaptation algorithms in this paper.


INTRODUCTION
Electrocardiograms (ECG) signals contain different kinds of information that can be used to diagnose various heart related diseases. They reflect the electrical activity of the human heart. ECG signals are usually contaminated by various types of noise and artifacts. Power line interference (PLI), baseline wander, drift in electrodes connections (electrode misconduct noise and electrode displacement artifacts), and muscle artifacts are the most effective ones. They make the diagnosing process and obtaining the required signal information a hard task to reach [1,2]. Performing any kinds of physical analysis to ECG signals should be proceeded by signal denoising process since this kind of analysis might result in wrong diagnosis of cardiac arrhythmias [3][4][5][6][7][8]. In order to remove the contamination noise (denoising) from the recorded ECG signal, several methods have been presented.
The current existing denoising methods have a high capability rate of suppressing noises and artifacts that might vary the ECG signal morphology. The ST-segment shown in Figure 1 might get distorted during the filtering process if the baseline wander removal methods are used. This issue represents the main concern in using baseline wander removal techniques [11,12]. In most cases, simple digital or analog filters might not be adequate for removing electromyogram (EMG) signal without affecting the peaks, period, interval, and featuring shapes of the ECG signal [13,14]. In fact, some of the currently used method for ECG signal denoising may create severs problems. For example, the EMD based noise reduction techniques introduce QRS widening issue due to the big distortion effect at its beginning and end [15]. Hence, the noise removal techniques might clearly vary the ECG segment waves by overlapping their spectrum with several noise and artifacts especially in the frequency duration of 0.5 Hz to 100 Hz.
Unfortunately, all the presented methods such as SVD, DCT, DWT, EMD, and NBF are not suitable for real-time processing since they take a very long time. This paper presents a new technique for ECG signal denoising using a novel approach of adaptive filter. Up to our knowledge, no paper has presented such idea for ECG signal denoising. The remaining structure of the paper are as follow: section 2 presents the proposed filtering method, section 3 presents the obtained results as well as discussion, and finally section 4 is the conclusions and recommendations for future work.

PROPOSED METHODOLOGY
The common way of removing noise from ECG signal is digital filters. Processing the recorded ECG signal using digital filters most of the time has been done offline. When the noise change, one might need to change the filters' coefficients to deal with the new kinds of noise. To avoid this issue, adaptive filters can be used to deal with the different kinds of noise. But adaptive filters need a reference noise that should be close enough to the targeted noise, so it can be removed as shown in Figure 2. Based on Figure 2, only specific type of noise can be removed.
In the proposed method, different kinds of noise can be removed using only one adaptive filter. Besides that, there is no need to have a reference signal. The suggested method uses a delayed version of the ECG signal itself as a reference, based on adaptive predictive filtering, which makes it more suitable for realtime ECG signal denoising. Figure 3 explains the block diagram of the suggested method.
Adaptive filters are digital linear filter with frequent iterative weight changes capability to obtain the best possible solution of the error or cost function as shown in Figure 2. The reference input signal is considered as the main input to the adaptive filter, whereas its output will be added negatively (subtracted) to the primary input signal and the result will be the error signal. The error signal controls the weights of the filter taps. Several algorithms and different block diagram have been used to find the best possible solution of the error function. Sayed [16] and Haykin [17] presents several methods for solving the optimization goals in their textbooks. Least mean square (LMS), normalized least mean square (NLMS), and recursive least squares (RLS) are the commonly used algorithms for reducing unwanted signal.

LMS algorithm
LMS has been employed more often than other algorithms in removing noise and distortion in different signal processing applications due to its distinguished properties. Simplicity, stability, and easier implementation are among its features. The reputative procedure in LMS algorithm consists of: computing the adaptive filter's output, produced by a set of taps, generating an estimation for the error signal by subtracting the filter's output to the desired input, and using the obtained error to adjust the filter weights [18]. The length of the adaptive filter as well as the step size have a direct impact on the stability and the speed of convergence of LMS algorithm.
To derive the weight update equation in this algorithm, first the objective cost function must be defined. It is usually known as the mean square error between the estimated filter's output and the real or actual output. Based on this definition, the filter's weights, error, and the output equation of LMS algorithm will be as follow [19,20]: For a given input signal  ) (k x , which is an array of size M*M: where M refers to the filter taps, k refers to current input sample, and ) (k x is the current input sample.
The adaptive filter's output  ) (k y is known as: where T means the transpose of the matrix, and ) (k y is the filter's output at the current time instance k. The weight matrix  ) (k w is: From the cost signal definition, Where ) (k e refers to the current sample's error, whereas E is the expected function. Applying the steepest decent technique by taking the partial derivatives with respect to the individual filter's weights will lead to: To minimize the value of the cost signal, it is required to reverse the direction of ) (n C w  which can be expressed in math as: where  is known as the step size. In (11) represents the direct relation between the current and next vectors weights.

NLMS algorithm
The convergence, stability, as well as the steady state behaviors of LMS algorithms depend heavily on the length of the adaptive filter and the primary input's strength. In order to deal with this issue, NLMS might be a good choice to use. It normalizes the input power to reduce the effects of the above-mentioned issues. All the equations listed before, remain as they are. Whereas the new weight update equation is as follow [18]:

Leaky LMS algorithm
Sometimes LMS algorithm fails in reaching the stability goal. The use of learning rate or variable step size might be a good solution to ensure the stability condition. Leaky LMS algorithm is an alternative solution for this issue. It was proposed to avoid the LMS convergence's slowness [21]. All the variables and signals mentioned before (LMS and NLMS) remain as they are in this algorithm. The new equation for the weight update in Leaky LMS is as follow: where  ( positive and very small number) is known as the leaky factor.

SIMULATION AND RESULTS
To verify the operation of the proposed denoising method, an ECG signal with different type of noise was used in MATLAB software. In (11)- (13) were used as the weight update equations for LMS, NLMS, and Leaky LMS algorithms respectively. The length of the adaptive filter was M=20. The step size was selected as in LMS, NLMS, and Leaky LMS. The leaky factor gamma=0.1 in Leaky LMS algorithm. The noisy and clean ECG signals are shown in Figures 4-6 using LMS, NLMS, and leaky LMS algorithms respectively. In each figure, there is the signal before processing which appears on the top, and the signal after processing which appears on the bottom of the figures. It is obvious how the proposed method was able to clean the signal under different noise scenarios. Besides that, the propsed method dosnt need any externel signal source as other ones [22][23][24][25].

CONCLUSION AND FUTURE WORK
The paper presents a novel method for ECG signal denoising using adaptive filters. The proposed method works properly for real time application since it depends only on the upcoming ECG signal without the need for a reference noise signal. The suggested method was tested and verified using LMS, NLMS, and Leaky LMS algorithms. As a future work, the author will investigate the possibility of using the proposed model or Kalman filter based on the proposed model in different biomedical signal processing applications.