# INTRODUCTION he Electrocardiogram signal which represents the electric activity of the heart is characterized by a periodic behaviour or quasi periodical. It is typically composed of three called significant waves; P wave, QRS complex and T wave (see fig. 1). The detection of the R-peaks and consequently of the QRS complexes in an ECG signal provides information on the heart rate, the conduction velocity, the condition of tissues within the heart as well as various other abnormalities and, thus, it supplies evidence to support the diagnoses of cardiac diseases. For this reason, it has attracted considerable attention over the last three decades. The algorithms in the relevant bibliography adapt a range of different approaches to yield a procedure leading to the identification of the waves under consideration. These approaches are mainly based on derivative-based techniques [1], [2], classical digital filtering [3]- [5], adaptive filtering [6], [7], Tompkins method [8],wavelets [9], Christov's algorithm [10], genetic algorithms [11], Hilbert Transform [12] and zero-crossing-based identification techniques [13]. The Empirical Mode Decomposition (EMD) is a new method designed by N. E. Huang for nonlinear and non-stationary signal analysis [14]. The key part of this method is that any complicated data set can be decomposed into a finite and often small number of Intrinsic Mode Functions (IMFs) that admits well behaved Hilbert transforms. This decomposition method is adaptive, and, therefore, highly efficient. Since the decomposition is based on the local characteristic time scale of the data, it is applicable to nonlinear and nonstationary processes. The major advantage of the EMD is that the basis functions are derived from the signal itself. Hence, the analysis is adaptive, in contrast to the wavelet method where the basis functions are fixed. In this paper, a detection method based on the EMD approach is proposed. The EMD is based on the sequential extraction of energy associated with various intrinsic time scales of the signal starting from finer temporal scales (high frequency modes) to coarser ones (low frequency modes). The total sum of the IMFs matches the signal very well and therefore ensures completeness. In this paper, the EMD is used for ECG QRS complex detection. Therefore, the algorithm consists of several steps, namely, band-pass Butterworth filter, decomposition of the ECG signal into a collection of AM-FM components (called Intrinsic Mode Functions (IMF)), sum the first three Intrinsic Functions Mode (IMFs), and take its absolute value, retain the amplitudes, find the position of the maximum. The proposed algorithm is evaluated by using the ECG MIT-BIH database [15] and is compared to other methods. As we will show later, very promising results are obtained. The number of extrema and the number of zero crossings must differ by at most 1. ii. # II. EMPIRICAL MODE DECOMPOSITION At any point the mean value of the envelope defined by maxima and the envelope defined by minima must be zero. # a) Sifting Process The basic principle of this method is to identify the intrinsic oscillatory modes by their characteristic time scales in the data empirically and then decompose the data. A systematic way to extract the IMFS is called the Sifting Process and is described below: 1. Identify all the extrema (maxima and minima) of ( ) t x .( ) ( ) ( ) [ ] 2 max min t e t e t m + = . 4. Get an IMF candidate from ( ) ( ) ( ) t m t x t h ? = (extract the detail). # Check the weather properties ( ) t h i is an IMF. If ( ) t h i is not an IMF, repeat the procedure from step 1. If ( ) t h i is an IMF, then set ( ) ( ) t h t x r i ? = and then i i c t h = ) () ( ) ( ) ? = + = n i n i t r t c t x 1 (1) In practice, after a certain number of iterations, the resulting signals do not carry significant physical information. To prevent this, we go for some boundary conditions. We can stop the sifting process by limiting the normalized standard deviation (SD). The SD is defined as: ( ) ( ) ( ) ( ) ( ) ? = ? ? ? = T t k k k t h t h t h SD 0 2 1 1 2 1 1 1 (2) The SD is set between 0.2 and 0.3 for proper results [14]. When the SD is smaller than a threshold, the first IMF component from the data, designated as ( ) ( ) t h t c k 1 1 = (3) is obtained. Then ( ) t c 1 is separated from ( ) t x to obtain ( ) ( ) ( ) t r t c t x 1 1 = ? (4) Since the residue, ( ) t r 1 still contains information of longer period components, it is treated as the new data and subjected to the same sifting process as described above. This procedure can be repeated on all the subsequent ( ) t r i , and the result is ( ) ( ) ( ) N i t r t c t r i i i ,........, 1 , 1 = = ? ? (5) where ( ) ( ) The sifting process was applied on an ECG signal to obtain the various IMFs. This has been represented in Fig. 2 and Fig. 3. The EMD method is a powerful tool for analyzing ECG signal. It is very reliable as the base functions depend on the signal itself. EMD is very adaptive and avoids diffusion and leakage of signal. We first apply a moving average filter of order 5 to the signal. This filter removes high frequency noise like interspersions and muscle noise. Then, drift suppression is applied to the resulting signal. This is done by a high pass filter with a cut off frequency of 1Hz. Finally, a low pass Butterworth filter with a limiting frequency of 30 Hz is applied to the signal in order to suppress needless high frequency information even more. Fig. 5 illustrates respectively; noisy ECG signal (record 101) ( ) n s , and the resulting filtered ECG signal ( ) t x t r = 0 and ( ) t c i is the ith IMF ofn s r . b) Decomposing ECG into IMFs The primary EMD is applied on ( ) t x and the IMFs are obtained to locate the fiducial points in the ECG signal. The EMD of ( ) t x (equation 1) is given by [14], where ( ) t c i is the ith IMF and ( ) t r n is the residue. The IMFs are obtained by applying EMD on the filtered ECG signal ( ) t x . These IMFs and the ECG signal are then used to determine the fiducial points of the ECG signal. # c) R Peak Detection Since the R wave is the sharpest component in the ECG signal, it is captured by the lower order IMFs which also contain high frequency noise. Past analysis using the EMD of clean and noisy ECG indicates that the QRS complex is associated with oscillatory patterns typically presented in the first three IMFs [16]. In our analysis, we have also found similar results. We denote the sum of first three IMFs as fine to coarse three, ( ) t c f 3 2 given by ( ) ( ) ? = = 3 1 3 2 i i t c t c f (6) The oscillations associated with QRS complex in (ii) Retain the amplitudes of ( ) t a larger than a threshold, T, where T is statistically selected to be half of the maximum value of ( ) t a and make others zero. This eliminates the noise. Find the position of the maximum of a segment of time duration R t starting from the first non zero value of ( ) t a (Fig. 7). This is the first R-peak position. Similarly, find all other R-peak positions until the end of ( ) n c f 3 2 RR Peak detection ( ) t imf 2 ( ) t imf 3 ( ) t imf 1 ( ) t xt a is reached. According to the width of QRS complex which is normally 100 ms with variation of ± 20 ms [6], we select R t to be about 200 ms. We have considered the absolute value of ( ) t c f 3 2 since R-wave, and thus ( ) t c f 3 2 , give a negative peak in some ECG leads. After finding the R-peak position, 0 t , we can find whether the peak is positive or negative from the value of ( ) IV. 0 3 2 t c f . If # RESULTS AND DISCUSSION The algorithm was tested against a standard ECG database, i.e. the MIT-BIH Arrhythmia Database. The database consists of 48 half-hour ECG recordings and contains approximately 109,000 manually annotated signal labels. ECG recordings are two channel, however for the purpose of QRS complex detection only the first channel was used (usually the MLII lead). Database signals are sampled at the frequency of 360 Hz with 11-bit resolution spanning signal voltages within ±5 mV range. QRS complex detection statistic measures were computed by the use of the software from the Physionet Toolkit provided with the database. The two most essential parameters we used for describing the overall performance of the QRS complex detector are: sensitivity Se and positive predictivity +P. The sensitivity and positive predictivity of the detection algorithms are computed by Detection of QRS Complexes in ECG Signals Based on Empirical Mode Decomposition Therefore, the R-peak detection comprises the following steps which are also illustrated in Fig. 7 for a series of ECG beats. where TP is the number of true positives, FN the number of false negatives, and FP the number of false positives [17]. The sensitivity reports the percentage of true QRS complexes that were correctly detected. The positive predictivity reports the percentage of detected QRS complexes which were in reality true QRS complexes. Table The average sensitivity of the algorithm is 99.82% and its positive predictivity is 99.89 %. The EMD method is found to have a good sensitivity and predictivity. Moreover this method is much more evolved than others. It is because the fast oscillatory QRS complex is highly detectable in the lower order IMFs irrespective of other characteristic wave amplitude. # Algritms P (%) Se (%) Proposed Algorithm 99.89 99.82 Kohler [13] 88.70 99.57 Pan [8] 99.07 98.55 Zheng [9] 98.07 94.18 Christov's [10] 99.65 99.74 Martineze [18] 99.86 99.80 Madeiro [19] 98.96 98.47 Table .2 : Comparison of the performance. Comparing the sensitivity and predictivity of the different methods in Table . 2 we find that EMD is a better choice for R peak detection. V. # CONCLUSION We have developed a new algorithm based on the EMD for the automatic detection of QRS complex. The algorithm is evaluated for all of records obtained from the MIT-BIH. The proposed algorithm exhibits better performance than the threshold based technique and achieves high sensitivity Se=99.82 % and predictivity P=99.89 % for the QRS complex detection. The EMD method works not only for lead II but also for other leads. Only three lower order IMFs are needed to completely identify the QRS complex in the ECG signal. 1![Fig.1 : An ECG bit with typical parameter values.](image-2.png "Fig. 1 :") 3![cubic spline through the maxima, and similarly, find the lower envelope ( ) t e min of the minima. Compute the average:](image-3.png "3 .") ![The procedure from step 1 to step 5 is repeated by sifting the residual signal. The sifting processing ends when the residue r satisfies a predefined stopping criterion. The by a linear superposition as given in equation 1.](image-4.png ".") ![](image-5.png "(") ![or when the residue ( ) t r n becomes a monotonic function. Combining equation 4 and equation 5 yields the EMD of the original signal.](image-6.png "") 2![Fig.2 : An ECG signal (201 of MIT-BIH database) containing 1000 samples.](image-7.png "Fig. 2 :") 3![Fig.3 : The various IMFs of the ECG signal.](image-8.png "Fig. 3 :") 4![Fig.4 : Block diagram describing the structure of our QRS complex detection.](image-9.png "Fig. 4 :") 3![are much larger than those due to noise. Fig.t x for a single ECG beat. It reveals that the R-peak in the ECG signal is detected by the peak of ( ) Detection of QRS Complexes in ECG Signals Based on Empirical Mode Decomposition](image-10.png "3 2.") 2011![Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XX Version I 13 (i) Sum the first three IMFs to get](image-11.png "Wander © 2011") 5![Fig.5 : (a) original ECG signal 222; (b) output of the band-pass Butterworth filter.](image-12.png "Fig. 5 :") 6![Fig.6 : Illustration of the QRS complex detection.](image-13.png "Fig. 6 :") 7![Fig.7 : steps for the R-peak detection.](image-14.png "Fig. 7 :") ![Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XX Version I](image-15.png "") 8![Fig.8 : (a) original ECG signal 100; (b) output of the band-pass Butterworth filter (in blue) and QRS detected (in red).](image-16.png "Fig. 8 :") 9![Fig.9 : (a) original ECG signal 105; (b) output of the band-pass Butterworth filter (in blue) and QRS detected (in red).](image-17.png "Fig. 9 :") 10![Fig.10 : (a) original ECG signal 108; (b) output of the band-pass Butterworth filter (in blue) and QRS detected (in red).](image-18.png "Fig. 10 :") 11![Fig.11 : (a) original ECG signal 119; (b) output of the band-pass Butterworth filter (in blue) and QRS detected (in red).](image-19.png "Fig. 11 :") .(a)(b) Se=TPFN TP +(7)Record Total No. (No. of beats)FPFNSeP100227300100100+P=FP TP TP +(8)101 102 1031865 2187 20840 000 10100 99.95 100100 100 10010422302199.9699.9110525720399.8899.6110620275299.90 99.751072137001001001081763714 99.21 99.6010925320299.9210011121240199.951001122539001001001131795001001001141879001001001151953001001001162412014 99.4210011715351010099.9311822750010010011919870010010012118630199.9510012224762010099.9212315180010010012416190199.941002002601210 99.62 99.922011963015 99.2410020221361299.91 99.952032982229 99.03 99.9320526560799.7410020718621426 98.60 99.242082956010 99.6610020930048199.97 99.732102647415 99.499.8521227481010099.9621332512399.91 99.9421422624399.87 99.8221533636199.999.8221722081199.9599.952192154310 99.5499.8622020482010099.90221242715199.9699.39222248405 99.801002232605111 99.5899.962282053142 99.9099.32230225625 99.7899.91231188600100100232178051 99.9499.72233307901 99.97100234275305 99.82100Total109809114204 99.8299.89 © 2011 Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XX Version I 11 December © 2011 Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XX Version I 12 © 2011 Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XX Version I 15 © 2011 Global Journals Inc. (US) December © 2011 Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XX Version I DecemberEngineering & Physics 29, pp.26-37, 2007. * ECG beat detection using filter banks XAfonso WJTompkins TQNguyen SLuo IEEE Trans. Biomed. Eng 46 1999 * QRS wave detection JFraden MRNeumann Med. Biol. Eng.Comput 18 1980 * Novel real-time R wave detection algorithm based on the Vectorcardiogramfor accurate gated magnetic resonance acquisitions SEFischer SAWickline CHLorenz Magn. Reson. Med 42 2 1999 * Nonlinear high pass filter for R-wave detection in ECG signal LKeselbrener MKeselbrener SAkselrod Med. Eng. Phys 19 5 1997 * A new parallel concept for QRS complex detector JLeski ETkacz Proc. 9th Annu. Conf. IEEE Engineering in Medicine and Biology Society 9th Annu. Conf. IEEE Engineering in Medicine and Biology SocietyBoston MA Nov 1987 Proc. 14th Annu. Int. Conf. IEEE detection problem * QRS feature extraction using linear prediction KPLin WHChang IEEE Trans. Biomed. Eng 36 1989 * A Real-Time QRS Detection Algorithm JPan Tompkins Wj IEEE Transactions on Biomedical Engineering 32 1985 * Detection of ECG Characteristic Points Using Wavelet Transforms CLi CZheng CTai IEEE Transactions on Biomedical Engineering 42 1995 * Real time electrocardiogram QRS detection using combined adaptive Threshold IIvaylo Christov BioMed.Eng.Online 3 28 2004 * Genetic design of optimum linear and nonlinear QRS detectors RPoli SCagnoni GValli IEEE Trans. Biomed. Eng 42 1995 * The real-time detection of QRS complex using the envelop of ECG SKZhou JTWang JRXu Proc. 10th Annu. Int. Conf 10th Annu. Int. ConfNew Orleans, LA; New Orleans, LA 1988 38 * The principles of software QRS detection BUKohler CHennig ROrglmeister Engineering in Medicine and Biology Magazine 21 Jan.-Feb. 2002 IEEE * The empirical mode decomposition and hilbert spectrum for nonlinear and nonstationary time series analysis NEHuang ZShen SRLong MCWu HHShih QZheng NCYen CCTung HHLiu Proc.R. Soc. Lond 1998 * ECG signal denoising and baseline wander correction based on the empirical mode decomposition MBVelasco BWeng KEBarner Comput.Bio. Med 38 2008 * Testing and reporting performance results of cardiac rhythm and ST segment measurement algorithms 1998 AAMI Recommended Practice/American National Standard * Awavelet-based ECG delineator: evaluation on standard databases JPMartinez RAlmeida SOlmos ARocha PLaguna Detection of QRS Complexes in ECG Signals Based on Empirical Mode Decomposition Engineering in Medicine and Biology Society 51 2004. 1992 Part * Time recursive prediction techniques on QRS 19 AKyrkos EGiakoumakis GCarayannis PVJoào PauloCMadeiro Cortez IFrancisco * A new approach to QRS segmentation based on wavelet bases and adaptive threshold technique RobsonSOliveira Siqueira IEEE Trans Medical