ECG Signal Denoising By Wavelet Transform Thresholding

: In recent years, ECG signal plays an important role in the primary diagnosis, prognosis and survival analysis of heart diseases. In this paper a new approach based on the threshold value of ECG signal determination is proposed using Wavelet Transform coefficients. Electrocardiography has had a profound influence on the practice of medicine. The electrocardiogram signal contains an important amount of information that can be exploited in different manners. The ECG signal allows for the analysis of anatomic and physiologic aspects of the whole cardiac muscle. Different ECG signals are used to verify the proposed method using MATLAB software. Method presented in this paper is compared with the Donoho's method for signal denoising meanwhile better results are obtained for ECG signals by the proposed algorithm.


INTRODUCTION
The development of the electrocardiograph was the culmination of a scientific effort aimed at perfecting a device conceived for the elucidation of a physiological phenomenon. The development of the digital computer was the culmination of scientific effort aimed at improving man's welfare. Both of these fairly recent innovations of modern technology have been moderately successful in their main initial objectives. During the last five decades the analysis of the ECG signal evolved from the simple visual inspection to completely automated diagnosis systems [1,2,3] .
The morphology of ECG signal has been used for recognising much variability's of heart activity, so it is very important to get the parameters of ECG signal clear without noise [4] . This step gives a full picture and detailed information about the electrophysiology of the heart diseases and the ischemic changes that may occur like the myocardial infarction, conduction defects and arrhythmia. In order to support clinical decisionmaking, reasoning tool to the ECG signal must be clearly represented and filtered, to remove out all noises and artifacts from the signal. ECG signal is one of the biosignals that is considered as a non-stationary signal and needs a hard work to denoising [ 5,6] . An efficient technique for such a non-stationary signal processing is the wavelet transform. The wavelet transform can be used as a decomposition of a signal in the time-frequency scale plane. There are many application areas of wavelet transform like as sub-band coding data compression, characteristic points detection and noise reduction. In order to reduce the noise of ECG signal many techniques are available like digital filters (FIR or IIR), adaptive method and wavelet transform thresholding methods. However, digital filters and adaptive methods can be applied to signal whose statistical characteristics are stationary in many cases. Recently the wavelet transform has been proven to be useful tool for non-stationary signal analysis. Thresholding is used in wavelet domain to smooth out or to remove some coefficients of wavelet transform subsignals of the measured signal. The noise content of the signal is reduced, effectively, under the nonstationary environment. The denoising method that applies thresholding in wavelet domain has been proposed by Donoho as a powerful method [7,8] . It has been proved that the Donoho's method for noise reduction works well for a wide class of onedimensional and two-dimensional signals Several methods to enhance ECG signal have been presented in literature. The most widely used is the least mean square adaptive algorithm (LMS). But this algorithm is not able to track the rapidly varying nonstationary signal such ECG signal within each heart beat, this causes excessive low pass filter of mean parameters such QRS complex. In paper [9] are presented some of these algorithms which use LMS such as the adaptive impulse correlated filter (AICF), the timesequence adaptive filter (TSAF) and the signal-input adaptive filter (SIF). The disadvantages of AICF are being not very robust to noise, and it's repetitive, it means that for example amplitude R or P is the same in each beat. The TSAF is not robust to noise, and has null output if the beat period increases (makes it have no effect). The SIF is the best, it's not repetitive and it's robust to noise, but it slightly smoothes the mean parameters like R or P amplitudes. Using presented system in this paper, these all problems can be avoided, because WT is suitable for nonstationary signals such ECG signal.
Major interest of the recent paper is shed some light to the ECG signal noise reduction using Wavelet Transform. The determination of the wavelet transform and the choice of thresholding parameters are considered In this paper we established a relationship between threshold value obtained and the noisy signal using the wavelet transform in order to compare the results with Donoho's relationship of the threshold value obtained.

Wavelet transform:
A wavelet is simply a small wave which has energy concentrated in time to give a tool for the analysis of transient, nonstationary or time-varying phenomena such as a wave shown in figure 1. A signal as the function of f(t) shown in Fig. 1 can often be better analyzed and expressed as a linear decomposition of the sums: products of the coefficient and function. In the Fourier series, one uses sine and cosine functions as orthogonal basis functions. But in the wavelet expansion, the two-parameter system is constructed such that one has a double sum and the coefficients with two indices. The set of coefficients are called the Discrete Wavelet Transform (DWT) of f(t).
Namely called a wavelet series expansion which maps a function of a continuous variable into a sequence of coefficients much of the same way as Fourier series dose with the main useful four properties.
The representation of singularities, the representation of local basis functions to make the algorithms adaptive in-homogeneities of the functions, also they have the unconditional basis property for a variety of function classes to provide a wide range of information about the signal.They can represent smooth functions.
In discrete case, the wavelet transform is modified to a filter bank tree using the Decomposition/ reconstruction given in Fig.2. The results in the preceding section give us the theoretical basis for the discrete wavelet transform. We can show that given any multiresolution , we have two functions: (known as the scaling function), and (the wavelet) that are contained in translated and dilated versions of which form an orthonormal basis of . We have: (2) This process can be expressed completely in terms of the digital filters and as follows: where the set of numbers represents the approximation of the signal at the resolution and the set of numbers represents the details lost in approximating the signal at resolution at the resolution .

Donoho's denoising method:
The DWT of a signal is somewhat difficult to illustrate because it is a function of two variables or indices: with the time translation k and the scaling index j. One calls the DWT of a signal the coefficients of its decomposition in wavelet series. Recent works by Donoho and Johnstone gives a better understanding of how wavelet transforms work. This new understanding combined with nonlinear processing solves currently problems and gives the potential of formulating and solving completely new problems [3] . The method is based on taking the discrete wavelet transform (DWT) of a signal, passing this transform through a threshold, which removes the coefficients below a certain value, then taking the inverse DWT (IDWT) where; T is threshold, n is the number of samples and is the noise standard deviation. These results were carried out for the same signal. This able to remove noise and achieve high compression ratio because of the concentrating ability of the wavelet transform. If a signal has its energy concentrating in a small number of wavelet dimensions, its coefficients will be relatively large compared to any other signal or noise that has its energy spread over a large number of coefficient. This means that thresholding or shrinking the wavelet transform will remove the low amplitude noise or undesired signals and any noise overlap as little as possible in the frequency domain and linear time-invariant filtering will approximately spare them. It is the localizing or concentrating properties of the wavelet transform that make it particularly effective when used with this nonlinear method.

METHODOLOGY
The presented method based on decomposing the signal into five levels of wavelet transform by using Daubechies wavelet (db4) and determining a threshold through a loop to find the value where minimum error is achieved between the detailed coefficients of thresholded noisy signal and the original.
The method can be divided into the following steps: 1-Noise Generation and addition: A random noise is generated and added to the original signal. Mathematically defined: where S(n) is the random high pass noise, V(n) is free of noise ECG and Vs(n) is the noisy ECG signal. 2. Decomposing of the noisy and original signals using wavelet transform: The noisy and original signals are decomposed into five levels by discrete wavelet transform using the Daubechies wavelet (db4).

Choosing and applying threshold value:
For each level a threshold value is found through a loop, and it is applied for the detailed coefficients of the noisy and original signals. The optimum threshold is chosen by taking the minimum error between the detailed coefficients of noisy signal and those for original signal. A soft thresholding is used to shrinkage the wavelet detailed coefficients of the noisy signal such that: where C j,k -is the wavelet transform coefficients, d(C j,k ) -is the output wavelet transform coefficients after thresholding, and T is the chosen threshold.
For each level a loop is applied to find the threshold value that gives the minimum error between the detailed coefficients of the noisy signal and those of original signal.

Reconstruction:
The original signal is reconstructed using Inverse Discrete Wavelet Transform IDWR (Fig.2). Thresholding of wavelet coefficients affects greatly the quality of ECG morphology, thus, threshold determination is very essential issue in this case. Two concepts are presented in study to accomplish high quality ECG signal reconstruction; threshold determination using above method and the idea of not to threshold the approximation coefficients of ECG signal. The approximation coefficients contain the low frequency of the original signal where most energy exists.
Finally, the percentage root mean square difference (PRD) (eq.7) and signal to noise ratio (SNR) (eq.8) are calculated to verify the improvement in the reconstructed signal.

RESULTS AND DISCUSSION
Four different signals are used to study the effect of threshold value of discrete wavelet transform coefficients. These signals are considered as original and free of noise ECG signal with different morphology. The standard deviation , the number of samples and threshold value of the detailed coefficients for each signal is tabulated in table 1.
The chosen threshold is accomplished by taking the value of smallest PRD between original signal subsignal and noisy signal subsignal. PRD gives very accurate measuring of error related to deformation of original signal subsignal. This very good way to exact threshold value determination.
An experimental relationship of the threshold of standard deviation of wavelet coefficients and of the noisy signal is derived based on the previous results (Table 1). This relationship was used to determine the threshold:     The presented method is based on choosing threshold value by finding minimum error of denoised and original wavelet subsignal (coefficients). Therefore, high quality denoised signal can be accomplished. Very important role plays ECG signal in diagnosing the irregularities of heart work. Thus, our study establishes particular approach to fit ECG signal that has nonstationary clinical information. To preserve the distinct ECG waves and different low pass frequency shapes; the method thresholds detailed wavelet coefficients only. This concepts is used to return the low frequencies (P-wave where the frequency is less than 8Hz and T-wave where the frequency is less than 11Hz ) by inverse Discrete wavelet transform IDWT. This can be noticed in Fig.4.. Donoho's method deforms, slightly, low frequency P and T-waves, by creating small wave at the beginning of these waves. In another hand, the denoised signal achieved by our relation is not repetitive like AICF, robust to noise more than TSAF and doesn't smooth P and T-waves like SIF.
In this study a new relationship to find the threshold value has been proposed and needs to be evaluated for many signals for validity. Its clear from the figures 3 and 4 of the denoised signals using the derived relationship that the results are better in comparing with those denoised by Donoho's relation.
The SNR is improved more than Donoho results ( see Tables 2 & 3). We can see from Fig.3 and Fig.4 that the system is not repetitive, very robust to noise and after comparing the results of QRS detector between the input signal and the output signal , we can notice that the system doesn't smooth QRS complex or deform R-R interval.

CONCLUSION
The wavelet transform allows processing nonstationary signals such as ECG signal. This is possible by using the multi resolution decomposing into subsignals. This assists greatly to remove the noise in the certain pass band of frequency. The presented method shows a new experimental threshold of wavelet transform coefficients. This threshold value is accomplished experimentally after using a loop of calculating a minimum error between the denoised wavelet subsignals and the original free of noise subsignals. Above study shows the ability of finding out special threshold of ECG signal. The experimental application of above threshold result is better than Donoho's threshold, particularly, in ECG signal denoising.