Vous êtes sur la page 1sur 5

Performance Study of Adaptive Filtering Algorithms for Noise Cancellation of ECG Signal

Electronics & Communication Engineering1,2,3, Electrical Electronic and system Engineering4 Universiti Tenaga Nasional (UNITEN), Malaysia 1,2,3, National University of Malaysia (UKM)4 E-mail:zahurul2003_du@yahoo.com1,Zahidul@uniten.edu.my2,Razali@uniten.edu.my3, mama@vlsi.eng.ukm.my4

Syed Zahurul Islam1, Syed Zahidul Islam2, Razali Jidin3, Mohd. Alauddin Mohd. Ali4

Abstract Removal of noises from ECG (Electrocardiogram) signal is a classical problem. Moreover, nullifying AC and DC noises using the two adaptive algorithms-the LMS and the RLS from the ECG is a new study in biomedical science. In this paper, the four types of AC and DC noises have been implemented according to their basic properties. After that, these noises have been mixed with ECG signal and nullify these noises using the LMS and the RLS algorithms. At the end of this paper, a performance study has been done between these algorithms based on their parameters and also discussed the effect of filter length and the corresponding correlation coefficient. Results indicate that the DC bias noises cannot be handled by the LMS filtering whereas the RLS can handle both types of noises. Also, it is true for both algorithms that the filter length is proportional to MSE (Mean Square Error) rate and it takes more time to converge for both algorithms. Furthermore, most of the cases the RLS has achieved best effective noise cancellation performance although its convergence time is slightly high. But eventually its error has always dipped down below that of the LMS algorithm. Keywords- ECG signal; LMS and RLS algorithms; AC and DC Noises

sequence d(n) is the desired signal. The output y(n) is generated as a linear combination of the delayed samples of the input sequence x(n), according to (1), (1) where N is the filter length, wi(n) are the filter tap weights (coefficients) that vary in time and are controlled by the adaptation algorithm, x(ni) for i=0,1,.,N-1 are the input samples being referred to as filter tap inputs. The Least Mean Squares (LMS) algorithm and the Recursive Least Squares (RLS) algorithm are used in adaptive filters to find the filter coefficients that relate to producing the least mean squares of the error signal (difference between the desired and the actual signal). The LMS and the RLS adaptive filter written with use of MatLab functions designed to remove the contaminating signal, as shown in Fig. 1. The ECG signal, s is the original uncontaminated input signal of program. The desired output is the contaminated ECG signal t. The Adaptive Filter will do its best to reproduce this contaminated signal but it only knows about the original 60 Hz noise source, v. Thus, it can only reproduce the part of t that is linearly correlated with v, which is m. In effect, the Adaptive Filter will attempt to mimic the noise path filter, so that the output of the filter a will be close to the contaminating noise m. In this way the error e will be close to the original uncontaminated ECG signal s. We call (s+m) the primary input and a is be the reference signal. Since the Adaptive Filter output is a and the error is e, then the mean square error (MSE) is (2).
i=0

y (n) =

N 1

w i( n ) x ( n i )

I.

INTRODUCTION

Studies show that ECG signals are probably deterministic chaotic process [1,2,3]. It is also a non-invasive test that records the electrical activity of the heart over time and it is very useful in determining whether a person has heart disease, for example a cardiac arrhythmia[4,5]. In recording a heart beat (an ECG), which is being corrupted by a 50 Hz noise (the frequency coming from the power supply in many countries) [6]. One way to remove the noise is to filter the signal with a notch filter at 50 Hz. However, due to slight variations in the power supply to the hospital, the exact frequency of the power supply might (hypothetically) wander between 47 Hz and 53 Hz. A static filter would need to remove all the frequencies between 47 and 53 Hz, which could excessively degrade the quality of the ECG since the heart beat would also likely have frequency components in the rejected range. To circumvent this potential loss of information, an adaptive filter has been used. The adaptive filter would take input both from the patient and from the power supply directly and would thus be able to track the actual frequency of the noise as it fluctuates. Such an adaptive technique generally allows for a filter with a smaller rejection range, which means, in our case, that the quality of the output signal is more accurate for medical diagnoses. The most commonly used structure in the implementation of adaptive filters is the transversal structure. In this case, the adaptive filter has a single input, x(n) and an output y(n). The

e2 = ((s+m) a)2 = (s+m)2 2 (s+m)a+a2 = (m-a)2 + s2 + 2sm 2sa (2)

Figure 1. Noise cancellation

Since signal and noise are uncorrelated, the MSE would be like (3). E[e]2 = E [(m-a)2] + E [s2] (3) Minimizing the MSE results in a filter error that is the best least squares estimate of the signal s. The Adaptive Filter extracts the signal, or eliminates noise, by iteratively minimizing the MSE between the primary and the reference inputs [7].

978-1-4244-4657-5/09/$25.00 2009 IEEE

ICICS 2009

The ECG signals, in their acquisition process, are affected by various types of noise, such as Power Line Interference, Electrode Contact Noise, Motion Artifacts, Muscle Contraction, Base Line Drift, Instrumentation Noise generated by electronic devices and Electrosurgical Noise [8]. But, it is discussed four major types of noises (Power line interference, Motion artifacts, Muscle contraction and Base line drift) and implemented according to their properties. Power Line Noise consists (Fig. 2-a) of 50-60Hz pickup and harmonics, which can be modeled as sinusoids. Characteristics, which might need to be varied in a model of Power Line Noise, of 60Hz component include the amplitude and frequency content of the signal. The amplitude varies up to 50 percent of the peak to peak ECG amplitude. It is shown in Fig. 3-b where power signal is affecting the signal between 1000 to 3000 units of time [8]. Motion artifacts are transient base line changes caused by changes in the electrode-skin impedance with electrode motion. As this impedance changes, the ECG amplifier sees different source impedance which forms a voltage divider with the amplifier input impedance therefore the amplifier input voltage depends upon the source impedance, which changes as the electrode position changes. The usual cause of motion artifacts has been assumed to be vibrations or movements of the subjects. The peak amplitude and duration of the artifact are variable, as illustrated in Fig. 2-b. This type of interference represents an abrupt shift in base line due to movement of the patient while the ECG is being recorded. It is simulated by adding a DC bias for a given segment of ECG [8]. Muscle contractions cause artifactual milli-volt level potentials to be generated. This type of noise is induced by the patients movement and therefore is usually insignificant. It is simulated by adding random noise to the ECG signal (Fig. 2-c). The maximum noise level is formed by adding random single precision numbers of 50% of the ECG maximum amplitude to the uncorrupted ECG [8]. The meaning of Base Line Drift noise is continuous drifting of ECG signal from base line. The drift of the base line with respiration can be represented by a sinusoidal component at the frequency of respiration added to the ECG signal. The amplitude and the frequency of the sinusoidal component should be variables [8]. The variations could be reproduced by amplitude modulation of the ECG by the sinusoidal component added to the base line shown in Fig. 2-d.

The paper is organized as follows. In section 2, we present simulation regarding mixing noises with ECG signal and nullifying it using adaptive algorithms. In section 3, based on their convergence property, computational time and filter length, performance analysis of the LMS and the RLS has been illustrated. Section 4 is dedicated for the discussion on the effect of filter length and correlation coefficient of the LMS and the RLS. And finally, conclusion is presented in section 5.

II.

SIMULATION RESULTS

In the simulation section, it has been generated a noise free ECG signal from an audio file and then mixed the ECG signal with four types of noises. And after that, the LMS and the RLS algorithms have been used to nullify these noises. The whole steps are illustrated in the Fig. 3(a-m).

(a)

(b)

(c)

(d)

(a)

(b)

(e)

(f)

(c)

(d)

(g)

(h)

Figure 2. (a)- Power Line interference, (b)- ECG signal with Motion Artifacts (c)- Noises for Muscle Contraction, (d)- ECG signal with Base Line Drift

The aim of this paper is to eliminate the noises from the ECG signal using two adaptive filtering algorithms -the LMS and the RLS and analyze the performance of these two algorithms on the basis of their different parameters.

algorithm convergences faster than the RLS algorithm. In most of the cases, the LMS is convergences faster than the RLS for removing the Power Line Interference. If we look back to Fig. 3(c) and Fig. 3(d), it will be clear to us how both algorithms converge.

(i)

(j)

Figure 4. Convergence property of Power Line Interference

(k)

(l)

On the other hand, the Muscle Contraction Noise is a very small and negligible noise with a very small range. Moreover, it has a small effect over the original EGG signal. In Fig. 5, both the RLS and the LMS work for eliminating the Muscle Contraction Noise but they are converging in a similar fashion. The differences between original ECG signal and output-filtered ECG signal is very small as well as insignificant.

(m) Figure 3. (a)- Complete noise free ECG signal taken from wav file, (b)- ECG signal corrupted with Power Line Noise, (c)- Power Line Noise removed using the RLS, (d)- Power Line Noise removed using the LMS, (e)- ECG signal corrupted with Muscle Contraction, (f)- Muscle Contraction Noise free using the RLS, (g)- Muscle Contraction Noise free using the LMS, (h)- ECG signal with Motion Artifact, (i)- ECG signal free from Motion Artifact Noise by the RLS, (j)- ECG signal free from Motion Artifact Noise by the LMS, (k)- Base Line Drift of ECG signal, (l)- Base Line Drift free signal using the RLS, (m)Base Line Drift free signal using the LMS

Figure 5. Convergence property of Muscle Contraction

III.

PERFORMANCE ANALYSIS OF THE LMS AND THE RLS ALGORITHMS

Therefore, we have experimented that, only the RLS algorithm works for canceling the Motion Artifact Noises. If we use the LMS algorithm, the ECG signal will be totally distorted. The simulation of Motion Artifact is done by a DC bias signal and the LMS algorithm cannot handle any DC bias noise. Only the RLS algorithm can grip the DC noise signal. Fig. 6(right) shows the convergence nature of Motion Artifact to a noise free ECG signal by using the RLS algorithm.

The principle means of comparison is the error cancellation capability of the methods. This property depends on a few parameters, such as: step size (for the LMS), forgetting factor (for the RLS) and filter length (for both the LMS and the RLS). Another obvious measurement is the performance of computational time. In order to compare the noise cancellation capabilities between the two algorithms, two methods of presentation have been shown. One of them is the plotting of error with number of samples. Error characteristics of both algorithms have been shown on the same graph to attain visual comparison. In doing the comparison, we have put one sample per thousand in X-axis and the difference between the original noiseless signal and filtered output signal has been put in the Y-axis. The analytical graphs have been shown in the subsequent pages. Both the LMS and the RLS algorithms work for cancellation of Power Line Interference mixing with the original ECG signal. As the noise is generated in a random fashion, some of the graphs of chapter 2 may vary. If we look into Fig. 4, it can be seen that the LMS

Figure 6. Convergence property of - Base Line Drift Noise (left) and Motion Artifact Noise (right)

The same thing goes for Base Line Drift Noise and so it cannot be handled by the LMS algorithm. In Fig. 6(left), it is shown the convergence nature of base line drift to a noise free ECG signal using the RLS algorithm.

Comparison of Computation Time

Computation time is another important factor for performance analysis of the LMS and the RLS algorithms. In this sub-section, the computation times of the both algorithms for four different signals have been presented in tabular and graphical form.
TABLE I. COMPARISON TABLE OF THE COMPUTATION TIME OF THE LMS AND THE RLS FOR A MUSCLE CONTRACTION AND POWER LINE INTERFERENCE WHERE FILTER LENGTH IS VARIED Filter Length Computation time (sec) Muscle Contraction
LMS RLS

Figure 7. Comparison graph of computation time-Muscle Contraction (top-left), Power Line (top-right), Base Line (bottom-left), Motion Artifacts (bottomright)

Effect of Filter Length on the Performance of the LMS and the RLS
Filter length refers to the number of coefficients of the filter. This number is significant in case of performance analysis. In this research, several signals have been analyzed by varying the length of the filter and keeping all other attributes unchanged. Fig. 8 as well as Fig. 9 shows variations in the convergence behavior of the LMS algorithm for Power Line Interference and Base Line Drift of original ECG signals. In both cases, the step size has been kept fixed on a value that is one tenth of the maximum step size. The filter order has been changed and error cancellation performance has been shown in the experiments.

Computation time (sec) Power Line Interference


LMS RLS

10 20 30 40 50 60

0.2030 0.2040 0.1880 0.2190 0.2040 0.2340

0.3750 0.4060 0.5000 0.6090 1.0780 1.4060

0.1720 0.1870 0.2030 0.2030 0.2030 0.2040

0.4060 0.4220 0.4840 0.5940 0.7350 1.4220

Both the LMS and the RLS algorithm work for Power Line Interference and Muscle Contraction. In addition, only the RLS graph is shown in Fig. 7 (bottom-right and bottom-left) for Motion Artifact and Base line Drift respectively. We can see from Fig. 7 and Table 1 and Table 2, the computation time for the LMS algorithm increases slightly with the variation in filter length. But for the RLS, the computation time increases quite significantly and steadily as filter length increases.
TABLE II. COMPARISON TABLE OF THE RLS FOR MOTION ARTIFACTS AND BASE LINE DRIFT (VARIED FILTER LENGTH) Filter length Computation time The RLS (sec)
Motion Artifacts Base Line Drift

Figure 8. Convergence of the LMS for different filter lengths on the same signal (Power Line Interference)

In the beginning, small filter length convergences faster and the difference of error is initially smaller. But it is not fixed in for all cases since the interference is random and it may vary time to time. Observing several cases, we have noticed that the larger value of filter length convergences slower and the differences of error are higher.

10 20 30 40

1.7810 2.0320 2.3600 2.9220

1.7810 2.0160 2.4530 2.9070

Figure 9. Convergence of the LMS for different filter lengths on the same signal (Muscle Contraction)

ef fect on com pu tat ion tim e fo r differ ent filte r le ngt hs( bas e line d rift )
3.5 3 computation time
computation time

effect on co m p uta tion tim e for differe nt filte r le ngths(m o tion artifa ct)
3.5 3 2.5 2 1.5 1 0.5 0 RLS

2.5 2 1.5 1 0.5 0 0 20 40 60 filte r len g th R LS

10

20

30

40

50

filter leng th

From Fig. 10 to Fig. 12, it is shown the variations in the convergence behavior of the RLS algorithm for Power Line Interference, Muscle Contraction, Motion Artifact and Base line Drift signals. In all cases, all other parameters of the algorithm have been kept fixed where the filter order has been changed. The changing of filter length affects on Power Line Interference and Muscle Contraction. But for Motion Artifact and Base line Drift, filter length has very minor effect on the convergence procedure. We have already mentioned the reason is that Motion Artifact and Base Line Drift are both simulated by a DC bias signal of different types. For this reason, in spite of changing the filter length, the convergence graph is insignificantly varied.

TABLE III. COMPARISON TABLE OF THE RLS AND THE LMS FOR DIFFERENT FILTER LENGTHS AND THE CORRESPONDING CORRELATION COEFFICIENTS Filte r Len gth Correlati on coefficie nts of Power Line Interfere nce RLS Correlati on coefficie nts of Muscle Contract ion RLS Correlat ion coeffici ents of Motion Artifact RLS Correlat ion coeffici ents of Base Line Drift RLS Correlat ion coeffici ents of Power Line Interfer ence LMS Correlati on coefficie nts of Muscle Contract ion LMS

Figure 10. Convergence of the RLS for different filter lengths on the same signal (Muscle Contraction Noise)

10 20 30 40

0.9996 0.9993 0.9987 0.9980

0.9991 0.9982 0.9969 0.9954

0.9912 0.9900 0.9906 0.9893

0.9918 0.9914 0.9904 0.9905

0.9981 0.9975 0.9973 0.9970

0.9996 0.9993 0.9987 0.9980

V.
Figure 11. Convergence of the RLS for different filter lengths on the same signal (Power Line Interference)

CONCLUSION

This study has revealed useful properties of the LMS and the RLS algorithms in case of adaptive noise cancellation. It has been found that the RLS algorithm generally performs better irrespective of the nature of the signal and the noise. The RLS is particularly useful in the case of signals where abrupt changes of amplitude or frequency may occur such as DC noises. But this better-quality performance comes at a price: The RLS takes more time to compute, especially when the filter length is large. But change in filter length doesnt have too much effect on the convergence behavior of the RLS. For the LMS, this increase is quite substantial. In the end, it can be stated that the RLS algorithm should be preferred over the LMS for adaptive noise cancellation unless the computation time is a matter of great concern.

Figure 12. Convergence of the RLS for different filter lengths- Motion Artifact (left), Base Line Drift (right)

REFERENCES
[1] R. B. Govindan, K. Narayanan, and M. S. Gopinathan, On the evidence of deterministic chaos in ECG: Surrogate and predictability analysis, Chaos, vol. 8, no. 2, pp. 495502, 1998. [2] H. Kantz and T. Schreiber, Human ECG: Nonlinear deterministic versus stochastic aspects, Inst. Elect. Eng. Proc. Sci. Meas., Technol., vol. 145, no. 6, pp. 279284, 1998. [3] Z. Z. Wang, X. B. Ning, Y.Zhang and G.H. Du, Nonlinear dynamic characteristics analysis in synchronous 12-lead signal, IEEE EMB Magazine, Vol. 19, No. 5, pp. 110-115, 2000. [4] C.Stolojescu, Estimation de contexte de bruit par filtrage en ondelettes, Diploma Project, 2007 [5] L.Senhadji, Approche multiresolution pour lanalyse de signaux non stationnaires, PhD Thesis, 1993 [6] http://en.wikipedia.org/wiki/Adaptive_filter, 2009 [7] Investigation of Adaptive Filtering for Noisy ECG Signals, Nian Zhang, Bernt Askildsen, and Brian T. Hemmelman, 1-4244-0166-6/06/$20.00 2006 IEEE [8] Jamshaid K., Akram O., Sabir F., Shah I. and Ahmed J., Application of Adaptive and Non Adaptive Filter in ECG Signal Processing [9] http://www2.chass.ncsu.edu/garson/PA765/correl.htm, accessed 2008

IV. EFFECT OF FILTER LENGTH AND THE CORRESPONDING CORRELATION COEFFICIENTS ON THE LMS AND THE RLS
Correlation is a bivariate measure of association (strength) of the relationship between two variables. It varies from 0 (random relationship) to 1 (perfect linear relationship) or -1 (perfect negative linear relationship). It is usually reported in terms of its square (r2), interpreted as percent of variance explained. For instance, if r2 is 0.25, then the independent variable is said to explain 25% of the variance in the dependent variable [9].The higher the value of correlation coefficients (more near to 1) the more similar the signal with respect to each other. This indicates the closer the value of correlation coefficients to 1 the ECG signal is more perfectly filtered and output signal is more noiseless and free from error. Table 3 illustrates that when filtering some noise patterns have higher value of correlation coefficients on larger filter lengths and some have opposite characteristics and others have random characteristics. We can also easily compare from the above table which algorithm (the LMS or the RLS) is better for specific noise patterns when they are filtered.

Vous aimerez peut-être aussi