This paper presents a comparison of methods for denoising the Electrocardiogram signal. The methods are applied on
MIT-BIH arrhythmia database and implemented using MATLAB software.
What are the advantages and disadvantages of membrane structures.pptx
Â
DENOISING OF ECG SIGNAL USING FILTERS AND WAVELET TRANSFORM
1. ICRTEDC-2014 28
Vol. 1, Spl. Issue 2 (May, 2014) e-ISSN: 1694-2310 | p-ISSN: 1694-2426
GV/ICRTEDC/07
DENOISING OF ECG SIGNAL USING
FILTERS AND WAVELET TRANSFORM
1
Inderbir Kaur, 2
Rajni
1,2
Electronics and Communication Engineering, SBSSTC, Ferozepur, Punjab
1
inder_8990@yahoo.com, 2
rajni_c123@yahoo.com
Abstract—Electrocardiogram is a nonstationary signal
and is used for heart diagnosis. It contains important
information but often gets contaminated by different types
of noises. Hence it is needed to denoise the signal. This
paper presents a comparison of methods for denoising the
Electrocardiogram signal. The methods are applied on
MIT-BIH arrhythmia database and implemented using
MATLAB software.
Index Terms—Electrocardiogram (ECG), Wavelet
transforms.
I. INTRODUCTION
The heart’s electrical activity is recorded by the popular
tool Electrocardiogram [1]. Electrocardiography is an
essential part of cardiovascular assessment. It is a
fundamental tool for detecting any irregularities present in
ECG. These abnormalities are termed as cardiac
arrhythmias [2]. ECG is represented by the repeated
process of depolarization and repolarization of cardiac
cells. This repeated process forms the heart rhythm. The
surface electrodes are placed on body of person to sense
the signal [3]. The heart is the vital structure of the
cardiovascular system and is positioned in the
mediastinum. It is shielded by the bony structures of the
sternum interiorly, the spinal column posteriorly, and the
rib cage [4]. The human heart comprises of four chambers
i.e., Right Atrium, Left Atrium, Right Ventricle and Left
Ventricle. The upper chambers consist of the two Atria’s
and the lower chambers are the two Ventricles. Under
healthy condition the heart beats in a systematic manner
i.e. it starts at the Right Atrium called Sino Atria (SA)
node and a particular group of cells transport these
electrical signals across the heart. This signal moves from
the Atria to the Atrio Ventricular (AV) node. The AV
node is attached to a group of fibers in Ventricles that
mediate the electrical signal and transmits the impulse to
all parts of the lower chamber, the Ventricles. It is made
sure that the heart is functioning properly hence this path
of propagation is traced accurately [5] [6]. The structure
of heart is as shown in Fig 1:
Figure1. Physiology of heart [7]
ECG is characterized by the peaks P, Q, R, S, T and U.
The QRS complex is the most important wave that is
caused due to ventricular depolarization of the heart. It
consists of three main points Q, R and S [8]. The
functioning of upper chambers of heart i.e. the atria is
represented by the P-wave and the T-wave indicates the
ventricular repolarization of the heart. The normal heart
rate value is 60-100 beats per minute. The rate slower than
normal range is known as Bradycardia and the rate higher
is known as Tachycardia [9]. The ECG waveform is
shown as in Fig 2:
Figure2. ECG Waveform [10]
II. NOISES IN ECG SIGNAL
ECG signal has a great role in diagnosis of human
diseases related to heart. The main problem that occurs in
ECG analysis is reduction of noise from the signals.
Hence ECG signals need to be denoised for further
processing of the signal [11]. ECG signal often gets
contaminated by various types of noise as:
ď‚· Baseline wandering
ď‚· Electromyogram noise (EMG)
ď‚· Motion artifact
ď‚· Power line interference
ď‚· Electric pop or contact noise
The baseline wandering and power line interference is the
most important noise and has an extreme effect on ECG
signals. Baseline wandering is caused due to respiration
and lies in range of 0.15 to 0.3 Hz. The other noises are
wideband and complex in nature but do affect the signal.
The power line interference is a narrowband noise
centered at 50 or 60 Hz. It can be easily removed by the
hardware used to collect ECG signals. But the other
noises could not be removed by hardware but can be
suppressed by software processing [12].
2. 29 ICRTEDC -2014
A. Power line Interference
All electrical appliances have electromagnetic field
generated inside the device that leads to generation of
harmonics. These harmonics causes certain disturbances
which exist inside all over the appliance. These effects can
be reduced by taking proper care or by continuous viewing
of the appliance. The base frequency depends on the place
as 50 Hz in India.
B. Electrode Contact Noise
Electrodes should be placed proper contact with the
patient. If the electrodes are left loose then it leads to
electrode contact noise. The switching action of
connection or disconnection at the input of measuring
apparatus leads to generation of rapid, high amplitude
artifact that declines to isoelectric line exponentially.
C. Motion caused artifacts
ECG signals records electrical activity of heart but does
get effected by movements of patient. Motion artifacts are
temporary changes which is the result of changes in the
electrode-skin impedance caused due to electrode motion.
The filtering of such signal is not easy and hence it leads to
unrecognizable QRS complex.
D. Muscle contractions
In human body mill volt-level artifactual potentials is
generated by muscle contraction. However the QRS beats
can be recognized since these currents die out each other.
But the detection rate of other waves as P, S, T and U is
reduced.
E. Muscle contractions
It causes the drift in the iso-electric line due to
respiratory movements. The respiration frequency gets
added to the signal. Since the respiration frequency of a
normal patient is about 0.15-0.30Hz hence the drift
amplitude may be at least five times smaller than the
size of a normal QRS beat [13].
III. DATABASE
For ECG signal analysis is collected from Physionet
MIT-BIH arrhythmia database through ATM data viewer.
The signals are sampled at a frequency of 360 Hz. The
signals are stored in a 212 format [14].
IV. METHODS
Three different methods are used for denoising the
ECG signal:
A. Savitzky-Golay filter
Savitzky-Golay filters smoothes the noisy data by using
the method of least square fitting frame. In this method
frame of noisy data is fitted onto a polynomial of given
degree. The degree is the order of the polynomial and the
frame size indicate the number of samples used to perform
the smoothing for each data point. The Savitzky-Golay
filters have an important property of peak preservation
that is very useful in ECG processing [15].
B. Median filter
The median filter is a nonlinear digital filtering
technique, frequently used to remove noise. Denoising is
the pre-processing step to enhance the results in further
processing. The core concept of median filtering is that
each signal entry is replaced by the median of neighboring
entry. These neighboring entries are termed as window
that slides over the entire signal. The median is simple to
define for odd number of entries. The median is the
middle value after all entries are made [16].
C. Wavelet Transform
A wavelet is a small wave that has an average value
zero. Wavelets play a significant role in signal denoising
[17]. The wavelet transform is a time-scale representation
that is widely used in various applications such as signal
compression. Nowadays it has been used in areas of
electro cardiology for detection of ECG characteristic
points [18]. The signal is studied as a combination of sum
of product of wavelet coefficients and the mother wavelet
in wavelet transform. As visible from the Fig 3 the signal
is passed through a chain of low and high pass filters in
discrete wavelet transform (DWT). It leads to set of
approximate (ca) and detail (cd) coefficients respectively.
The down arrow and up arrow in figure represents the
downsampling and up sampling. This sampling up and
down leads to a change in scale [19].
Figure3. Wavelet hierarchy for 2-level decomposition.
The WT of a signal x (t) is defined as [20]:
(1)
V. METHODOLOGY
ď‚· Noise generation and addition
The first step is to generate random noise and
then add it to the original signal. It is shown as:
m = y + n; (2)
where y= original signal
n= random noise
ď‚· Then the baseline drift is removed by the smooth
filter.
ď‚· Then denoising is done first by Savitzky-Golay
filter of polynomial order 2 and frame size 15.
ď‚· Then secondly median filter is applied.
ď‚· Then wavelet transform method is applied.
o In case of wavelet transform first the
signal is decomposed at level of 10.
o Then the thresholding is applied.
ď‚· Then the evaluation parameters SNR, MSE, PRD
are calculated for the three methods.
VI. EVALUATION MEASURES
The denoising methods are evaluated using the
parameters given below:
ď‚· Signal to noise ratio (SNR) in db:
x (n) =original signal
y (n) =denoised signal
(3)
3. ICRTEDC-2014 30
ď‚· Mean square error (MSE)
(4)
ď‚· Percent Root Mean Square Difference (PRD)
(5)
VII. RESULTS
The methods applied on MIT-BIH arrhythmia data
taken from Physionet. The samples used are
100,103,113,114,115 in text form. The table below
contains the performance measures used i.e. SNR, PRD
and MSE. The results show the denoised waveforms of
sample 103 with the used methods. All the processing is
done on MATLAB software. The resulting waveform of
all the methods is shown below:
0 500 1000 1500 2000 2500 3000 3500 4000
-0.5
0
0.5
1
1.5
2
denoised signal
time
amplitude
Figure4. Denoised signal with Savitzky-Golay filter
0 500 1000 1500 2000 2500 3000 3500 4000
-0.5
0
0.5
1
1.5
2
denoised signal1
time
amplitude
Figure5. Denoised signal with Median filter
0 500 1000 1500 2000 2500 3000 3500 4000
-0.5
0
0.5
1
1.5
2
2.5
denoised signal
time
amplitude
Figure6. Denoised signal with wavelet transform
The performance measures in tabulated form are shown
as:
TABLE I. PERFORMANCE MEASURES
SA
MP
LE
Savitzky-Golay filter Median filter Wavelet transform
SNR MSE PRD SNR MS
E
PR
D
SNR MS
E
PR
D
100 8.84
96
0.105
3
40 8.64
79
0.10
42
39.
7
11.4
042
0.10
43
39.
7
103 12.7
074
0.062
0
20.4
4
12.2
722
0.06
17
20.
32
14.3
648
0.06
10
20.
10
113 3.47
19
0.113
5
23.5
1
3.43
18
0.11
23
23.
26
3.97
13
0.11
01
22.
81
114 10.8
366
0.009
1
5.32 10.5
075
0.00
94
5.5
3
11.4
457
0.00
83
4.8
8
115 7.82
31
0.244
2
38.0
4
7.45
56
0.24
41
38.
02
9.39
06
0.24
21
37.
71
0
2
4
6
8
10
12
14
16
100 103 113 114 115
Sgolay filter
Median filter
Wavelet
transform
Figure7. Signal to Noise Ratio (SNR)