Sie sind auf Seite 1von 6

Investigation of Adaptive Filtering for Noise Cancellation in ECG signals

Soroor Behbahani
Biomedical Engineering Department, Science and Research Branch, Islamic Azad University,
Tehran, Iran.
Member of Young Researcher Club of Biomedical Engineering Department, Science and Research
Branch, Islamic Azad University, Tehran, Iran.
soroor_behbahani@yahoo.com
Abstract
New generation of medical treatment has been
supported by computerized processes. Signals recorded
from the human body provide valuable information about
the biological activities of body organs. The organs
characteristic topologies with temporal and spectral,
properties, can be correlated with a normal or
pathological function. In response to dynamic changes in
the behavior of those organs, the signals exhibit time-
varying, non-stationary responses. The signals are
always contaminated by a drift and interference caused
by several bioelectric phenomena, or by various types of
noise, such as intrinsic noise from the recorder and noise
from electrode-skin contact. In this paper we utilize
Adaptive Filters for noise cancellation and analysis ECG
signals.
Keywords: Adaptive Filter, Noise Cancellation, ECG
Signal, Matlab Program
1. Introduction
Biomedical signals like heart wave commonly
change their statistical properties over time tending to be
non-stationary. Unfortunately there is no universal
method to reduce noise because the probability
distributions of noise are different [7, 13].
Noise cancellation is a special case of optimal
filtering which can be applied when some information
about the reference noise signal is available. The noise
cancellation technique has many applications, e.g. speech
processing, echo cancellation and enhancement, antenna
array processing, biomedical signal and image processing
and so on[1-4]. The standard methods of noise
cancellation use only one primary signal [1]. However, in
many applications, especially in biomedical signal
processing, we are able to measure several primary
signals. Often this possibility can help to improve the
performance of noise cancellation procedure. The
standard approach is to make use of several noisy signals
by recording from the same source. This consists of using
a number of noise cancellation systems in parallel with
one primary input to each system [1]. The estimated
signal is obtained by selecting the best one in the sense of
some criterion from the multi-channel output signal [5].
Adaptive Filters are best used in cases where signal
conditions or system parameters are slowly changing and
the filter is to be adjusted to compensate for this change.
The least mean squares (LMS) criterion is a search
algorithm that can be used to provide the strategy for
adjusting the filter coefficients. A number of adaptive
structures have been used for different applications in
adaptive filtering:
1. Noise Cancellation. Figure 1 shows the adaptive
structure modified for a noise cancellation application.
The desired signal d is corrupted by uncorrelated additive
noise n. The input to the adaptive filter is a noise n that is
correlated with the noise n. The noise n could come from
the same source as n but modified by the environment.
The adaptive filters output y is adapted to the noise n.
When this happens, the error signal approaches the
desired signal d. The overall output is this error signal and
not the adaptive filters output y.
Figure 1.Adaptive Filter structure for noise cancellation
2. System Identification. Figure 2 shows an adaptive
filter structure that can be used for system identification
or modeling. The same input is to an unknown system in
parallel with an Adaptive Filter. The error signal e is the
Second International Multisymposium on Computer and Computational Sciences
0-7695-3039-7/07 $25.00 2007 IEEE
DOI 10.1109/IMSCCS.2007.77
144
difference between the response of the unknown system d
and the response of the adaptive filter y. This error signal
is feed back to the adaptive filter and is used to update the
Adaptive Filters coefficients until the overall output y =
d. When this happens, the adaptation process is finished,
and e approaches zero. In this scheme, the Adaptive Filter
models the unknown system.
Figure 2. Adaptive Filter structure for system
identification
The LMS is well suited for a number of applications
including adaptive echo and noise cancellation,
equalization, and prediction. Other variants of the LMS
algorithm have been employed, such as the sign-error
LMS, the sign-data LMS, and the sign-sign LMS.
The LMS algorithm has been quite useful in adaptive
equalizers, telephone cancellers, and so forth. Other
methods, such as the recursive least squares (RLS)
algorithm [6], can offer faster convergence than the basic
LMS but at the expense of more computations.
3. Adaptive predictor. Figure 3 shows an adaptive
predictor structure which can provide an estimate of an
input.
Figure 3. Adaptive predictor structure.
4. Additional structures have been implemented, such
as:
(a) Notch with two weights, which can be used to notch or
cancel/reduce a sinusoidal noise signal. This structure has
only two weights or coefficients. This structure is shown
in Figure 4 .
(b) Adaptive channel equalization used in a modem to
reduce channel distortion resulting from the high speed of
data transmission over telephone channels.
The LMS is well suited for a number of applications,
including adaptive echo and noise cancellation, and
prediction.
Other variants of the LMS algorithm have been employed,
such as the sign-error LMS, the sign-data LMS, and the
sign-sign LMS.
1. For the sign-error LMS algorithm, the equation will be
(1)
where sgn is the signum function,
2. For the sign-data LMS algorithm, the equation will be
(2)
For the sign-sign LMS algorithm, (1) becomes
(3)
2. Adaptive Noise Cancellation
When doctors are examining a patient on-line and want to
review the electrocardiogram (ECG) of the patient in real-
time, there is a good chance that the ECG signal has been
contaminated by a 60-Hz noise source. To allow doctors
to view the best signal that can be obtained, we need to
develop an adaptive filter to remove the contaminating
signal in order to better obtain and interpret the ECG data.
Figure 4. Adaptive predictor structure.
) ( )] ( sgn[ ) ( ) 1 ( k n x n e n w n w
k k

)] ( sgn[ ) ( ) ( ) 1 ( k n x n e n w n w
k k

)] ( sgn[ ) ( sgn ) ( ) 1 ( k n x n e n w n w
k k

145
The LMS adaptive filter written with use of MatLab
functions designed to remove the contaminating signal, as
shown in Fig. 5. 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 the reference signal.
Since the Adaptive Filter output is a and the error is, then the
mean , then the mean square error (MSE) is:
a s sm s a m
a a m s m s a m s e
. . 2 . 2 ) (
). .( 2 ) ( ) ) ((
2 2
2 2 2 2


(4)
Since signal and noise are uncorrelated, the MSE is:

(5)
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 [15].
2.1 The Least Mean Square (LMS) Algorithm
The LMS algorithm is an iterative technique for
minimizing the mean square error (MSE) between the
primary input and the reference signal [14]. The Adaptive
Filter weights are updated by using the LMS algorithm.
The LMS algorithm can be written in matrix notation:

Figure 5. Noise cancellation system
(6)
(7)
Where,
is a set of filter weights at time k, and is the ith
row of the weight matrix. And
is the input vector at time k of the samples from the
reference signal. The error is :
e(k)=t(k)-a(k)=(s(k)+m(k))-a(k)
where t is the desired primary input from the ECG to be
filtered, and a(k) is the filter output that is the best least
squared estimate of t(k). For simplicity, we use a single
sine wave noise source.[15]
3. EXPERIMENTAL RESULTS
3.1 Matlab program
First of all, we must define the noise signal v, the
ECG signal s and the filtered noise m. We will assume:
the ECG signal is a white (uncorrelated from one time
step to the next) random signal, and the noise source is a
60-Hz sine wave. The error signal e is the overall
desired output of the adaptive structure. This error signal
is the difference between the desired signal and additive
noise, and the Adaptive Filters output, a. All sine signals
used are generated with MATLAB as you see below:
fid = fopen();
F2= fread(fid,'bit');
[m,n]=size(F2);
of=F2(::m,);
[ma,nb]=size(of);
of=of';
ecg=of(,:);
t=(:);A1=0.8;
q=rand;
vnoise=A1*sin((2*pi*60*t)+q);
rnoise1 =a*(wgn(,,))/ p;
%a and p are experimental values
ecg=ecg+vnoise+rnoise1';
%noise removing
N=10;mu=0.01;
coeffs=ones(1,N);
ha = adaptfilt.lms(N,mu);
set(ha,'coefficients',coeffs);
] [ ] ) [( ] [
2 2 2
s E a m E e E
) ( ). ( . 2 ) ( ) 1 ( K p k e K W K W
T

) ( . 2 ) ( ) 1 ( k e k b k b
T k w k w k w
i K W ] 2 1 [ ) (
) ( )... ( ) (

T k p k p k p T
i k P ] 2 1 [ ) (
) ( )... ( ) (

146
noise1=rnoise1+vnoise';
[y,e] = filter(ha,noise1,ecg);
3.2 Matlab Simulations and results
In first experiment, MIT-BIH Arrhythmia Database data
were used as the input: reference annotation (106.atr),
data file (106.dat), and header file (106.hea).The result is
shown in Fig. 6. In the second experiment, MIT-BIH
Arrhythmia Database data were used as the input:
reference annotation (220.atr), data file (220.dat), and
header file (220.hea). The result is shown in Fig. 7. , In
the third experiment, MITBIH Arrhythmia Database data
were used as the input:reference annotation (202.atr), data
file (202.dat), and header file (202.hea).The result is
shown in Fig. 8 and In the fourth experiment, MITBIH
Arrhythmia Database data were used as the input:
reference annotation (116.atr), data file (116.dat), and
header file (116.hea).The result is shown in Fig. 9. In all
result figures, the first signal is the original ECG,
thesecond is ECG+noise, and the third signal is adaptive
filter result.
Figure 6. First experiment, MIT-BIH Arrhythmia, data
file 106.dat
0 100 200 300 400 500 600 700 800 900 1000
-2
-1.5
-1
-0.5
0
0.5
1
ORIGINAL ECG
time
0 100 200 300 400 500 600 700 800 900 1000
-4
-2
0
2
4
ECG + NOISE
time
0 100 200 300 400 500 600 700 800 900 1000
-3
-2
-1
0
1
2
adap.filter result
time
Figure 7. First experiment, MIT-BIH Arrhythmia, data
file 106.dat
Figure 8. Third experiment, MIT-BIH Arrhythmia, data
file 200.dat
0 500 1000 1500 2000 2500 3000
-12
-11
-10
-9
-8
-7
ORIGINAL ECG
time
0 500 1000 1500 2000 2500 3000
-14
-12
-10
-8
-6
ECG + NOISE
time
0 500 1000 1500 2000 2500 3000
-12
-11
-10
-9
-8
-7
-6
adap.filter result
time
0 500 1000 1500 2000 2500 3000
-12
-11
-10
-9
-8
ORIGINAL ECG
time
0 500 1000 1500 2000 2500 3000
-13
-12
-11
-10
-9
-8
-7
ECG + NOISE
time
0 500 1000 1500 2000 2500 3000
-13
-12
-11
-10
-9
-8
-7
adap.filter result
time
147
Figure 9. forth experiment, MIT-BIH Arrhythmia, data
file116.dat
4. Conclusions
Adaptive Filtering with LMS algorithm was
simulated and tested for noise cancellation in ECG
signals. As a result, it requires very little computational
power or memory while still maintaining the ability to
handle complex signal processing. We compared this
method with the reliability of the non-fault tolerant
adaptive filters. The experimental results showed the this
program is highly reliable. The non-fault tolerant
Adaptive Filters can not give the right response after the
500th time step. But with using this program, we could
give the best ECG signal whitout losing parts of signal.
Thus the adaptive filter approach as described herein can
be applied to readily remove 60Hz artifact noise while
minimally distorting the true ECG signals.
Reference
[1] B. Widrow and E. Walach, Adaptive Inverse Control,
Prentice-Hall, Inc., S.S.Series, N.J. (1996).
[2] S. Haykin, Adaptive Filter Theory, Englewood Cliffs,
N.J.:Prentice-Hall, Inc., 3rd Edition (1996).
[3] M. Feder, A.V. Oppenheim, E. Weistein, Maximum
likelihoodnoise cancellation using the EM algorithm,
IEEE Trans. onAcoustics, Speech and Signal Processing,
37 (1989) 04-216.
[4] S.A. Billings and C.F. Fung, Recurrent radial basis
functionnetwork for adaptive noise cancellation, Neural
Networks, 8(1995) 273-290.
[5] S.M. Kuo and J. Chen, Multiple-microphone acoustic
echocancellation system with the partial adaptive
process, DigitalSignal Processing: A Review Journal, 3
(1993) 54-63.
[6] R. Chassaing, Digital Signal Processing with C and
theTMS320C30,Wiley, New York,1992.
[7] M. Jansen, Noise reduction by wavelet
thresholding(NewYork, Springer Verlag, 2000).
[8] C. Li, C. Zheng, C. Tai, Detection of ECG
characteristic points using wavelet transforms, IEEE
Trans. on Biomedical Engineering, 42(1), 1995, 21-28.
[9] C. M. Stein, Estimation of the mean of a multivariate
normal distribution, Annals of Statistics 9, 1981, 1135-
1151.
[10] S. G. Mallat, A theory for multiresolution signal
decomposition, the wavelet representation, IEEE,
Transactions on Pattern Analysis and Machine
Intelligence 11, 1989, 674-693.
[11] W. Hrdle, G. Kerkyacharian, D. Picard, A.
Tsybakov, Wavelets, approximation and statistical
applications, Seminaire Paris-Berlin, Paris, sep 1997, 1-
284.
[12] D. Donoho, I. Johnstone, Adapting to unknown
smoothness via wavelet shrinkage, Journal of the merican
Statistical Association 90, 1995, 1200- 1224.
[13] F. Mochimaru, Y. Fujimoto, Y. Ishikawa, Detecting
the fetal electrocardiogram by wavelet theory-based
methods, Progress in Biomedical Research, 7(3), sep
2002, 185-193.
[14] X. Zhou, P. Engler, M.G. Coblentz, Adaptive filter
application in fetal electrocardiography, Fifth Annual
IEEE Symposium on Computer-Based Medical Systems,
pp. 656 662, 1992.
[15] 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.
[16] K. J. Eriksen Non-Distorting Post-Acquisition Line-
Frequency for Evoked Potentials, Proceedings of the
IEEE EMBS 10th Annual International Conference, p.
1168, 1988.
[17] M. Ferdjallah and R. E. Barr Adaptive Digital
Notch Filter Design on the Unit Circle for the Removal of
Ower line Noise from Biomedical Signals, IEEE Trans.
On Biomedical Engineering, vol. 41, no. 6, pp. 529536,
1994.
[18] M. V. Dragosevic, and S. S. Stankovic An Adaptive
Notch Filter with Improved Tracking Properties, IEEE
Trans. Signal Processing, vol. 43, no. 9, pp. 20682078,
1995.
[19] J. G. Proakis, and D. G. Manolakis Digital Signal
Processing, Prentice Hall , 3rd Ed., pp. 343345, USA,
1996.
[20] J. R. Glover Adaptive Noise Canceling Applied to
Sinusoidal Interferences, IEEE Trans. on Acoustics,
0 100 200 300 400 500 600 700 800 900 1000
-1.5
-1
-0.5
0
0.5
1
1.5
ORIGINAL ECG
time
0 100 200 300 400 500 600 700 800 900 1000
-2
-1
0
1
2
3
ECG + NOISE
time
0 100 200 300 400 500 600 700 800 900 1000
-2
-1
0
1
2
adap.filter result
time
148
Speech, and Signal Processing, vol. ASSP-25, no. 6, pp.
484491, 1977.
[21] R. H. Kwong, and E. W. Johnston A Variable Step
Size LMS Algorithm, IEEE Trans. Signal Processing,
vol. 40, no. 7, pp.16331642, 1992.
[22] A. M. Kuzminskiy A Robust Step Size Adaptation
Scheme for LMS Adaptive Filters, IEEE Workshop on
Digital Signal Processing, pp. 3336, 1997.
[23] Adaptive Notch Filter for EEG Signals Based on the
LMS Algorithm with Variable Step-Size Parameter, The
Johns Hopkins University, March 1618, 2005
149

Das könnte Ihnen auch gefallen