Automation of ECG Heart Beat Detection Using Morphological Filtering and Daubechies Wavelet Transform
Automation of ECG Heart Beat Detection Using Morphological Filtering and Daubechies Wavelet Transform
Automation of ECG Heart Beat Detection Using Morphological Filtering and Daubechies Wavelet Transform
www.iosrjen.org
(PG Scholar, Department of ECE, University College of Engineering, Thodupuzha, Kerala, India.)
(Professor,Department of ECE, Mar Athansius College of Engineering, Kothamangalam, Kerala, India)
3
(Asst.Professor,Department of ECE, University College of Engineering, Thodupuzha, Kerala, India.)
Abstract: - The most specific diagnostic test for heart diseases is the Electrocardiogram (ECG). ECG is a
graphical representation of the electrical activity of the heart. Analysis of an ECG signal starts with the
detection of QRS complex. Detection of QRS complex is a difficult task as the signal is frequently corrupted by
powerline interference, baseline drift, motion artifact and electromyographic interference. Therefore, reliable
and accurate detection of QRS complex is gaining momentum nowadays.
A novel QRS detection algorithm based on Mathematical Morphological (MM) filtering and Daubechies
wavelet transform has been developed in this work. MM uses its hybrid opening-closing operations for
impulsive noise suppression and baseline wander removal. Daubechies3 WT is used for signal analysis since it
has a shape similar to the ECG signal. R peak is extracted as a first in the feature extraction since it is having
highest amplitude, followed by Q peak and S peak extraction. Heart beat rate was calculated from the R-R peak
interval. From the heart rate and R-R peak interval the diagnosis of the cardiac ailments is done.
Keywords: - Baseline wander, Daubechies wavelet transform, ECG, Mathematical Morphology, QRS complex
I.
INTRODUCTION
Heart diseases are reported to have a major share in human death all over the world. Early diagnoses
and medical treatment of heart diseases can prevent sudden death of the patient. The simplest and the most
specific diagnostic test for cardiac ailments is the Electrocardiogram (ECG) test. ECG signals are generated by
the ECG machine and these signals are analyzed for the presence of any heart abnormalities. Different
computational tools and algorithms are being developed for the computer based analysis of the ECG to reduce
time consumption and improve the accuracy of the extraction. The ECG heart beat detection involves the issue
of extracting the QRS Complex, which is the main parameter that enables patient monitoring and further
diagnosis of cardiac ailments.
An ECG signal is a bioelectric signal, which records the hearts electrical activity versus time. It is
characterized by a series of waves whose morphology and timing provide information used for diagnosing
diseases reflected by disturbances of the electrical activity of the heart. This activity is recorded on graph sheets
or some kinds of monitors by placing the electrodes on specific locations of the body of a person. The recorded
waves have peaks and valleys and are normally represented by the letters P, Q, R, S, T and U waves. Figure.1
shows a standard ECG waveform.
53 | P a g e
Automation of ECG heart beat detection using Morphological filtering and Daubechies wavelet
ECG signal from the patients to display devices are influenced by Electromagnetic interference (EMI) from the
50/60 Hz power line noise. This noise degrades the signal quality and affects the tiny features which can be
critical for clinical diagnosis and monitoring and signal processing. Motion Artifacts are due to either the patient
movement or loss of electrode contact, transient baseline changes caused by alterations in the electrode-skin
impedance with electrode motion. Several filtering techniques are developed in the literature using moving
average filtering [3], cubic splines [6], Mathematical Morphology [1, 2, 6, 7 ] and Wavelet transform [3, 4, 6]
methods.
ECG being a non-stationary signal, the irregularities may not be periodic and may show up at different
intervals. Selection of an efficient technique to analyze these types of signals is an important task. Wavelet
transformation has proven to be an effective tool for non-stationary signal analysis [3].Mathematical
Morphology is found effective for impulsive noise reduction as it preserves the original shape of the wanted
signal [2]. Since physiologists are interested to the shape of ECG signal, it is reasonable to use MM filtering for
ECG waveforms. It is essential to develop an algorithm which enables accurate analysis of the ECG signal. A
novel algorithm combining Mathematical Morphology and Daubechies wavelet transform for ECG analysis is
developed in this work.
II.
SYSTEM MODELLING
The proposed algorithm for the ECG analysis consists of three stages- Preprocessing, Transformation
and Feature extraction. Block diagram of Heart beat detection is shown in Figure.2. The digitized ECG is
obtained from MIT-BIH database. The obtained signal is polluted with noise which is filtered by a sequence of
Morphological operations. In the transformation stage, Daubechies wavelet transform is performed on the ECG
signal to facilitate heart beat detection. The feature extraction stage is to recognize the positive maximum
negative-minimum pair with adequate amplitude in the wavelet coefficients from the previous stage. This is
done through zero crossing detectors, peak detectors and decision making circuits. Finally, identification of QRS
complex and heart beat is done.
54 | P a g e
Automation of ECG heart beat detection using Morphological filtering and Daubechies wavelet
Opening operation of MM followed by closing operation is done on the digitized data and the reverse operation
is also done. Taking the average of the two gives the impulse noise suppressed ECG signal. Subtracting it from
initial data will give the impulse noise.
Baseline Wander Removal
For Baseline wander removal, baseline estimation is calculated. To get the baseline estimation, the
signal is first opened by a structuring element, s1, for removing peaks in the signal. Then, the resultant
waveforms with pits are removed by a closing operation using the other structuring element, s2. The two
structuring elements, s1 and s2, are defined as two horizontal line segments of zero amplitude but with different
lengths. The result of this compound operation is then an estimate of the baseline drift. The correction of the
baseline is then done by subtracting baseline estimation from the original signal.
B.TRANSFORMATION
Transformation technique used here is Wavelet transform (WT). WT is a linear operation that
decomposes the signal into a number of scales related to frequency components and analyses each scale with a
certain resolution. The WT uses a short time interval for evaluating higher frequencies and a long time interval
for lower frequencies. The signal at different frequency bands and at different resolutions is decomposed into
'approximations' and 'details'. Two sets of functions are employed by the WT, the scaling functions (associated
with the low pass filter) and the wavelet functions (associated with the high pass filter). The signal is filtered by
passing it through successive high pass and low pass filters to obtain versions of the signal in different
frequency bands. The fundamental idea behind wavelets is to analyze according to scale. Figure 3 shows
wavelet packet decomposition over 3 levels.
Fig.3. Wavelet Packet decomposition over 3 levels. g[n] is the low-pass approximation coefficients, h[n] is the
high-pass detail coefficients
Wavelet Transform of a signal f (t) is defined by:
Eqn. (5)
(
),
Eqn.(6)
is a window function and is called mother wavelet, a is
(
which is used as bases for wavelet decomposition of the input signal. One of the key criteria of a good mother
wavelet is its ability to fully reconstruct the signal from the wavelet decompositions. Selection of the type of the
wavelet depends on the application it is being used. There are different types of wavelets- Harr, Daubechies,
Biorthogonal, Coiflets, Symlets, Morlet, Mexican Hat, Meyer etc. and several other Real and Complex wavelets.
However, Daubechies (Db3) Wavelet has been found to give details more accurately than others [4]. Moreover,
this Wavelet shows similarity with QRS complexes and energy spectrum is concentrated around low
frequencies. Therefore, we have chosen Daubechies (Db3) Wavelet for extracting ECG features in our
application.
Daubechies WT applied to Preprocessed ECG signal
Daubechies WT is applied to the pre-processed ECG signal. The signal is decomposed into the low-pass
approximations (g[n]) and high-pass detail coefficients (h[n]). The high pass detail coefficients are maintained
while the low pass approximations are discarded.
C. FEATURE EXTRACTION
R peak Detection and Heart beat rate
For R peak detection, first step is finding the zero-crossing points, zero-derivative points (peaks) from the
wavelet transformed signal. Setting negative and positive thresholds to find R peak position is the next step.
Peaks of the R waves have the largest amplitude. If two detected R-peak are located less than 0.25 second then
discard the corresponding coefficient as it is a pseudo R-peak. If the two detected R-peak are located greater
55 | P a g e
Automation of ECG heart beat detection using Morphological filtering and Daubechies wavelet
than 0.25 second, then register the coefficient as an R-peak. This is done so, as no subsequent beats happen less
than 0.25 second and thus pseudo-beats are also removed. Detection of R peaks is very important because they
define the cardiac beats and the exactness of all forthcoming detections is dependent on this. Minimum of the
signal within 0.1 second about the R peak is formally detected from the WT coefficients to find the position of
Q and S points. The left minimum point from the R peak denotes Q peak and the right minimum point denotes
S peak. For heart beat rate calculation, RR interval in seconds is determined from the R-peak positions. Heart
beat rate in beats per minute (bpm) is equal to 60/RR interval.
III.
ECG signal analysis has been done in MATLAB 7.9. Digitized ECG signal was obtained from MIT-BIH
database. Various results obtained during the analysis are discussed below.
A. DETECTED FEATURES OF THE ECG DATA-RECORD NO. 100
Details of various findings of the ECG data Record No.100 are given below:
1. The number of R-peaks detected is 11 in 10s duration.
2. Q and S peak positions are found to be approximately .25second left and right of R-peak. Q peak
positions are found as an extrema of the signal as the last zero crossing of the differential Daubechies
wavelet transformed signal, before an R peak. S peak is accordingly found by the first extrema after an
R peak.
3. R-R interval: The R-R intervals in terms of second of the record 100 are varying from minimum 0.79
second to maximum 0.85 second at 10s duration. The normal range of R-R interval is 0.6 to 1 second.
So, the R-R interval is on the normal level. The amplitudes of R peak are minimum 0.44 mV to
maximum 0.75 mV.
4. Heart rate: 73.940 bit per minute.
56 | P a g e
Automation of ECG heart beat detection using Morphological filtering and Daubechies wavelet
Table 1. Heart beat rate and corresponding Cardiac ailments
IV.
Heartbeat detection via Mathematical Morphology and Daubechies wavelet transform provide an
effective algorithm for automated analysis of ECG. Baseline wander and impulse noise was appreciably
removed by MM filtering. Db3 WT was used for signal analysis. From the wavelet coefficient, high pass details
were kept for feature extraction discarding the low pass approximations. R peaks were detected first because R
peaks has high dominated amplitude and this peak detection is easy than other peaks. On the either negative
extremas of the R peak, Q and S peaks was found and extracted. RR interval in seconds was calculated and was
used for Heart beat rate calculation. Further cardiac ailments were diagnosed by correlating the extracted
features with normal range of these features and decision was taken if patient have any type of abnormality or
none. Future work will be on the extraction of more features from the ECG, thereby expanding the detection to
wider scale.
REFERENCE
[1].
[2].
[3].
[4].
[5].
[6].
[7].
[8].
[9].
[10].
[11]
C.H. Chu and E.J. Delp, Impulsive Noise Suppression and Background Normalization of Electrocardiogram
Signals Using Morphological Operators, IEEE Trans. Biomed. Eng., vol. 36, pp. 262-273, 1989.
Tripti Singh, Yogender Sharma and Ankit Jayant, Optimize Approach to Remove Baseline Wandering From ECG
Signals, PISER 13, Vol.02, Issue: 03/06 May- June,2014; Bimonthly International Journal Page(s) 216-219
Monika Kumari and Priyanka Mehta, QRS Complex Detection of ECG Signal Using Wavelet Transform,
International Journal of Applied Engineering Research, ISSN 0973-4562 Vol.7 No.11, 2012
Anshul Jain, Dr. Ajit Patel and Yamini Goyal ,ECG Analysis System with Event Detection based on Daubechies
Wavelets, 2012 International Conference on Electronics Engineering and Informatics (ICEEI 2012)
P. Sasikala, Dr. R.S.D. Wahidabanu, Robust R Peak and QRS detection in Electrocardiogram using Wavelet
Transform, (IJACSA) International Journal of Advanced Computer Science and Applications,Vol. 1, No.6,
December 2010
Vctor Barbero Romero, ECG baseline wander removal and noise suppression analysis in an embedded platform,
2009
P. E. Trahanias, An Approach to QRS Complex Detection Using Mathematical Morphology, IEEE Transactions
On Biomedical Engineering, Vol. 40, No.,2, February 1993
R. Gonzalez and R.Woods, Digital Image Processing, 3rd ed. Englewood Cliffs, NJ: Prentice-Hall, 2007.
Malcom.S.Thaler, Only EKG Book You'll Ever Need (5th Edition)
Tobias Baas,ECG Based Analysis of Ventricular Repolarisation in the Human Heart(Karlrushe Transaction on
Biomedical Engineering Vol.18, 2012)
O. Yu. Mironyuk and A. Yu. Loskutov, Detection of Cardiac Pathologies Using Dimensional Characteristics of
RR Intervals in Electrocardiograms, ISSN 0006-3509, Biophysics, 2006, Vol. 51, No. 1, pp. 115119. Pleiades
Publishing, Inc., 2006.
57 | P a g e
Automation of ECG heart beat detection using Morphological filtering and Daubechies wavelet
[12]
[13]
[14]
[15]
[16]
[17]
[18]
[19]
S. Finn, E. Jones, M. Glavin, Design of a Personal Cardiovascular Monitoring System with ECG and
Stethoscopic Analysis, IEEE Conf. on Consumer Electronics, 2008.
D.W. Ryoo, C.S. Bae, J.W. Lee, The Wearable Wrist-Type Gadget for HealthCare based on Physiological
Signals, IEEE Conf. on Consumer Electronics, 2008.
Friesen, G.M., et al., A comparison of the noise sensitivity of nine QRS detectionalgorithms, IEEE Trans.
Biomed. Eng., vol. 37, pp. 85-98, 1990.
Pan, J. and W.J. Tompkins, A Real-Time QRS Detection Algorithm, IEEE Trans. Biomed. Eng., vol. 32, pp.230236, 1985.
Li, C., C. Zheng, and C. Tai, Detection of ECG Characteristic Points Using Wavelet Transforms, IEEE Trans.
Biomed. Eng., vol. 42, pp. 21-28, 1995.
Martnez, J.P. and R. Almeida, A Wavelet-Based ECG Delineator: Evaluation on Standard Databases, IEEE
Transaction on
Biomedical Engineering, vol. 51, pp. 570-581, 2004.
Chen, W.C., ECG Parameter Extractor of Intelligent Home Healthcare Embedded System, thesis in dept. EEE.,
University of
Macau, Macau, 2005.
MIT/BIH Arrhythmia Database. Available from: http://www.physionet.org/physiobank/database/mitdb/.
58 | P a g e