Está en la página 1de 7

International Journal of Emerging Trends in Signal Processing

Volume 1 , Issue 1 ,November 2012


23

Advances in QRS detection: Modified Wavelet
energy gradient method
Rasika Burte, Rajesh Ghongade
Department of E&TC Engineering
Vishwakarma Institute of Information Technology
Pune - 411048 (Maharashtra) , India
rasika.burte@gmail.com
rbghongade@gmail.com


Abstract Electrocardiogram (ECG) is an important technique
used for recording bioelectric current generated by the heart.
ECG is composed of P, QRS & T waves and information related
to cardiac diseases can be extracted from the intervals and
amplitudes of these waves. This work has been inspired by the
need to find an efficient method for ECG Signal Analysis which is
simple and has good accuracy and less computation time. The
initial task for efficient analysis is the removal of noise. It is
achieved by the use wavelet transform analysis. Wavelets provide
temporal and spectral information simultaneously and offer
flexibility with a choice of wavelet functions with different
properties. Algorithms based on the differentiated ECG are
computationally efficient and hence ideal for real-time analysis of
large datasets. Here, we have implemented wavelet energy
gradient method using derivative based and Hilbert transform-
based approach for QRS detection with modified detection
thresholds.The simulation is done in MATLAB environment.
The experiments are carried out on MIT-BIH arrhythmia
database.
Keywords ECG, Wavelet transform , Hilbert transform,
Adaptive threshold, QRS detection
I. INTRODUCTION
The Electrocardiogram (ECG) is a vital sign signal for
heart functional investigation. It represents the electrical
activity of the heart which provides a lot of essential
information to physicians for diagnosis of heart diseases. Fig.1
shows a simple ECG model characterized by a number of
waves P, QRS, T, U related to the heart activity.


Fig.1.ECG model.

P wave is generated during atrium depolarization. After
that, QRS complex is generated during ventricular
depolarization and T wave is generated when ventricle
recovery occurs. The QRS complex is a major wave in each
ECG beat since the duration, the amplitude, and the
morphology are used for detection of cardiac arrhythmias,
conduction abnormalities, ventricular hypertrophy, myocardial
infarction, etc. Once the position of the R-wave is found, the
locations of other components of ECG like P, T waves are
found relative to the position of R-wave, in order to analyze
the complete cardiac period. Therefore, accurate detection of
the R-wave is essential in computer based ECG analysis.

The detection procedure of QRS complex [6] is depicted in
Fig.2. Various schemes have been developed to incorporate
different type of filters and decision rule to achieve a very
high correction of QRS complex detection.


Fig 2.QRS complex detection procedure

The R-R interval is the distance between two subsequent QRS
Complexes and represents the Heart Rate (HR). Normal HR is
in between 60 to 100 beats per minute (bpm). A high HR
means the possibility of tachycardia, and a low HR indicates
sinus bradycardia diseases .The amplitude and duration of
normal ECG signal is tabulated below in Table.1

Table.1 Characteristics of ECG Waveform

Amplitude(mV) Duration(Seconds)
P Wave 0.25mV PR Interval 0.12 to 0.20 s
R Wave 1.60mV QT Interval 0.35 to 0.44 s
International Journal of Emerging Trends in Signal Processing
Volume 1 , Issue 1 ,November 2012
24

Q Wave 25% R Wave ST Interval 0.05 to 0.15 s
T Wave 0.1 to 0.5 mV QRS interval 0.09 s

The electrical activity of the heart is generally sensed by
monitoring electrodes placed on the skin surface. The
electrical signal is very small (normally 0.1 to 1.6 mV). These
signals are within the frequency range of 0.05 to 100 Hz or
cycles per second. Unfortunately, other artifactual signals of
similar frequency and often larger amplitude reach the skin
surface and mix with the ECG signals. Artifactual signals arise
from several internal and external sources. Means
Electrocardiographic signals (ECG) may be corrupted by
various kinds of noise. Typical examples are:

1. Power line interference


2. Muscle contraction


3. Base line drift (Wander)

4. Electrode contact noise
5. Motion artefacts

ECG pre-processing generally takes care of denoising the
ECG signal. The software application could take the ECG
signal, denoise it, and perform the beat detection efficiently.
Possible enhancements include reducing the number of
fiducial marks (P, Q, R, S, and T waves) and reducing the
number of thresholds that could reduce the complexity.

Many R-wave detection algorithms have been proposed by
researchers for several decades. These detection algorithms
can be divided to the following mathematical algorithms in
general: (1)Time domain detection algorithms[7],[9]:
Considering that R-wave is characterized by high amplitude
and changing quickly, these algorithms directly detect R-wave
in time domain by using detecting threshold of ECG signal's
first order or second-order derivative. Time domain algorithms
often suits real-time application, and are sensitive to
interference, and only suitable for 'clean' ECG signal.
(2)Transform domain detection algorithms [2], [4]: Firstly,
obtain transformation of ECG signal by linear or nonlinear
transform, in which SNR is higher than original ECG signal.
Then apply appropriate threshold detection rules. The
representative transform including wavelet transform, Hilbert
transform, etc. Transform domain algorithms are often of large
calculation amount and bad real-time character, but of high
detection ratio and good robustness to interference. (3) Other
algorithms including template matching and morphologic
filtering algorithms.

This paper tries to benefit from the advantages of Hilbert
and Wavelet Transforms as well as adaptive thresholding
technique, in order to approach to an optimum combinational
method for R peak detection in order to achieve better results
especially in noisy environments.

The following sections are organized as follows. Section
I, we give description of algorithms. Section II briefly
describes the different algorithms for QRS detection. Section
III is dedicated to proposed QRS detection algorithm.
Experimental results are summarized in section IV. Section V
gives conclusion and some ideas for future work.

II. METHODS FOR QRS DETECTION
A. Use of wavelet transform
The wavelet transform is a mathematical tool for decomposing
a signal into a set of orthogonal waveforms localized both in
time and frequency domains. The decomposition produces
coefficients, which are functions of the scale (of the wavelet
function) and position (shift across the signal). We manipulate
wavelet in two ways viz., translation and scaling. In the
translation the wavelet along the time axis is shifted and
adapts to slow down the wavelet activity. In the scaling, fast
activity, sharp spikes are captured. In our approach we have
used three level discrete wavelet transform. Discrete Wavelet
Transform (DWT) has two filters, a low pass filter (LPF) and
a high pass filter (HPF).They are used to decompose the signal
into different scales. The output coefficients of the LPF are
called Approximation while the output coefficients of the
HPF are called Detail. The Approximation signal can be sent
again to the LPF and HPF of the next level for second-level
decomposition; thus we can decompose the signal into its
different components at different scale levels. In the wavelet
analysis the filter decomposes the signal into frequency bands.
In the wavelet synthesis the filter reconstructs the decomposed
signal back into the original bands.The selection of filter
determines perfect reconstruction and it also determines the
shape of the wavelet. Discrete wavelet transform has number
of advantages when applied towards ECG analysis. ECG
feature extraction is preceded by a band pass or a matched
filter to suppress the P and T waves and noises before sending
the signal for characteristic detection.

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
0.4
0.6
0.8
1
Original ECG Signal
Figure 3(a)
A
m
p
l
i
t
u
d
e
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
0
0.5
1
1.5
ECG Signal with powerline interference (50 Hz)
Figure 3(b)
A
m
p
l
i
t
u
d
e
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
0.5
0.6
0.7
0.8
0.9
1
1.1
ECG Signal with Electromyographic(EMG) Interference
Figure 8(a)
A
m
p
l i t u
d
e
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
0.4
0.5
0.6
0.7
0.8
0.9
1
1.1
1.2
1.3
ECG Signal with Abrupt Baseline Shift
Figure 7(a)
A
m
p
l i t u
d
e
International Journal of Emerging Trends in Signal Processing
Volume 1 , Issue 1 ,November 2012
25

Wavelet Selection for QRS Detection
To determine the choice of the wavelets, the properties of the
QRS must be examined. There are three properties of the ECG
that are useful for detection of the QRS complex; QRS has the
highest slope, has a characteristic shape and the event is
localized in time. The shape of the signal is maintained if the
phase shift is linear. Thus one requirement of the wavelet is
that it should be a symmetrical function. Time localization is
important because the ECG events are transient.
B. Use of Hilbert Transform

Hilbert transform is one of the most important and common
transforms used for detection of QRS complex and R wave.
The usage of this transform has been discussed in many papers
[10-13].This transform for a real sequence , extract a complex
sequence with the same length. After pre-processing
operation, Hilbert transform is used for detection of dominant
peak points in signal.

Mathematically, the Hilbert transform is defined as:

(1)
Where

is the input signal. Because the Hilbert transform
is an odd filter, the zero-crossings of the differentiated ECG,
which correspond to the R-peaks, will be represented as peaks
in the output of the transform. The Hilbert transform's all-pass
characteristic prevents unnecessary signal distortion, in
contrast to the second derivative method which tends to
attenuate the signal at the lower frequencies .Thus, the odd-
phase component of the filter provides the necessary
rectification of the differentiated ECG signal in order to
identify the QRS peaks while the uniform magnitude of the
filter ensures that necessary information of the QRS
complexes is preserved. Hilbert transform [12] has the ability
to distinguish between dominant peaks in signal among other
peaks is able to improve the results of detection of R wave.

C. Adaptive Thresholding technique

Adaptive threshold technique is one of the important steps
carried out for detection of R wave peak. Using fixed
threshold based algorithms it is observed that defining high
values for threshold leads to lack of proper detection and
defining low values causes incorrect detection of the peaks
present in the respective signal. In adaptive threshold
structure, detection is done by using a pair of threshold limits
named Upper Limited Threshold (UTH) and Lower Limited
Threshold (LTH). This algorithm works as follows [13]: If in
each stage of threshold the number of detected peak by up and
down limits is not equal, then error component is defined and
fixed value is deduced from respective limits and threshold
operation repeated. This repetition continues till the two
limits become equal or peaks detected by two limits become
equal. And at the end the final threshold limit is defined:





(2)







where

and

are value of generalized threshold
limit, and are initial values of missing and fault
threshold limits respectively, is the difference
between two defined limits. Assume that the weight of
missing detection is the same as that of the fault detection. The
most advantage is that it does not need complicated decision
and calculation of weights.
III. PROPOSED QRS DETECTION ALGORITHM
The block diagram of the proposed approach is shown in
Fig.3. The first stage of the proposed algorithm is formed by a
wavelet transform using db4 at decomposition level 3.Then
percent energy of approximation coefficient is calculated.
Differentiation operation is performed to detect R peak
followed by Hilbert transform. Finally adaptive threshold is
applied.


Fig 3. Block diagram of proposed method

In our proposed method, wavelet transform is used as pre-
processing operation and then Hilbert and adaptive
thresholding are employed as main stages of processing.
Selection of this combination by using ability of Hilbert
transformation in distinguishing zero-cross points as positive
peaks and also using wavelet transformation in dividing signal
components to various sub bands with specific time frequency
contents can provide suitable information for R-wave
detection.

International Journal of Emerging Trends in Signal Processing
Volume 1 , Issue 1 ,November 2012
26

A. Modified wavelet energy-gradient method
Because of the peculiar shape of the QRS complex, it can be
said that the energy of the signal is different during the
existence of the QRS. The energy change is attributed to the
transition from the Q point to R point and back to S point.
This energy change can be captured by decomposing the
signal with DWT at a suitable level [5]. Here db4 is used as a
mother wavelet since it is found to be most effective.
According to the presented subjects in this paper , we describe
our algorithm as follows:
Step 1: first preserve the sample locations of each sample by
creating an indexing array I(n) that corresponds to the sample
number of raw ECG signal X(n) with N elements each. On raw
ECG signal segment X1(n)= X (n) to X (n +1) perform a
three -level DWT with db4 as mother wavelet and compute
the energy of signal E(n)according to the third level
approximated DWT coefficients at each point n , with a
window(n,n+1).
D (n) =Three level DWT(X1(n)) (4)
E (n) = [D (n)]
2
(5)


Step 2: Differentiate E (n)
Y (n) = E (n+1) E (n-1) 1<n< N (6)
Pad Y (n) with a zero to make the number of elements in Y (n)
equal to X (n)
Step 3: calculate Hilbert transform of the differentiated output
H (n) = HILBERT (Y (n)) (7)
Step 4: Rectify the output of Hilbert transform
Y1 (n) = ABS H (n) (8)
Step 5: Set up original UTH and LTH , such as 50% and 10%
of maxima
UTH=50%*MAX (Y1(n)) (9)
LTH=10%*MAX (Y1(n)) (10)
Step 6: Search entire array Y1 (n) for values greater than UTH
as well as LTH.
Let N1=QRS complexes detected by UTH
Let N2=QRS complexes detected by LTH
Step 7: Compare the numbers N1 with N2. If N1 and N2
satisfies N1=N2, all QRS complexes have been determined. If
above condition is a not satisfied change value of UTH and
LTH using eq. (2) & eq.(3). Assume error Weight W same in
both cases.
W=0.125 and

(11)
So that

. Decrease the upper threshold
limit by and increase the lower threshold limit by .
Step 8: Continue the operation till we get the same QRS
number.
Step 9: Extract ECG beat
B. Database:
For the analysis of detector performance, it is necessary that a
standard database must be chosen so that the obtained results
can be interpreted with respect to that manually annotated
database. The Massachusetts Institute of Technology/Beth
Isrel Hospital (MIT-BIH) arrhythmia database is used in this
study. The database contains 48 records, each containing two-
channel ECG signals for 30 min duration selected from 24-hrs
recordings of 48 different individuals. Continuous ECG
signals are band pass filtered at 0.1-100 Hz with 11 bit
resolution over a 10mV in the range. The database contains
annotation for both timing information and beat class
information verified by independent experts. Cardiologists
have manually identified the time of occurrence and classified
the type of QRS complex anomaly for each record making it
suitable for the study. Annotated ECG signals are described
by- a text header file (.hea), a binary file (.dat ) and a binary
annotation file (.atr). Header file consists of detailed
information such as number of samples, sampling frequency,
format of ECG signal, type of ECG leads and number of ECG
leads, patients history and the detailed clinical information. In
binary data signal file, the signal is stored in 212 format which
means each sample requires number of leads times 12 bits to
be stored and the binary annotation file consists of beat
annotations. ECG signals (.dat files) downloaded from
Physionet website are first converted into MATLAB

readable
format (.mat files). The signals from both leads now become
readable separately. Then the signals from lead-II are only
taken for analysis.
C. Applications
It has many applications including R-R interval analysis, P, S
& T wave detection, feature extraction, ECG compression,
arrhythmia classification, heart rate calculation, heart rate
variability analysis.
IV. EXPERIMENTAL RESULTS
The modified Wavelet energy gradient algorithm concept is
applied on different signals of MIT-BIH Arrhythmia
Database.This algorithm is implemented in MATLAB
software. Here 2500 samples of every signal are considered
for experimentation.
Following are the results for
1. Signal 100m.mat
a) Original signal

b) Percent energy plot

c) Differentiated energy
0 500 1000 1500 2000 2500
850
900
950
1000
1050
1100
1150
1200
1250
original signal
0 500 1000 1500 2000 2500
99.85
99.9
99.95
100
% energy plot
International Journal of Emerging Trends in Signal Processing
Volume 1 , Issue 1 ,November 2012
27


d) Hilbert transform

Case i: UTH=50%Max y1(n) LTH=10%Max y1(n)



UTH = 0.0463 LTH = 0.0093
Peaks detected by UTH = 7 , Peaks detected by LTH = 9

Cae ii: UTH=45 %Max y1(n) LTH=15%Max y1(n)



UTH = 0.0417 LTH = 0.0139
Peaks detected by UTH = 7 Peaks detected by LTH = 9

Case iii: UTH=40%Max y1(n) LTH=20%Max y1(n)



UTH = 0.0371 LTH = 0.0185
Peaks detected by UTH = 9 Peaks detected by LTH = 9
All QRS complexes in ECG segment are detected accurately.


2.Signal 109m.mat



UTH=35%Max y1(n) LTH=25%Max y1(n)
UTH = 0.0066 LTH = 0.0047
Peaks detected by UTH =12 Peaks detected by LTH =12

3.Signal 118m.mat

0 500 1000 1500 2000 2500
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
differentiated energy
0 500 1000 1500 2000 2500
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
hilbert transform
International Journal of Emerging Trends in Signal Processing
Volume 1 , Issue 1 ,November 2012
28



UTH=45%Max y1(n) LTH=15%Max y1(n)
UTH = 0.0574 LTH = 0.019
Peaks detected by UTH = 9 Peaks detected by LTH = 9


A. Performance evaluation parameters
Using the above method, a QRS detector is designed and it is
tested with 2500 samples of all the 48 records in the MIT-BIH
arrhythmia database.
Following parameters are to be used for the evaluation:





Detection accuracy (DA) (in %) is defined as the percentage
of beats detected correctly with the actual beats.




Sensitivity (Se) is the fraction of ECG beats that are correctly
detected among all the ECG beats.





Positive predictivity (Pp) is the fraction of real ECG beats in
all detected beats.





Detection Error Rate (DER) is defined as the ratio of total
errors to the actual number of beats.
A false positive indicates that the algorithm detects a beat
when no beat is present; whereas false negative indicates that
the algorithm failed to detect a real beat. True positive is the
total number of beats correctly detected by the detector.
V. CONCLUSION
In this paper we tried to introduce a combinational method to
decrease the sensitivity of R peak detection procedure to
noise. According to our results, combination of wavelet
transform, Hilbert transform and adaptive thresholding has a
significant effect in detection of R wave due to impressive
characters of Hilbert and wavelet transforms. Meanwhile
using adaptive threshold technique leads to decreasing error of
determining dominant peak in such processing operations.
The advantage of this method is that no pre-processing like
filtering is required. Since the application of wavelet
transformation in electro cardiology is relatively new field of
research, many methodological aspects (Choice of the mother
wavelet, values of the scale parameters) of the wavelet
technique will require further investigations in order to
improve the clinical usefulness of this novel signal processing
technique.
REFERENCES

[1] Rahul Kher, Dr. V. K. Thakar Implementation of Derivative Based
QRS Complex Detection MethodsProceedings of 3
rd
international
conference on Biomedical Engineering and Informatics ( BMEI 2010)
[2] S.Sumathi1, Dr.M.Y. Sanavullah2, Comparative Study of QRS
Complex Detection in ECG Based on Discrete Wavelet Transform,
International Journal of Recent Trends in Engineering, Vol 2, No. 5,
November 2009
[3] N. S. V. Krishna Chaitanya, Anoop Radhakrishnan, G. Rakesh Reddy,
M. Sabarimalai Manikandan , A Simple and Robust QRS Detection
Algorithm for Wireless Medical Body Area Network IEEE,2011
[4] Cui Xiaomeng,A NEW Real-time ECG R-wave Detection Algorithm,
The 6th International Forum on Strategic Technology 2011
[5] Dr.Rajesh Ghongade , Dr. A.A. Ghatol, A Novel QRS detection
algorithm International journal of applied computing, vol 2.supp. issue
1,2009 Pages 6-13 ISSN :0974-6277
[6] U. Kohler, C. Hennig, and R. Orglmeister, The principles of software
QRS detection, IEEE Eng. in Medicine and Biology Magazine, vol. 21,
pp. 42-57, 2002
[7] J.P.Pan,A Real-Time QRS Detection Algorithm,IEEE transaction on
Biomedical Engineering 1985, 22(3):pp.230-236
[8] Gary M. Friesen, Thomas C. Jannett, M.A. Jadallah, S. L. Yates, S. R.
Quint and H. Troy Nagle, Comparison Of The Noise Sensitivity Of of
Nine QRS Detection Algorithms, IEEE Transactions on Biomedical
Engineering, vol 37, Jan. 1990, pp 85-98.
[9] P.S. Hamilton, and W.J. Tompkins," Quantitative investigation of QRS
Detection rules using the MITIBIH arrhythmia database", IEEE Trans
Biomed Eng, vol. 33(12), 1986, pp. 1157-65.
[10] Amin Farahabadi, Eiman Farahabadi, Hossein Rabbani Detection of
QRS Complex in Electrocardiogram Signal Based on a Combination of
Hilbert Transform, Wavelet Transform an Adaptive Thresholding,
Proceedings of the IEEE-EMBS International Conference on Biomedical
and Health Informatics (BHI 2012) Hong Kong and Shenzhen, China, 2-
7 Jan 2012
[11] Fei Zhang and Yong Lian, Wavelet and Hilbert Transforms Based QRS
Complexes Detection Algorithm for Wearable ECG Devices in Wireless
Body Sensor Networks proceeding of: Biomedical Circuits and
Systems Conference, 2009. BioCAS 2009. IEEE
[12] Joao P.V. Madeiroa, Paulo C. Corteza, Joao A.L. Marquesb, An
innovative approach of QRS segmentation based on first-derivative,
Hilbert and Wavelet Transforms, Medical engineering and physics
,2012,www.elsevier.com
[13] Xiomin Xu ,Ying Liu, Adaptive threshold for QRS Complex detection
based on wavelet transform,Proceedings of 27
th
annul IEEE conference
International Journal of Emerging Trends in Signal Processing
Volume 1 , Issue 1 ,November 2012
29

on Engineering in Medicine and Biology ,Shanghai,china,September1-
4,2005
[14] Natalia M. Arzeno, Zhi-De Deng, Chi-Sang Poon, Analysis of First-
Derivative Based QRS Detection Algorithms, IEEE Transaction on
Biomedical Engineering. 2008 February ; 55(2): 478- 484.
[15] U. Kohler, C. Hennig, and R. Orglmeister, The principles of software
QRS detection, IEEE Eng. in Medicine and Biology Magazine, vol. 21,
pp. 42-57, 2002
[16] P.Kathirvel , M.Sabarimalai Manikandan, An Efficient R-Peak
detection based on New Nonlinear Transformation and First-Order
Gaussian Differentiator, BMES Cardiovascular Engineering and
Technology, Vol 2, No.4, December 2011.pp408-425.
[17] Francisco Ivan de Oliveira and Paulo CBsar Cortez, A QRS Detection
Based On Hilbert Transform And Wavelet Bases, IEEE Workshop on
Machine Learning for Signal Processing,2004, pp. 481-489
[18] S. Kadambe, Robin, G.Faye Wavelet transform based QRS complex
Detector, IEEE Transactions on Biomedical Engineering., vol. 46,
July. 1999. pp. 838848.
[19] Yuliyan Velchev, Ognian Boumbarov, Wavelet Transform Based ECG
Characteristic Points Detector, International Scientific Conference
Computer Science, 2008, pp.49-54.
[20] Tan, K.F.; Chan, K.L.; Choi, K; Detection of the QRS complex, P wave
and T-wave in electrocardiogram, First International Conference on
Advances in Medical Signal and Information Processing, 2000, Pages:
41 47.
[21] R. M. Rangayyan, "Biomedical Signal Analysis: A Case Study
Approach", JohnWiley & Sons, Inc., 2002.
[22] MIT-BIH arrhythmia database (http://www.physionet.org)

También podría gustarte