Open access peer-reviewed chapter

Adaptive Noise Removal of ECG Signal Based On Ensemble Empirical Mode Decomposition

By Zhao Zhidong, Luo Yi and Lu Qing

Submitted: October 7th 2010Reviewed: March 22nd 2011Published: July 5th 2011

DOI: 10.5772/16263

Downloaded: 2833

1. Introduction

The electrocardiogram (ECG) records the electrical activity of the heart,which is a noninvasively recording produced by an electrocardiographic device and collected by skin electrodes placed at designated locations on the body. The ECG signal is characterized by six peaks and valleys, which are traditionally labeled P, Q, R, S, T, and U, shown in figure 1.

Figure 1.

ECG signal

It has been used extensively for detection of heart disease. ECG is non-stationary bioelectrical signal including valuable clinical information, but frequently the valuable clinical information is corrupted by various kinds of noise. The main sources of noise are: power-line interference from 50–60 Hz pickup and harmonics from the power mains; baseline wanders caused by variable contact between the electrode and the skin and respiration; muscle contraction form electromyogram (EMG) mixed with the ECG signals; electromagnetic interference from other electronic devices and noise coupled from other electronic devices, usually at high frequencies. The noise degrades the accuracy and precision of an analysis. Obtaining true ECG signal from noisy observations can be formulated as the problem of signal estimation or signal denoising. So denoising is the method of estimating the unknown signal from available noisy data. Generally, excellent ECG denoising algorithms should have the following properties: Ameliorate signal-to-noise ratio (SNR) for obtaining clean and readily observable signals; Preserve the original characteristic waveform and especially the sharp Q, R, and S peaks, without distorting the P and T waves.

A lot of methods have been proposed for ECG denoising. In general both linear and nonlinear filters are presented, such as elliptic filter, median filter, Wiener filter and wavelet transform etc. These methods have some drawbacks. They remove not only noise but also the high frequency components of non-stationary signals. In the worse they can remove the characteristic points of signals that are crucial for successful detection of waveform. In recent years wavelet transform (WT) has become favourable technique in the field of signal processing. Donoho et al proposed the denoising method called “wavelet shrinkage”; it has three steps: forward wavelet transform, wavelet coefficients shrinkage at different levels and the inverse wavelet transform, which work in denoising the signals such as Universal threshold, SureShrink, Minimax. Wavelet shrinkage methods have been successful in denoising ECG signals (Agante, P.M&Marques J.P, 1999; Brij N. Singh & Arvind.K, 2006). A New wavelet shrinkage method for denoising of biological signals is proposed based on a new thresholding filter (Prasad V.V.K.D.V; Siddaiah P; Rao BP,2008).De-noising using traditional DWT has a translation variance problem which results in Pseudo-Gibbs phenomenon in the Q and S waves, so the following algorithms tried to solve this problem: used cyclic shift tree de-noising technique for reducing white Gaussian noise or random noise, EMG noise and power line interference (Kumari, R.S.S. et al,2008).The selected optimal wavelets basis has been investigated with suitable shrinkage method to de-noise ECG signals, not only it obtains higher SNR, but preserves the peaks of R wave in ECG(Suyi Li. et al,2009).Scale-dependent threshold methods are successively proposed. A new thresholding procedure is proposed based on wavelet denoising using subband dependent threshold for ECG signals: The S-median-DM and S-median thresholds (Poornachandra.S, 2008).

In this work, in order to enhance ECG, the new adaptive shrunken denoising method based on Ensemble Empirical Mode Decomposition (EEMD) is presented that has a good influence in enhancing the SNR, and also in terms of preserving the original characteristic waveform. The paper is organized as follows: section 2 introduces Empirical Mode Decomposition (EMD) and EEMD is studied in section 3. EMD is a relatively new, data-driven adaptive technique used to decompose ECG signal into a series of Intrinsic Mode Functions (IMFs). The EEMD overcomes largely the mode mixing problem of the original EMD by adding white noise into the targeted signal repeatedly and provides physically unique decompositions. Wavelet shrinkage is studied in section 4; the wavelet shrinkage denoising method is simply signal extraction from noisy signal via wavelet transform. It has been shown to have asymptotic near-optimality properties over a wide class of functions. The crucial points are the selections of threshold value and thresholding function. The generalized threshold function is build. Computationally exact formulas of bias 、variance and risk of generalized threshold function are derived. Section 5 concentrates on adaptive threshold values based on EEMD.Noisy signal is decomposed into a series of IMFs, and then the threshold values are derived by the noise energies of each IMFs. To evaluate the performance of the algorithm, Test signal and Clinic noisy ECG signals are processed in section 6. The results show that the novel adaptive threshold denoising method can achieve the optimal denoising of the ECG signal. Conclusions are presented in section7.

2. Empirical mode decomposition

EMD has recently been proposed by N.E. Huang in 1998 which is developed as a data-driven tool for nonlinear and non-stationary signal processing. EMD can decompose signal into a series of IMFs subjected to the following two conditions:

  1. In the whole dataset, the number of extrema and the number of zero-crossing must either be equal or differ at most by one.

  2. At any time, the mean value of the envelope of the local maxima and the envelope of the local minima must be zero.

Figure.2 shows a classical IMF. The IMFs represent the oscillatory modes embedded in signal. Each IMF actually is a zero mean monocomponent AM-FM signal with the following form:

x(t)=a(t)cosϕ(t)E1

with time varying amplitude envelop a(t)and phaseϕ(t). The amplitude and phase have both physically and mathematically meaning.

Most signals include more than one oscillatory mode, so they are not IMFs. EMD is a numerical sifting process to disintegrate empirically a signal into a finite number of hidden fundamental intrinsic oscillatory modes, that is, IMFs.The sifting process can be separated into following steps:

  1. Finding all the local extrema, including maxima and minima; then connecting all the maxima and minima of signal x(t) using smooth cubic splines to get its upper envelopexup(t)and lower envelopexlow(t).

  2. Subtracting mean of these two envelopes m1(t)=(xup(t)+xlow(t))/2from the signal to get their difference:h1(t)=x(t)m1(t).

  3. Regarding theh1(t)as the new data and repeating steps 1 and 2 until the resulting signal meets the two criteria of an IMF, defined asc1(t). The first IMF c1(t)contains the highest frequency component of the signal. The residual signalr1(t)is given byr1(t)=x(t)c1(t).

  4. Regarding r1(t)as new data and repeating steps (1) (2) (3) until extracting all the IMFs. The sifting procedure is terminated until the Mth residue rM(t)becomes less than a predetermined small number or becomes monotonic.

The original signal x (t) can thus be expressed as following:

x(t)=j=1Mcj(t)+rM(t)E2

cj(t)is an IMF where j represents the number of corresponding IMF and rM(t)is residue.

The EMD decomposes non-stationary signals into narrow-band components with decreasing frequency. The decomposition is complete, almost orthogonal, local and adaptive. All IMFs form a completely and “nearly” orthogonal basis for the original signal. The basis directly comes from the signal which guarantees the inherent characteristic of signal and avoids the diffusion and leakage of signal energy. The sifting process eliminates riding waves, so each IMF is more symmetrical and is actually a zero mean AM-FM component.

Figure 2.

A classical IMF

The major disadvantage of EMD is the so-called mode mixing effect. For example, the simulated signal is defined as follows:

s(t)=sin(2×π×t)+10×w(t)*δ(tn)(n=...,2,1,0,1,2,...)w(t)={t0.20.015×m,0.2+0.03×m<t<0.215+0.03×m0.215+0.015×mt,0.215+0.03×m<t<0.23+0.03×mm=0,1,2,3E3

The signal is composed of sine wave and impulse functions, shown as figure3.It is decomposed into a series of IMFs by EMD, illustrated as figure 4. The decomposition is polluted by mode mixing, which indicates that oscillations of different time scales coexist in a given IMF, or that oscillations with the same time scale have been assigned to different IMFs.

Figure 3.

Simulated signal

Figure 4.

IMFs obtained by EMD

3. Ensemble empirical mode decomposition

Ensemble EMD (EEMD) was introduced to remove the mode-mixing effect. The EEMD overcomes largely the mode mixing problem of the original EMD by adding white noise into the targeted signal repeatedly and provides physically unique decompositions when it is applied to data with mixed and intermittent scales.

The EEMD decomposing process can be separated into following steps:

1. Add a white noise seriesw(t)to the targeted datax(t), the noise must be zero mean and variance constant, soX(t)=x(t)+w(t).

2. Decompose the data with added white noise into Intrinsic Mode Functions (IMFs) and residue rn

X(t)=j=1ncj+rnE4

3. Repeat step 1 and step 2 N times, but with different white noise serried wi(t) each time, so

Xi(t)=j=1ncij+rinE5

4. Obtain the ensemble means of corresponding IMFs of the decompositions as the final result. Each IMF is obtained by decomposed the targeted signal.

cj=1Ni=1NcijE6

This new approach utilizes the full advantage of the statistical characteristics uniform distribution of frequency of white noise to improve the EMD method. The above signal is decomposed into a series of IMFs by EEMD, which is shown in figure 5. Through adding white noise into the targeted signal makes all scaled continues to avoid mode mixing phenomenon. Comparing the IMF component of the same level, EEMD has more concentrated and band limited components.

Figure 5.

IMFs obtained by EEMD

We consider the following model of a discrete noisy signal:

x=θ+σzE7

The vector xrepresents noisy signal and θis an unknown original clean signal. zis independent identity distribution Gaussian white noise with mean zero and unit variance. For simplicity, we assume intensity of noise is one. The step of wavelet shrinkage is defined as follows:

  1. Apply discrete wavelet transform to observed noisy signal.

  2. Estimate noise and threshold value, thresholding the wavelet coefficients of observed signal.

  3. Apply the inverse discrete wavelet transform to reconstruct the signal.

The wavelet shrinkage method relies on the basic idea that the energy of signal will often be concentrated in a few coefficients in wavelet domain while the energy of noise is spread among all coefficients in wavelet domain. Therefore, the nonlinear shrinkage function in wavelet domain will tend to keep a few larger coefficients over threshold value that represent signal, while noise coefficients down threshold value will tend to reduce to zero.

In the wavelet shrinkage, how to select the threshold function and how to select the threshold value are most crucial. Donoho introduced two kinds of thresholding functions: hard threshold function and soft threshold function.

δλH(x)={0|x|λx|x|>λE8
δλS(x)={0|x|λxλx>λx+λx<λE9

Hard threshold function (8) results in larger variance and can be unstable because of discontinuous function. Soft threshold function (9) results in unnecessary bias due to shrinkage the large coefficients to zero. We build the generalized threshold function:

δλm(x)=xλmxm1m=12E10
λis threshold value.

When m is even number:

δλm(x)=xxI(|x|λ)λmxm1I(|x|>λ)E11

When m is odd number:

δλm(x)=xxI(|x|λ)λmxm1I(|x|>λ)sign(x)E12

When m=1, it is soft threshold function; when m=, it is hard threshold function. When m=2 it is Non-Negative Garrote threshold function. We show slope signal as an example, Figure.6 graphically shows generalized threshold functions for different m. It can be clearly seen that when the coefficient is small, the smaller m is, the closer the generalized function is to the soft threshold function; when the coefficient is big, the bigger m is, the closer the generalized function is to the hard threshold function. As1<m<, generalized threshold function achieves a compromise between hard and soft threshold function. With careful selection of m, we can achieve better denoising performance.

Figure 6.

Generalized threshold function

We derived the exact formula of mean, bias, variance andl2risk for generalized threshold function.

Let

xN(θ,1)Am(θ)=λϕ(xθ)ϕ(x+θ)xmdxBm(θ)=λϕ(xθ)+ϕ(x+θ)xmdx

ϕandΦare density and probability function of standard Gaussian random variable respectively. Then:

Mean:

Mm(λ,θ)=MH(λ,θ)λmAm1(θ)E13

Bias:

SBm(λ,θ)=(Mm(λ,θ)θ)2E14

Variance:

Vm(λ,θ)=VH(λ,θ)2λmBm2(θ)λ2mAm12(θ)+λ2mB2m2(θ)+2λmMH(λ,θ)Am1(θ)E15

l2Risk:

ρλm(θ)=E(δλm(x)θ)2=ρλH(θ)2λmBm2(θ)+λ2mB2m2(θ)+2θλmAm1(θ)E16

Where

MH(λ,θ)=θ+θ[1Φ(λθ)Φ(λ+θ)]+ϕ(λθ)ϕ(λ+θ)ρλH(θ)=1+(θ21)(Φ(λθ)Φ(λθ))+(λ+θ)ϕ(λ+θ)+(λθ)ϕ(λθ)

Mm(λ,θ),SBm(λ,θ),Vm(λ,θ),ρλm(θ)are the mean, bias, variance and risk of generalized threshold function When m is 1, 2, , they are the mean, bias, variance and risk of the risk of soft, Non-Negative Garrote, hard threshold functions, respectively.

Soft threshold function provides smoother results in comparison with the hard threshold function; however, the hard threshold function provides better edge preservation in comparison with the soft threshold function. The hard threshold function is discontinuous and this leads to the oscillation of denoised signal. Soft threshold function tends to have bigger bias because of shrinkage, whereas hard threshold function tends to have bigger variance because of discontinuity. Non-Negative Garrote threshold function is the trade-off between the hard and soft threshold function. Firstly it is continuous; secondly the shrinkage amplitude is smaller than the soft threshold function.

5. Adaptive threshold values based on EEMD

Threshold value is a parameter that controls the bias and vriance tradeoff of the risk. If it is too small, the estimators tend to overfit the data, then result is close to the input and the estimate bias is reduced but the variance is increased. If the threshold value is too large, a lot of wavelet coefficients are set zero and the estimators tend to underfit the data; the estimate variance is reduced but the bias is increased. The optimal threshold value is the best compromise between variance and bias and it should minimize the risk of the results as compared with noise-free data.

Several methods have been proposed for the determinations of threshold values. The universal threshold, proposed by Donoho and Johnstone, uses the fixed form threshold equal to the square root of two times the logarithm of the length of the signal. LDT, the level dependent threshold, proposed by I.M.Johnstone, and B.W.Silverman, uses a different threshold for each of the levels based on a single formula. Stein Unbiased Risk Estimate (SURE) is an adaptive threshold selection rule. It is data driven and the threshold value minimizes an estimate of the risk. Other threshold values include minimaxi threshold etc. In this paper, an adaptive threshold method is proposed based on EEMD. The threshold values directly relate to the energy of noise on each IMFs. Next, the derivation of adaptive threshold values is initiated by the characteristic of Fractional Gaussian noise (fGn).

fGn is a generalization of white noise. The statistical properties of fGn are controlled by a single parameter H, and the autocorrelation sequence

rH(k)=E(XH,iXH,i+k)E17

This can also be defined as:

rH[k]=σ22(|k1|2H2|k|2H+|k+1|2H)E18

σ2is the variance of fGn. The value of H is in the range of 0 to 1. The Fourier transform of (18) gives the power spectral density of fGn:

SH(f)=Cσ2|ei2πf1|2k=1|f+k|2H+1E19

In the decomposing of a given fGn, EMD is worked as a dyadic filter. Restricting to the band-pass IMFs, self-similarity would mean that

Sk',H(f)=ρHα(k'k)Sk,H(ρHk'kf)k'>k2E20

Given the self-similar relation (6) for PSDs for band-pass IMFs we can deduce how the variance should evolve as a function of k:

VH[k']=ρH(α1)(k'k)VH[k]k'>k2E21

VH[k]is the variance of the IMF index.

According to lots of simulation:

log2(log2(TH[k]/WH[k]))=aHk+bHE22

WH[k]denotes the H-dependent variation of the IMF energy. In practice, WH[1]can be estimated from (23), which also gives the model energy of the noisy signal

W^H[1]=n=1Nc12(n)E23

c1represents the first IMF coefficients.

According to (21)

VH[k]=CHρH2(H1)kk2E24

CH=W^H[1]/βH,the parameter H andβHare given in table 1. Through (25) we can obtain the model energy of noise only signal.

H0.20.50.8
βH0.4870.7191.025

Table 1.

H andβH

According to the relationship between energy and variance WH[k]are given by

W^H[k]=CHρH2(1H)kk2E25

For white noise,

H=12  ,  βH=0.719E26
ρH=[2.01+0.2(H12)+0.12(H12)2]=2.01E27

The energies of each IMFs can be defined as:

Vk=σn20.7192.01k,k=2,3,4...E28

σn2is the noise energy that can be achieved by the first IMF variance, which can be achieved by (23).

The adaptive threshold value of each IMF can be identified as:

Tk=VkN2lnN,k=2,3,4...E29

N is the length of signal.

Given these results, a possible strategy for de-noising a signal (with a known H) is generalized as follows:

  1. Decompose the noisy signal into IMFs with EEMD.

  2. Assuming that the first IMF captures most of the noise, estimate the noise level in the noisy signal by computingVkfrom (28).

  3. Discarding the first IMF, for other IMFs, calculate the adaptive threshold value Tkfrom (29); shrink the coefficients using the Non-Negative Garrote threshold function.

  4. Reconstruct the signal by the shrunken IMFs, obtain the denoised signal.

Figure 7.

The block diagram of the denoising algorithm

6. Results and discussions

To evaluate the performance of the algorithm, Test signal and Clinic noisy ECG signals are processed.

6.1. Test signal

We choose time shifted sine signal which shapes similarly to ECG to test above method; Gaussian White Noise is added as noise, which is zero mean and standard deviation change with the SNR.SNR=10log(var(signal)/var(noise)), var means standard deviation. The SNR of noisy test signals are 5. Figure8 shows the original clean signal; figure9 shows the noisy signal; figure10 shows the denoised signal by the above algorithm, the SNR of which achieve 14. Furthermore, the original characteristic waveform is preserved.

Figure 8.

The clean time shifted sine signal

Figure 9.

The noisy time shifted sine signal

Figure 10.

The denoised time shifted sine signal

6.2. Clinical noisy ECG signal

The ECG signal as Figure.11 illustrates comes from clinical patient. Signal is sampled at 360 Hz; signal length is 1500; the ECG signal is corrupted by noise. Figure12 shows its phase space diagram, which is a plot of the time derivative of the ECG signal against the ECG signal itself. The derivative can accentuate the noisy and high frequency content in signal, so it can better show dramatic improvement after denoising. The noisy ECG signal is processed using the method mentioned above. For the generalized threshold function, m is selected as 2, which is Non-Negative Garrote threshold function. The noisy ECG signal is decomposed into a series of IMFs by EEMD. The first seven IMFs are shown in figure13; the latter seven IMFs are shown in figure 14.The First IMF is discarded owing to predominant noise. Obtain the adaptive threshold value of each IMFs by formula (29). The values are 0.0422, 0.0297, 0.0210, 0.0148, 0.0104, 0.0074, 0.0052, 0.0037, 0.0026, 0.0018, 0.0013, 0.0009, 0.0006. Then shrink the coefficients of each IMFs by the adaptive threshold values and Non-Negative Garrote threshold function. The first shrunken six IMFs are shown in figure15; the latter shrunken seven IMFs are shown in figure16. Reconstruct the signal by the shrunken 13 IMFs and obtain the denoised signal. The filtered ECG signal is illustrated as figure17. The phase space diagram of filtered ECG signal is shown as figure 18. From visual inspection, the ECG signal is much cleaner after being denoised; the original characteristic waveform, especially the sharp Q, R, and S peaks is preserved, without distorting the P and T waves.The results indicate that the method we have proposed significantly reduces noise and well preserves the characteristics of ECG signal.

Figure 11.

Noisy ECG signal

Figure 12.

Phase space diagram of noisy ECG signal

Figure 13.

The first seven IMFs

Figure 14.

The latter seven IMFs

Figure 15.

The first shrunken six IMFs

Figure 16.

The latter shrunken seven IMFs

Figure 17.

The denoised ECG signal

Figure 18.

The Phase space diagram of denoised ECG signal

Another ECG signal as Fig.19 illustrates comes from clinical patient. Signal is sampled at 360 Hz. Length is 1500; the ECG signal is corrupted by noise. Figure20 shows its phase space diagram. The filtered ECG signal is illustrated as figure 21 using the above algorithm. The phase space diagram of filtered ECG signal is shown as figure 22. It is obvious that the noise is reduced.

Figure 19.

The noisy ECG signal

Figure 20.

Phase space diagram of noisy ECG signal

Figure 21.

The denoised ECG signal

Figure 22.

Phase space diagram of the denoised ECG signal

7. Conclusion

In this paper, the adaptive noise removal scheme based EEMD is studied for ECG signal. EEMD reduces the mode mixing existing in EMD. Better filtering performance for EEMD is achieved. The adaptive threshold values guarantee the better estimation of noise. We have demonstrated that the algorithm is useful for removing noise from clinic ECG signal. It not only decreases the signal noise, but also the ECG waveform is better conserved. Application of EEMD with adaptive threshold value also has potential for other biomedical signals or other fields.

Acknowledgments

This work was supported in part by the public welfare Program of Zhejiang Province Science and technology department under the Grant: 2010C31022.

© 2011 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike-3.0 License, which permits use, distribution and reproduction for non-commercial purposes, provided the original is properly cited and derivative works building on this content are distributed under the same license.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Zhao Zhidong, Luo Yi and Lu Qing (July 5th 2011). Adaptive Noise Removal of ECG Signal Based On Ensemble Empirical Mode Decomposition, Adaptive Filtering Applications, Lino Garcia, IntechOpen, DOI: 10.5772/16263. Available from:

chapter statistics

2833total chapter downloads

2Crossref citations

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

Application of Adaptive Noise Cancellation in Transabdominal Fetal Heart Rate Detection Using Photoplethysmography

By Kok Beng Gan, Edmond Zahedi and Mohd. Alauddin Mohd. Ali

Related Book

First chapter

Convergence Evaluation of a Random Step-Size NLMS Adaptive Algorithm in System Identification and Channel Equalization

By Shihab Jimaa

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us