Sunteți pe pagina 1din 11

Reviewing and Comparing Algorithms for Real Time

Electrocardiogram monitoring and feature extraction on cloud


connected android based smartphones
Md Juber Rahman
Department of Electrical and Computer Engineering, The University of Memphis, TN, USA

Abstract:
Mobile phones which are an integral part of daily life if incorporated with
wireless Electrocardiogram (ECG) sensors have the potential to be used in
continuous cardiac function assessment. ECG signal analysis is mainly
dependent on the detection of the prominent QRS complex, as well as
other ECG signal characteristics. In the last few decades, a lot of
techniques have been developed for ECG signal analysis. However,
existing literature does not provide the clear-cut idea of an algorithm
which is most suitable for implementation on a power constrained device.
This proposed paper discusses the chronological development of various
techniques and prominent transformations for extracting the feature from
an ECG signal. Additionally, this paper also provides a comparative study
of real-time signal processing methods for selecting a computationally
efficient

QRS

detection

scheme

suitable

for

implementation

on

smartphones.
Keywords ECG, QRS complex, Real time analysis, Android, Cloudconnected.
I.

INTRODUCTION

The heart has a set of specialized cells with self-excitatory properties,


which produce the electrical impulses that trigger the mechanical action
of the cardiac muscle bers; The ECG is a realistic record of the direction

and

magnitude

of

the

electrical

activities

that

is

generated

by

depolarization and repolarization of the atria and ventricles. Typically, the


ECG is acquired with a set of electrodes on the thorax. The investigation of
the ECG has been extensively used for diagnosing many heart diseases
and sleep disorders. Holter machine is the most widely used device for
monitoring and processing ECG signals. But from user perspectives
smartphone offers some extra advantages over Holter machine such as
mobility, familiarity and easy to use. Also, Holter devices do not detect
arrhythmias/sleep apneas automatically and do not provide real-time
information to the hospital/doctor/patient when a critical heart condition
occurs. With the advancement of smart phones in terms of memory,
processor and high capacity graphics processing unit ECG processing and
feature extraction on smartphone has become promising. Android is an
open source operating system for smart phones with the capacity to run
hundreds of applications simultaneously. For high speed wireless data
transfer between wearable sensor and the smartphone Bluetooth or Wi-Fi
communication standard may be used. Both are readily available in most
of the smart phones where as a separate Bluetooth/ Wi-Fi module is to be
included in the sensor. However, there is a signicant trade-off as there
will always be a power-consumption limitation in processing ECG signals
on battery-operated devices. Therefore, prior to deploying any algorithm
on modern mobile devices, comprehensive evaluation and comparison of
the algorithms are required for automatic ECG feature extraction. The ECG
features can be extracted in time domain or in frequency domain. There is
no doubt that the essential quality for any algorithm used for real-time

analysis is its simplicity (numerical efficiency), provided this does not


decrease accuracy. The simpler the algorithm (while retaining accuracy),
the faster it will be in processing large databases and it will consume less
power for battery-operated devices. Moreover, a simple algorithm also
offers low cost of hardware implementation in both power and size for
body sensor networks.
Recently, researchers have put an increased effort into developing
efficient ECG analysis algorithms to run within mobile phones, including
algorithms for determining the quality of collected ECG signals. Su et al.
[1] investigated three simple QRS algorithms for implementation on
mobile phones. B. Mazomenos et al. [2] introduced a low-complexity
algorithm for mobile healthcare applications. This increased effort is also
evidenced in the 2011 Physio Net/Computing in Cardiology Challenge,
which has been established to encourage the development of ECG
software that can run on a mobile phone, recording an ECG and providing
useful feedback about its quality. It is the intention of the author to
provide an overview of these recent developments as well as of formerly
proposed algorithms. The overview is based on the description of the
principles. The original papers that are referenced at the end of this article
contain the algorithmic details.
II.

ECG FEATURES AND NOISES

One cardiac cycle in an ECG signal consists of the P-QRS-T waves. Figure 1
shows a sample ECG signal. Most the clinically useful information in the
ECG is originated in the intervals and amplitudes dened by its features

(characteristic wave peaks and time durations). The ECG feature


extraction

system

provides

fundamental

features

(amplitudes

and

intervals) to be used in subsequent automatic analysis.

Fig 1: ECG Signal


courtesy: Steve S. Ryan, PhD
ECG signals get contaminated by several noises including power line
interference, motion artifacts, baseline wander, muscle contraction,
electrode contact noise and instrumentation noise [3]. The utility of
recorded ECGs get seriously hampered by these artifacts and hence data
corrupted with noise must be either discarded or ltered for better clinical
evaluation. So, the main challenge in developing an algorithm is to
remove both high frequency noise and low frequency baseline drifts with
minimum signal distortion.

III.

OVERVIEW OF ALGORITHMS

A novel approach for QRS detection in software was put forth by R.G. Mark
et al. [4] and was implemented in a portable instrument based on the Intel

8085 microprocessor. It was aimed at real-time ECG analysis on


ambulatory patient. The algorithm is based on amplitude threshold
followed by a three-pass delimiter and feature extractor. The QRS complex
is detected by comparing the features against a threshold. Then
suspicious events are rejected and missed events search is activated by a
timing classier which is followed by morphological classication. This
algorithm put much emphasis on arrhythmia classication rather than
ECG feature extraction. It doesnt provide effective way to differentiate Twaves from QRS complex. Also, the result of evaluation against standard
databases is not that much satisfactory.
Pan and Tompkins [5] introduced a real-time QRS detection algorithm
including three different types of processing steps: linear digital ltering,
nonlinear transformation and decision rule algorithms. Initially an analog
lter is used to band limit the signal at 50m Hz. Then an A/D converter
samples the ECG at 200 samples per second. The resulting digital signal is
processed in multiple steps. rst the noise was attenuated by passing the
signal through a band pass lter which is constructed by cascading high
pass and low pass lters. In the non-linear transformation stage the
ltered signal is differentiated and amplitude squared. Due to squaring the
slope of the frequency response curve become signicant and helps to
eliminate false positives caused by T waves.

Then the signal passes

through a moving window integrator. Finally, as part of decision rule


algorithm adaptive thresholds are used to detect QRS complexes. Pan and
Tompkins used two set of thresholds in case of previously used one
threshold technique. One set is used to threshold ltered ECG whereas the

other is used to threshold the signal produced because of moving window


integration. They also introduced a T-wave identication technique based
on maximal slope. Pan Tompkins implemented their algorithm in a Z80
microprocessor in assembly language and evaluated their QRS detection
algorithm by standard MIT/BIH arrhythmia database. Evaluation results
indicate that Pan Tompkins algorithm is highly effective with only 0.675%
detection failure.
Cuiwei Li et al. [6] proposed a wave-let based QRS detection algorithm. It
is based on Mallats and Hwangs [7] approach for singularity detection
and classication using local maxima of the wavelet coefficient signals.
The wavelet transform(WT) is in fact a two-dimensional time scale
processing method with adequate scale values and shifting in time. WT
can represent signals in different resolution for different frequency bands
and can characterize the local regularity of signals. In this algorithm rst a
characteristic scale is selected and modulus maximum lines of R waves
are determined. Then regularity exponent is calculated and used to detect
noise or interference. Noise or artifact may also cause modulus maximum
lines; so, redundant and isolated modulus maxima lines are eliminated
which causes noise and motion artifacts to reduce signicantly. Then Rpeaks are detected based on the zero crossing points of positive
maximum-negative minimum pairs. After R-peak detection beginning of Q
wave (QRS onset) and ending of the S wave (QRS offset) are detected.
Since Q and S waves are low energy and high frequency signals, they are
detected at scale 21 to avoid the effect of baseline drift. As Per the power
spectra the energies of T and P waves are mainly at 2 4 - 25scale. To

eliminate baseline drift 24 scale is selected to detect T and P waves. Like


QRS complex, the onset and offset for P and T waves are calculated. WT
algorithm had been evaluated using MIT/BIH arrhythmia database. Results
indicate that WT algorithm is highly effective to detect QRS of ECG signals
with high frequency noise, baseline drift and artifacts. The detection
failure rate is only 0.15%. But this algorithm is not able to detect onset
and offsets of highly noise influenced P and T waves with an accuracy
required for morphological classication. It was implemented in a PC with
C language and it required 1 min to process 10 min ECG data. The speed
of processing is not satisfactory to analyze long-term ambulatory data.
Even after that WT proved to be very effective in characterizing a signal
with multi scale information analysis. Based on WT many algorithms were
developed later. The most prominent one was by Castro et al. [8] who
devised a method for choosing an optimal mother wavelet for ECG feature
extraction and recognition of abnormal heartbeats. The mother wavelet is
chosen from a set of orthogonal and bi-orthogonal wavelet lter banks by
a method of correlation with the ECG signal.
Afonso et al. [9] proposed a ECG beat detection technique based on lter
banks (FB) which is very close to wavelets. The FB contains a set of nite
impulse response lters known as analysis lters which decompose the
input signals into sub-bands with uniform bandwidths. Then a bank of
synthesis lters is used to perfectly reconstruct the original signal. The
goal of this algorithm is to develop one set of pre-processing lters which
may be used in a variety of tasks for ECG processing. For beat detection
the no. of true positives is maximized while keeping the no. of false

negatives and false positives to a minimum. This algorithm was


implemented in C and MATLAB programming languages. The algorithm
performance was studied using the MIT/BIH data base and an overall
sensitivity was found to be 99.59 percent. Also, it required only 9 secs to
analyze half-an hour record. But it is important that the FB used to process
the ECG have certain characteristics i.e. analysis and synthesis lters
should have linear phase, perfect reconstruction property and good stop
band attenuation. The design of FBs having these compromising
characteristics is challenging.
As an alternative to wavelet analysis Blanco-Velasco et al. [10] proposed
an algorithm based on empirical mode decomposition(EMD) for ECG signal
denoising and baseline wander correction. EMD is a good tool for artifact
reduction applications. It was originally developed by Huang et al. [11] as
an adaptive technique for decomposing a signal into a collection of AM-FM
components. Unlike Fourier or Wavelet transform method EMD does not
require a pre-dened basis function to represent a signal. Rather it
depends fully on a data driven mechanism. So, it is well suited for the
analysis of non-stationary and non-linear signals such as ECG signal. First
the ECG signal is decomposed into a sum of Intrinsic Mode Functions
(IMF). IMFs are dened as a function with equal no. of maxima and zero
crossings with its envelopes. Then rst three IMFs are summed together
to delineate the QRS complex. Then rst several IMFs corresponding to
the noise are subjected to a time domain window function sized based on
delineation results. After that t-test is applied to identify noise contributing
IMFs. Usually noises have a zero mean whereas signals have a non-zero

mean. After determining the noise order the noises are removed by signal
partial reconstruction. Base line wander which is caused mainly by
respiration is rst estimated by a bank of low pass lters and then
deducted from the original signal yielding reconstructed signal. EMD
based algorithm has been validated by practical experiments with MIT/BIH
database. The results showed a signicant improvement over wavelet
transform method in terms of signal to error ratio.
Yun-Chi Yeh and Wang [12] devised a simple and fast algorithm known as
Difference Operation Method (DOM) for the detection of QRS complex. The
algorithm consists of two stages rst of which is to nd the R peak by
applying the difference equation operation to the ECG signal. In the
second stage QRS complex is calculated. Initially the raw signal is passed
through a digital lter which adaptive and selected based on noise type. It
may be a high pass lter with a .5 Hz cut-off frequency to remove the
interference of baseline drift or a notch lter to remove power line
interference or a morphological lter to remove motion artifacts. Then the
difference signal is obtained by Xd(n)= X(n)-X(n-1). The difference signal
may contain the small amplitude but high frequency signal. A low pass
lter with 100 Hz cut-off frequency is used to eliminate the small
amplitude but high frequency variation waveform. Two thresholds are
applied to the ltered signal to get the nal signal. The detection of QRS is
the next step. For that the difference signal is separated into two partsthe positive and the negative part. Then extreme value points for each
interval in each part is detected. Then time difference between the
position of two adjacent nonzero positive/negative extreme values are

measured. Matching the positions of those extreme points to the original


ECG signal the position of maximum positive value is the position R.
MIT/BIH database was used to evaluate the effectiveness of the DOM
algorithm. Results indicate that rate of failed detection is very low. Also,
this method does not require complex mathematical calculations such as
cross-correlation, Fourier transform etc. and the memory requirement is
only 2.5 MB for processing 30 min long recording. So, DOM is highly
suitable for low energy consumption application.

IV.

CONCLUSIONS AND FUTURE WORKS

In summary, the previous work in the literature did not specically


evaluate sleep apnea or arrhythmia detection and classication algorithm
on cloud connected mobile devices.

So, the future challenge is the

development and implementation of a comprehensive software based


algorithm in an android based monitoring application which can process
ECG signals in real time by accessing a wearable sensor via Bluetooth/ WiFi and provide an expert intervention free heart bit classication, sleep
apnea detection as well as biometric recognition of individuals identity.
References
[1] F. Sufi, Q. Fang and I. Cosic, "ECG R-R peak detection on mobile phones," in 2007 29th
Annual International Conference of the IEEE Engineering in Medicine and Biology Society, 2007,
pp. 3697-3700.

[2] E. B. Mazomenos, D. Biswas, A. Acharyya, T. Chen, K. Maharatna, J. Rosengarten, J.


Morgan and N. Curzen, "A low-complexity ECG feature extraction algorithm for mobile healthcare
applications," IEEE Journal of Biomedical and Health Informatics, vol. 17, pp. 459-469, 2013.
[3] G. M. Friesen, T. C. Jannett, M. A. Jadallah, S. L. Yates, S. R. Quint and H. T. Nagle, "A
comparison of the noise sensitivity of nine QRS detection algorithms," IEEE Transactions on
Biomedical Engineering, vol. 37, pp. 85-98, 1990.
[4] R. G. Mark, G. B. Moody, W. H. Olson, S. K. Peterson, P. S. Schluter and J. B. Walters Jr,
"Real-time ambulatory arrhythmia analysis with a microcomputer," Comput. Cardiol., vol. 6, pp.
57-62, 1979.
[5] J. Pan and W. J. Tompkins, "A real-time QRS detection algorithm," IEEE Transactions on
Biomedical Engineering, pp. 230-236, 1985.
[6] C. Li, C. Zheng and C. Tai, "Detection of ECG characteristic points using wavelet
transforms," IEEE Transactions on Biomedical Engineering, vol. 42, pp. 21-28, 1995.
[7] S. Mallat and W. L. Hwang, "Singularity detection and processing with wavelets," IEEE Trans.
Inf. Theory, vol. 38, pp. 617-643, 1992.
[8] B. Castro, D. Kogan and A. B. Geva, "ECG feature extraction using optimal mother wavelet,"
in Electrical and Electronic Engineers in Israel, 2000. the 21st Ieee Convention of The, 2000, pp.
346-350.
[9] V. X. Afonso, W. J. Tompkins, T. Q. Nguyen and S. Luo, "ECG beat detection using filter
banks," IEEE Transactions on Biomedical Engineering, vol. 46, pp. 192-202, 1999.
[10] M. Blanco-Velasco, B. Weng and K. E. Barner, "ECG signal denoising and baseline wander
correction based on the empirical mode decomposition," Comput. Biol. Med., vol. 38, pp. 1-13,
2008.
[11] N. E. Huang, Z. Shen, S. R. Long, M. C. Wu, H. H. Shih, Q. Zheng, N. Yen, C. C. Tung and
H. H. Liu, "The empirical mode decomposition and the hilbert spectrum for nonlinear and nonstationary time series analysis," in Proceedings of the Royal Society of London A: Mathematical,
Physical and Engineering Sciences, 1998, pp. 903-995.
[12] Y. Yeh and W. Wang, "QRS complexes detection for ECG signal: The Difference Operation
Method," Comput. Methods Programs Biomed., vol. 91, pp. 245-254, 2008.

S-ar putea să vă placă și