You are on page 1of 7

Third 2008 International Conference on Convergence and Hybrid Information Technology

ECG signal De-noising with Signal Averaging and Filtering algorithm


Alka Gautam1, Young-Dong Lee2 and Wan-Young Chung3
1,2
Graduate School of Design & IT, Dongseo University, Busan 617-716, Korea,
3
Division of Electronics, Computer and Telecommunication Engineering, Pukyong National
University, Busan 608-737, Korea
E-mail: 1gautam.alka@gmail.com, 2 ydlee2@gmail.com, 3wychung11@naver.com

Abstract overlaps but when they do, conventional filtering


schemes fails to give good performance. Various
This study uses the signal averaging and filtering filtering techniques have been used by researcher for
method for ECG signal de-noising and R-wave noise filtering of ECG signal; one of the popular
detection with moving minimum slot and maximum techniques is adaptive noise cancellation, where the
point selecting method. Signal averaging and filtering reference signal is accelerometer signal for adaptation
method reduces random noise (major component of and filtering for stress ECG signal [1]. This paper also
EMG noise) in ECG signal and also gives the shows the result from the adaptive filtering and
comparatively good result for baseline wander noise comparison with result from proposed algorithm
cancellation. Signal to noise ratio (SNR) improves in (signal averaging and filtering method). In [3] filter
filtered ECG signal, while signal shape is also remains bank have been used for noise cancellation and ECG
undistorted. Comparative observation of Normal ECG signal enhancement.
and stress ECG (recorded from wearable ubiquitous Signal averaging and filtering is a digital technique
sensor node) is made on basis of heart rate calculation
for separating a repetitive (random) signal from noise
and signal to noise ratio. We conclude that R-wave
without introducing signal distortion. In [2], a novel
detection with moving minimum slot and maximum
algorithm based on signal averaging and filter residue
point selecting method and signal averaging and
filtering method gives the comparatively good result method has been used for filtering.
without signal distortion. This paper introduces the new algorithm for R-wave
detection that is moving slot and maximum point
1. Introduction selecting method and filtering with ECG signal
averaging. In second section R-wave detection
An ECG signal analysis in rest condition i.e. normal algorithm is introduced and third section explains ECG
ECG signal and in stress condition (while exercising, signal averaging and filtering method. In fourth section
bicycling etc.) i.e. stress ECG. Since this maneuver all experimental results and calculations have been
involves significant physical movement and breathing shown and fifth section shows performance evolution
activity, the ECG is contaminated with noises mainly, of proposed algorithm and comparison of adaptive
1) baseline wonder noise due to heavy respiratory filtering. In sixth SNR improvement shows and in
activity, 2) EMG (Electromyogram) noise due to seventh and eighth section conclusion and discussion is
electrical activity of skeletal muscles, 3) electrode presented.
motion artifact due to the physical movement of
electrode that cause changes in the skin-electrode 2. R-wave detection
potential. The frequency range of ECG signal varies
from 0.05-150 Hz and voltage levels of 0.5-4mV, and QRS detection is strongly affected by noise present
EMG signal has frequency range between 1-5000Hz in ECG signal to counter this problem, available
and voltage levels of 0.1-5mV. Thus EMG signal algorithm includes filtering techniques for removing
causes distortion of ECG signal and induces random present noise and improve signal to noise ratio for
noise in it. The spectrum of EMG overlaps the adapting desired performance of proposed algorithm
spectrum of ECG signals hence it is hard to distinguish [4].
the peaks of ECG signal and peaks of noisy signal. In R-wave detection algorithm, we assume
Linear digital filters performs very well when the minimum time slot (k) at which the R-peak comes and
spectra of signal and noise do not significantly then find the maximum point of amplitude in that time

978-0-7695-3407-7/08 $25.00 © 2008 IEEE 401


409
DOI 10.1109/ICCIT.2008.393
slot. implemented wherein the noisy ECGs are time aligned
k=L with the mean or median ECG signal, also the signal
ma _ x j = M AX (x , x
k = slo t
1 2 .... x k ) and noise are uncorrelated and the nature of noise is
random with a mean of zero is true. Then averaging the
Where x1 , x2 , x3 ......xL ,noisy ECG signal and L is signal m times improves the SNR by a factor of m½
is the length of signal. [7].
Figure (1) shows the flow chart of R-wave detection.
For the correct detection we have used two conditions,
first one, if R-R interval is short then reject the R-wave
and if amplitude of R-wave is less than the calculated
threshold point then also need to reject the R-wave.
The aim of the designing algorithm is to achieve high
QRS detection performance in terms of timing
accuracy and reliability.

Figure 2. R-wave detection of stress ECG data.

Signal averaging is based on the some


characteristics of the signal and the noise like, the
signal waveform should be periodic, noise must be
random (not periodic) and uncorrelated with the signal
and the temporal position of each signal waveform
must be accurately known [3].

3.1. 6-point averaging of ECG signal

The n-point arithmetic averaging of signal gives the


Figure 1. Block diagram of R-wave detection. random noise cancellation from the signal. So we use
6-point averaging of ECG signal before and after the
Figure (2), shows that all R-waves are detected QRS complex for removing the random Gaussian noise
successfully although ECG signal contains noise (EMG noise) present only between the R-R waves,
components. The proposed algorithm gives the good therefore we didn’t include QRS complex in averaging
result like other well known algorithm (Pan Tomkins method.
algorithm).
1 N
3. Signal averaging and filtering method yn = ∑ x(n − k + 1)
N k =1
Signal averaging is a technique for combining the 0 ≤ n ≤ L − 1, (1)
signals (images) recorded from various sources. Signal
averaging is used in varies applications to improve
signal-to-noise ratio (SNR) of periodic signal mixed Where L is length of signal and N is the number of
with random Gaussian noise. In cardiology, its main points for averaging. In our case we take 6-point of
application is in the detection of ventricular late ECG signal averaging.
potential [8]. Generally signal averaging technique is

410
402
3.2. Double mean average of ECG signal
All experimental ECG data recorded from wireless
Baseline wander noise is a low-frequency wearable body sensor node (also called Ubiquitous
disturbance, which is not synchronized with QRS wireless sensor node), which contain conductive
complexes, then it is obvious that, the best estimation electrodes in the belt [10]. This is worn on chest of
of baseline wander is a sample mean of ECG signal [6]. patient and properly attached to the body for correct
The mean composite Cmean is determined by signal extraction. ECG test is taken as normal ECG
computing the arithmetic mean of a set of noisy beat. signal and stress ECG signal. Stress ECG signal is
The mean composite is given by: measured on tread mill as per increasing and
1 N decreasing speed of tread mill. After the recording of
Cmean (n) =
N
∑ y ( n)n
(2)
stress ECG signal the signal is transmitted to the base
n =1 station by radio frequency signal. On the base station
0 ≤ n ≤ L −1 signal is collected and processed by MATLAB. Figure
(4), shows the normal and stress ECG recorded signal.
Z n = ( yn − Cmean ), (3)
4.1. Stress ECG signal
Where yn, are the 6-point ECG signal of length L and
Zn output signal after filtering and resultant signal of Stress ECG is recorded from stress test that is a test
signal averaging and filtering. used to record arrhythmias that are brought on or are
In figure (3), it is shown in algorithmic steps that worsened by stress or with exercise. This test also may
first detect the QRS complex correctly then take 6- be helpful in determining if there is underlying heart
point averaging of ECG signal before and after the disease or coronary artery disease associated with an
fiducial (QRS) points for removing EMG noise, on arrhythmia. This test monitors heart rate, breathing,
other hand take the double mean averaging of the blood pressure, electrical activity (on an
signal for removing baseline noise from the signal and electrocardiogram) and the person’s level of tiredness.
then at the final step reconstruct the QRS complex of It shows if the heart’s blood supply is sufficient and if
ECG signal. the heart rhythm is normal. (Also known as Treadmill
Test, Exercise Test, Exercise Cardiac Stress Test or
ECST). Stress test is also having importance for
extracting ST-segment from the ECG signal.

Figure 3. Flow charts for signal averaging and Figure 4 (a). Resting ECG signal (Normal ECG)
filtering algorithm.
4. Experimental Results

411
403
4.2 Filtered ECG signal 5. Performance evolution and comparison
with adaptive filtering
After taking the experimental data, all data were
processed off-line using Matlab2007a software with The performance of proposed algorithm for signal
averaging and filtering gives good results. We have

Figure 4 (b). Running ECG signal (Stress ECG).

proposed signal averaging and filtering method that


has shown in flowchart in figure (3). In figure 5(a) the
resultant 6-point averaging waveform is shown with
cancellation EMG noise, in figure 5(b) the double
mean average of ECG signal is shown, that don’t have Figure 5. (a) 6-point averaging of ECG signal,
QRS complex but can provide the baseline to the (b) Double mean averaging signal, (c) Baseline
figure 5 (a), then subtracting the figure 5(a) and 5(b) wander noise removal signal.
the resultant figure 5(c) comes out without the baseline
wonder noise. Table.1.Result of calculation by using different
condition of ECG signal
4.3 Heart rate calculation
Total *** H.R
ECG
no. of *FP **FN Accuracy (beats
The R-wave detector detects the R-wave’s position signal
beats (%) /min.)
in ECG cycle and further calculates the R-R interval
and then the heart rate is calculated as follows: Stress
130 0 0 100% 143.84
ECG
⎛ 60, 000 ⎞
HR = ⎜ ⎟ beats / min .
⎝ RR − int erval ⎠ Walking
ECG
145 0 1 97.77% 67.84

In stress HR (from stress ECG) immunity to noise is


of greater importance then in HR measurements at rest. Normal
145 1 0 97.77% 105.10
ECG
Because HR measurements at rest are usually affected
only by low levels of noise, whereas stress HR is
affected by greater levels of noise like EMG noise and *FP: Number of false detections when there exist no beats but
motion artifacts that shown in table (1). detected as “beats exist”
**FN: Number of false detections when there exist beats but detected
as “beats does not exist”
***Accuracy = 1- (FP+FN)/(Total Beats)

412
404
also presented comparison with adaptive filtered 5.2. Signal-to-noise ratio (SNR) calculation
ECG signal and signal averaging and filtering ECG
signal. Signal averaging has been used to enhance the signal
to noise ratio (SNR) of digitally recorded periodic
5.1. Adaptive filtering ECG signals [7]. We have used the SNR parameter to
quantify and compare the performance of algorithms,
An adaptive filter is usually a FIR filter whose and also determine the noise level in an ECG beats.
coefficients or weights change in the response to the The SNR defined as:
changing input signal’s characteristics. The filter has
an adaptation algorithm that monitors the environment S Po
with additional sensors and hardware and varies the = 10 × log10 , (4)
N ( Po − Pf )
filter transfer function accordingly [9]. An adaptive
filtering is effective in cases where the signal and
corrupting noise are stationary or their characteristics Where Po is an original recorded ECG signal and Pf is
alter so slowly, that the system is able to adapt to these the filtered ECG signal of length L. The SNR of
variations. This is not the case, however, with noisy filtered signal is -32.9071db from signal averaging and
ECG signals where the noise characteristics, mainly filtering method for the stress data and for normal ECG
motion artifacts, can vary considerably and adaptive signal SNR is -21.5342db, greater than stress ECG
filter probably fails to be optimal filtering method signal. Figure (7) shows the noise separated from the
without having strong correlation between noise ECG signal after filtering.
present in ECG signal and reference signal used for In figure (8), the FFT (Fast Fourier transform) of
adaptation [5] & [1], therefore the main problem in recorded stress ECG and filtered ECG has been shown,
using adaptive algorithm is finding a suitable reference wherein8(a), all low frequency noise 0-10Hz present
signal. In figure (6), the adaptive ECG signal looks and the high frequency noise also at 60Hz to 100Hz
clearer then the signal average and filtering signal in present.
figure 5(c), but in ECG signal the ST-segment is
distorted.

Figure 7. Noise separated from stress ECG


signal after filtering by signal averaging and
filtering method.
Figure 6. Adaptive filtered stress ECG signal.
In figure 8(b), all high frequency and low frequency
So this is the main advantage in signal averaging noises are removed after filtering.
and filtering method that ECG signal is not distorted
after the filtering.
6. SNR improvement

413
405
averaging theory is that noise should be random
The Signal-to-noise ratio can be improved at some Gaussian noise, also if uncorrelated to signal otherwise
level by using the smoothing function present in misleading result can occur.
MATLAB. The SNR from smoothing ECG signal is
increased from -32.9071 to -32.3061db.

(a)
Figure 9 (a). Filtered ECG by signal averaging
and filtering method, (b). Smooth ECG with
improved signal-to-noise ratio.

If the fiducial point is derived from the signal itself,


care must be taken to ensure that noise is not
influencing the temporal location and amplitude of
fiducial point.
For filtering we have although used signal
averaging and filtering method that removes baseline
wander noise and EMG noise present in ECG signal
but that cannot remove the motion artifact present in
the ECG signal. On the other hand, the adaptive
filtering gives the good result for removing the motion
artifact but due to improper reference signal the useful
signal can be distorted.

(b) 8. References
Figure 8. (a) FFT of raw ECG signal, (b) FFT of
[1] Mary Anne D.Raya, student member of IEEE and Luis G.
filtered ECG.
Sison phd, member of IEEE “Adaptive noise cancellation of
motion artifact in stress ECG signals using accelerometer”
7. Conclusions preceding of second joint EMBS/BMES conference, 2002.

By experiment, we have described in this paper the R- [2] Shahriar Lravanian and Leslie Tung, member of IEEE ”A
wave detection, signal averaging and filtering for novel algorithm for cardiac biosignal filtering based on
removing baseline noise and EMG random noise from filtered residue method” IEEE trans. On biomedical
engineering, Vol. 49,NO.11, November 2002.
ECG signal and also analyzed the stress and normal
ECG signal. An important assumption made in signal

414
406
[3] Valtino X. Afonso, Willis J. Tompkins, Truong
Q.Nquyen from deppt. Of electrical and computer
engineering Univ. of Wisconsin and Kurt Michler, Shen Luo
from Burdick inc. “Comparing Stress ECG Enhancement
Algorithms with an introduction of filter bank based
approach” IEEE engineering in medician and biology in june
1996.

[4] Antti Ruha member of IEEE, Sami Sallinen member of


IEEE and seppo Nissila, “A real-time microprocessor QRS
detector syatem with a 1-ms timing accuracy for the
mearsurement of ambulatory HRV”, IEEE Transaction on
biomedical engineering, Vol.44, NO. 3, March 1997.

[5] N.V. Thakor and Y.S. Zhu, “Applications of adaptive


filtering to ECG analysis: Noise cancellation an arrhythmia
detection”, IEEE trans. Biomedical engg. Vol. BME-38, pp.
785-794, Aug. 1991.

[6] Jacek M.leski, Norbert henzel “ECG baseline wander and


powerline interference reduction using nonlinear filter bank”
available at www.Elsevier computerScience.com, 2004
Elsevier B.V.

[7] Luis G. Herrera-Bendezu, Bart G. Denys and P.S.


Reddy, “Signal processing methods to improve high
resolution ECG signal averaging” Division of Cardiology,
University of Pittsburgh, Pittsburgh, PA 15213,0-7803-0785-
2 IEEE

[8] Freedman RA, Gillis AM, Keren A, Soderholm-Difatte


V, Mason JW “Signal-averaged electrocardiographic late
potentials in patients with ventricular fibrillation or
ventricular tachycardia : Correlation with clinical arrhythmia
and electrophysiologic study “. The American Journal of
Cardiology , Volume 55 , Issue 11 , Pages 1350 - 1353 R .
Freedman

[9] S. Haykin, Adaptive Filter Theory. Upper Saddle River,


NJ: Prentice-Hall, 2001

[10] Young-Dong Lee, Esko Alassarela, and Wan-Young


Chung, "A Wireless Health Monitoring System in Multi-hop
Body Sensor Networks", Procceding of ISMICT’07, 2007.

415
407

You might also like