QRS Detection in ECG
QRS Detection in ECG
Abstract- Electrocardiogram (ECG) signal is one of the complication of their designing and instruction. Also using
most important and most used biologic signals which have a Hilbert transforms [9] which has the ability to distinguish
significant role in diagnosis of heart diseases. Extraction of dominant peaks in signal among other peaks, has a
QRS complex and obtaining its characteristics is one of the
considerable effect in improvement of R wave detection.
most important parts in ECG signal processing. R wave is one
of the main sections of QRS complex which has the essential Generally, for detection of R wave in ECG signal a
role in determining and diagnosis of heart rhythm thresholding method is needed. The effect of using adaptive
irregularities and also in determining heart rate variability
threshold which by automatic determination of threshold
(HRV). In this paper, we suggest a new algorithm by using a
combination of Hilbert transform, wavelet transform and
provides suitable results for detection of R wave peak, have
adaptive thresholding. We apply our algorithm on various been investigated in [10]. After detection of R wave the Q
ECG signals to evaluate its performance and see the proposed and S waves can be found (for this work after detection of R
method outperforms other methods. All signals proposed in this wave, 160 msec before and 240 msec after this wave called
paper except signals used in modeling part (that use simulated Q and S waves).
ECG signal in "MATLAB" software) are form MIT-BIH
database. This paper by using Hilbert and wavelet Transformations
as well as adaptive threshold technique, which is one of the
I. INTRO DUCTION most used techniques for detection of QRS complex and R
ETECTION ofQRS complex is one of the most important wave, is going to represent an optimal combination of these
D parts carried out in the electrocardiogram (ECG) signal methods. Obviously such combination must have minimum
sensitivity to agitations in the signal or to artifacts in
analysis. Various methods employed by experts for detection
of QRS complex. Balda, et. al [1] used differentiator environment of recording signal. In fact, in this paper we try
operator in order to detect QRS complex, later this method to decrease the sensitivity to noise by selecting an optimal
was developed by Ahlstrom and Tompkins [2]. Friesen [3] combination of recently presented methods. In Section II the
and Tompkins [4] also investigated similar methods based proposed method is presented, Section III is dedicated to
on detection ofQRS complex in noisy cases. Using ordinary simulation results, and this paper is concluded in Section IV.
filter is another method used for this purpose, but its high
sensitivity to noise and its incompatibility with frequency of II. PRO POSE D METHO D
input disorders cause errors in output of relative function. In our proposed method, differentiation technique is used
The wavelet filters [5] were also proposed for solving this as pre-processing operation and then Hilbert and wavelet
problem and considerably improve the results of QRS transforms and adaptive thresholding are employed as main
detection. stages of processing. In the main processing step, at first
Hilbert transform is calculated and then by using wavelet
In addition to the proposed methods, experimental
transformation, signal is divided to 4 subbands and adaptive
techniques and averaging methods in signal decomposition
thresholding is applied on the second subband.
in order to find R peak [6], using partial derivatives and
wavelet transform [7] and also methods based on neural Selection of this combination by using ability of Hilbert
network [8] for detection of QRS complex and R wave have transformation in distinguishing zero-cross points as positive
been presented. Methods based on experimental techniques peaks and also using wavelet transformation in dividing
or differentiation usually have high sensitivity to noise, and signal components to various subbands with specific time
methods based on neural network are less used because of frequency contents can provide suitable information for R
wave detection. It should be noted that in this stage, the
Amin Farahabadi, and Eiman Farahabadi are with Biomedical
second subband is used as reference subband (based on
Engineering Dept.,School of Medicine,Isfahan Univ. of Medical Sciences,
Isfahan,Iran. intuitional results) and thresholding is done on the data of
H. Rabbani is with Biomedical Engineering Dept., Medical Image & this subband.
Signal Processing Research Center, Isfahan Univ. of Medical Sciences,
Isfahan,Iran (corresponding author to provide phone: 98-311-79 22474; fax :
98-3I 1-7922362;e-mail : h_rabbani@med. mui.ac.ir).
Mohammad Parsa Mahjoub is with School of Medicine,Shahid Beheshti
Univ. of Medical Sciences,Tehran,Iran.
Authorized licensed use limited to: VIT University. Downloaded on September 15,2020 at 23:53:45 UTC from IEEE Xplore. Restrictions apply.
A. QRS Complex Detection by Using Differentiator c. Wavelet Transform
Operator Wavelet transform is a linear operator that analyzes
Detection of QRS complex and specially detection of R signal to components and scales that each of them represents
wave in heart signal is easier than other kinds of signal a specific resolution and time-frequency content. In L2(R)
presented in the heart. The reason is its structural form and domain, \jI (t) is called wavelet, if and only if its Fourier
high range. In two last decades a large number of methods transform 'I'(w) meet the following condition:
have been proposed for detection of this complex such as:
+ 2
methods of differentiation [11], digital filters [12], filter f OO IIfi(w)1 d w -
-00
--
- C'1'<00 (4)
Iwl
banks [13], hidden Markov models [14], genetic algorithm
This requires:
[15] and so on.
t: \I'(t)dt= 0 (5)
Usually in the differentiation method, QRS complex is that indicates vibration nature of wavelet. Normalized
identified by using first and second order derivatives and wavelet transform of function f(t) in scale a and in time
then windowing technique is used in order to have a position T is given by this expression:
smooth signal. The following formulas describe this
procedure for input signal x(n). CWTt<a,T)= � too f(t)ljJ(t-T)dt
"Ial -00 a
(6)
Yo(n) = [x(n) - x(n - 2)] (l.a) In practice, wavelet transform that is a linear time
frequency transform preserves signal energy and is a
Y1(n) = [x(n) - 2x(n - 2) + x(n - 4)] (l.b)
reversible function. In this paper Daubechies wavelet 4 (db4)
Y2(n) = 1.3Yo(n) + 1.1Y1(n) (I.c) has been used for further processings.
Y3(n) = 1/8 Lr=o Y2(n - k) (l.d)
D. Adaptive Threshold Technique
B. Hilbert Transform Adaptive threshold technique is one of the significant
Hilbert transform is one of the most important and parts carried out for detection of R wave peak. Various
common transforms used for detection of QRS complex and methods have been used for this purpose including works by
R wave. The usage of this transform has been discussed in Shubsa [17] and Li [18]. Using experimental threshold
many papers such as [16]. Hilbert transform of real function based algorithms it is observed that defining high values for
f(t) (that is generally a complex sequence) is defmed as: threshold leads to lack of proper detection and defining low
1 +OO dT 1 values causes incorrect detection of the peaks present in the
H{f(t)}=-- f f(1:)-= - -* f(t) (2) respective signal. In adaptive threshold structure, detection is
TI T-t
-00
TIt
Since Hilbert transformation is defined as convolution done by using a pair of threshold limits named Up Limited
between functions f(t) and -lint, by using definition of Threshold (ULT) (eq. 7) and Down Limited Threshold
Fourier transform F{f(t)}= t::: !(t)e-jwtdw= FUw) (DLT) (eq. 8). The proposed algorithm works as follows
[17-18]: If in each stage of threshold the number of detected
we have:
peak by up and down limits is not equal, then error
F{H{f(t)}}= jsgn(w)F(jw) (3) component is defmed and deduced from respective limits
where sgn is sign function. In fact because this transform is and threshold operation repeated. This repetition continues
odd, zero-cross points of ECG signal are formed as till the two limits become equal. And at the end the final
dominant peaks in output of this transform. After pre threshold limit is defined:
processing described in Section II-A, Hilbert transform is
applied to data for detection of dominant peak points of
THm+l = THm - WmLl (7)
signal. Figure 1 shows the results of using Hilbert transform THf+1 = THf - WfLl (8)
to an ECG signal from the MIT-BIH database. where THf+1 and THm+l are value of generalized threshold
limit, and THf and THm are initial values of threshold limit,
.� �
Ll = ITHm - THf I is the difference between two defined
limits. Values of parameters Wf and Wm is factor of error
weight which in each stage has a different value with regard
to the number of incorrect detected peaks.
o 500 1 000 1 500 2000
E. Our Algorithm
Hilbert Transform
According to the presented subjects in this paper, we
":fl. iiI. jJ
o 500 1 000 1 500 2000
describe our algorithm as follows:
Fig. I: An ECG signal used in this experiment and its Hilbert transform
171
Authorized licensed use limited to: VIT University. Downloaded on September 15,2020 at 23:53:45 UTC from IEEE Xplore. Restrictions apply.
1) Applying differentiator operator percentage of valid QRS detection. The results are
concluded in Table I. According to the results of this table,
2) Hilbert transformation
we understand that HWAT algorithm has lowest level of
3) Wavelet transformation sensitivity to noise and WA T and HAT are in the next
stages. In fact for high level noise, HWAT is able to detect
4) Choose second subband (high frequency component)
40% of QRSs while HAT completely fails and WAT is able
and apply adaptive thresholding method
to only detect 20% ofQRSs.
5) Convert the selected position of peak from wavelet T A BLE I
domain to signal domain (according to the proposed COMPARING BETWEEN SEVERAL QRS DETECTION METHODS IN VARIOUS
scale) LEVELS OF NOISE
Methods +5 db o db -5 db
Figure 2 illustrates a sample ECG signal from MIT-BIH
HAT 1 00% 1 00% 0%
database and the extracted peak of this signal using our
WAT 1 00% 1 00% 20%
method (HWAT).
HWAT 1 00% 1 00% 4 0%
:� o 500 1 000
Hilbert Transform
1500 2000
IV. CONCLUSION
:l j� ll� i JJ
technique based on applying Hilbert transform, wavelet
o
transform and adaptive thresholding. According to the
[I] R. A. Balda ,G. Dilier ,E. Deardorff,J. Doue and P.Hsieh ," The H P
III. OBTAINED RESULTS FROM APPLYING OUR ECG Analysis Program " ,In van Bemmel JH and Willems JL ,editor
,Trends in Computer processed Electrocardiograms ,pp . 197-205 ,
ALGORITHM ON THE SIMULATED ECG SIGNAL North Holland , Amsterdam ,The Netherlands ,197 7.
In this section, ECG signal is modeled by Matlab [2] ML. Ahlstrom and WJ.Tompkins "Digital Filter For Real-Time ECG
software as Figure 3 (the period is 700 samples and unit Signal Processing using microprocessors" ,IEEE Trans Biomed Eng ,
vol. 32,pp. 7 08-71 3 ,1985
amplitude).
[ 3] GM.Friesen , TC. 1annett , MA. 1adaliah , SL. Yates , SR. Quint and
HTNagle,"A Comparison of the Noise Sensitivity of 9 QRS detection
Simulated Signal algorithms",IEEE Trans Biomed Eng,vol. 37 ,pp. 85-97,199 0
1 �------�--,
[4] WJ.Tompkins ," Biomedical Digital Signal Processing " , Prentice
Hall ,Upper Saddle River ,NJ ,1995
0.5
[5 ] A. A1exandridi ,T. Panagopoulos ,G. Manis ,G. Papakonstantinou ," R
o
Peak Detection with Alternative Haar Wavelet Filter " IEEE Trans
Biomed Eng ,vol. lO,pp. 219-222,14-17 Dec. 2003
-0.5 [6] AJ. Nimunkar and WJ. Tompkins ," R-Peak Detection and Signal
Averaging For Simulated Strees ECG Using EM D " , 29 th Annual
-1 �------�--� International IEEE,pp. 1261-1264 ,22-26 Aug. 2007
o 1000 2000 3000
[7 ] N. M. Arzeno,C.S. Poon,and Z. De Deng ," Quantitative Analysis
Figure 3: Simulated ECG signal
of QRS Detection Algorithms Based on the First Derivative of the
ECG" ,Conf Proc IEEE Eng Med Bioi Soc. ;1 Yol. I ,pp. 1788-1791
,2006
The main purpose of this section is comparison between
[8] R. M. Rangayyan ," NN-Based R-peak detection in QRS Complex of
our method (that is based on applying Hilbert, and wavelet ECG Signal Biomedical Signal Analysis " , Book 4 ht Kuala Lumpur
transforms and adaptive thresholding) and other methods Int Conf Biomed Eng ,Yol. 21 ,pp. 217-220, July 3 0, 2008
that are only based on Hilbert transform and adaptive [9] DS Benitez, PA Gaydecki,A Zaidi,AP Fitzpatrick 2 ,"A New QRS
Detection Algorithm Based on the Hilbert Transform " , Comput
thresholding (HAT) or wavelet transform and adaptive
Cardio pp. 379 -382,2000
thresholding (WAT). For this reason, we add Gaussian noise X. Xu, Y.Li,"Adaptive Threshold for QRS Complex Detection Based
[1 0]
in various levels to the simulated ECG signal and apply our on Wavelet Transform " 27 th Annual Inte Conf IEEE Eng Med Bioi
method (HWAT), HAT and WAT on data and compare the Soci,pp. 7 281 -7 284 , 01-04 Sept. 2005
172
Authorized licensed use limited to: VIT University. Downloaded on September 15,2020 at 23:53:45 UTC from IEEE Xplore. Restrictions apply.
[II] M. L. Ahlstrom and W. J. Tompkins,"Automated high-speed analysis
of holter tapes with microcomputers" , IEEE Trans Biomed Eng ,
vol. 3 0,pp. 651-657,Oct. 1983
[12] P.S. Hamilton and W. J. Tompkins,"Quantitative investigation of QRS
detection rules using the MIT/BIH arrhythmiac database" , IEEE
Trans Biomed Eng ,vol. 3 3,pp. 115 7-1165,1986.
[1 3] Z. Dokur,T. Olmez,E. Yazgan,and O.K. Ersoy ,"Detection of ECG
waveforms by neural networks " , Med Eng Phys , vol. 19,no. 8,
pp. 7 38-7 41,1997.
[14] V.x. Afonso,W. J. Tompkins, T. Q. Nguyen and S. Luo,"ECG beat
detection using filter banks," IEEE Trans Biomed Eng , vol. 46,
pp. 192-202,1999
[15 ] D. A. Coast ,R. M. Stern, G. G. Cano and S. A. Briller," An approach
to cardiac arrhythmia analysis using hidden Markov models" , IEEE
Trans Biomed Eng ,vol. 37,pp. 826-836, 199 0.
[16] R. Poli,S. Cagnoni,and G. Valli," Genetic design of optimum linear
and nonlinear QRS detectors " ,IEEE Trans Biomed Eng , vol. 42,
pp. 11 37-1141,1995.
[17 ] K. Shubha,M.Robin and B.G.Fays ," Wavelet Transform Based QRS
Complex Detector " , IEEE Trans Biomed Eng , vol. 46 , no. 7 ,
pp. 838-848,1999.
[18] C.Li,C.Zheng and C.Tai ,"Detection of ECG Characteristic points
using Wavelet Transform" ,IEEE Trans Biomed Eng ,vol. 42 ,no . 1
,pp. 21-28,1999.
173
Authorized licensed use limited to: VIT University. Downloaded on September 15,2020 at 23:53:45 UTC from IEEE Xplore. Restrictions apply.