detection of qrs complexes of ecg recording based on

0 downloads 0 Views 712KB Size Report
Fig.2 ECG waveform of database lead V1. Fig.3 ECG waveform of database V2 ... Practical result by matlab code of lead aVL. The first R peak occurs at : 131.
Ruchita Gautam et. al. / International Journal of Engineering Science and Technology Vol. 2(7), 2010, 3038-3044

DETECTION OF QRS COMPLEXES OF ECG RECORDING BASED ON WAVELET TRANSFORM USING MATLAB RUCHITA GAUTAM Deptt. of Electronics & Communication Engineering, MAIIT, Kota, Rajasthan, India E-mail : [email protected] ANIL KUMAR SHARMA** Deptt. of Electronics & Communication Engineering, Institute of Engineering & Technology, Alwar- 301 030, Rajasthan, India E-mail : [email protected]

Abstract: The electrocardiogram (ECG) is quite important tool to find out more information about the heart. The main tasks in ECG signal analysis are the detection of QRS complex (i.e. R wave), and the estimation of instantaneous heart rate by measuring the time interval between two consecutive R-waves. After recognizing R wave, other components like P, Q, S and T can be detected by using window method. In this paper, we describe a QRS complex detector based on the Dyadic wavelet transform (DyWT) which is robust in comparison with time- varying QRS complex morphology and to noise. We illustrate the performance of the DyWT-based QRS detector by considering problematic ECG signals from Common Standard for Electrocardiography (CSE) database. We also compare and analyze its performance to some of the QRS detectors developed in the past. Keywords: CSE, Dyadic wavelet transform, Heart rate, Multi resolution, Wavelet transform. 1. Introduction The electrocardiogram (ECG) signal is a recording of the heart’s electrical activity and provides valuable clinical information about the heart’s performance. The electrical activity during the cardiac cycle is characterized by five separate waves of deflections designated as P, Q, R, S and T [3]. The QRS complex is generally chosen for the detection of Cardiac arrhythmias, such as an irregular heart rate. The detection of QRS complex, specifically, the detection of the peak of the QRS complex, or R wave, in an ECG signal is a difficult problem since it has a time-varying morphology and is subject to physiological variations due to the patient and to corruption due to noise. Direct visual monitoring of ECGs by human being is a tough task whose monotony increases the loss of clinical information. To this poser great efforts have been made to develop analog and digital systems for ECG analysis. Computer based ECG analysis system have proved to be more efficient, having made possible rapid retrieval of data for storage and techniques of data presentation whose clinical utility is evident. In the last decade many approaches to QRS detection have been proposed, involving artificial neural networks, real time approaches [17], genetic algorithms, and heuristic methods based on nonlinear transforms and filter banks. As noted in [2], most of the current QRS detectors can be divided into two stages: a preprocessor stage to emphasize the QRS complex and a decision stage to threshold the QRS enhanced signal. Typically, the preprocessor stage consists of both linear and nonlinear filtering of the ECG. Recognition of ECG wave starts with the R identification; with the help of Wavelet transform [7]. The wavelet transform [10], which has been used in biomedical signal processing also, has its role in ECG characterization and QRS detection. To overcome the limitations imposed by fixed duration windowing techniques in detecting time-varying transients, a general, adaptive technique that captures the spectral/temporal variations in QRS morphology is needed.

ISSN: 0975-5462

3038

Ruchita Gautam et. al. / International Journal of Engineering Science and Technology Vol. 2(7), 2010, 3038-3044 Here one such technique based upon the discrete wavelet transform [16] is dyadic wavelet transform (DyWT) is proposed. A chosen “mother wavelet” has a fixed shape; however, the wavelet functions derived from it by changing scales, referred to as “daughter” wavelets, have different bandwidths and time supports. At any particular scale, the DyWT is the convolution of the signal and a dyadically time-scaled daughter wavelet. Scaling the mother wavelet is the mechanism by which the DyWT adapts to the spectral and temporal changes in the signal being analyzed. However, in our approach a specific spline wavelet, suitable for the analysis of QRS complexes is designed and the scales are chosen adaptively based on the signal. The DyWT inherently has a multi resolution capability. For small scale values, it exhibits high temporal and low spectral resolution whereas for large scale values, it exhibits low temporal and high spectral resolution. A multi-resolution approach to signal analysis using the Wavelet Transform has been previously applied in many fields. The DyWT has been previously applied to ECG analysis in the context of detecting Ventricular Late Potentials (VLP's), and separating the various waves (P, R & T) in the ECG. In this paper, we are mainly interested in detecting R waves for estimating the heart rate. Here a QRS detector based on the DyWT is described that is robust both to noise and to non-stationarities in the QRS complex. . 2. What is Dyadic Wavelet Transform (DyWT) ? In this section, we review the DyWT and list the properties that are useful for ECG signal analysis. The DyWT of a signal x (t) is defined as shown in equation (1), [7]

Both the center frequency and bandwidth of the filters vary inversely with scale, such that the ratio of the center frequency to the bandwidth (quality factor, Q) is constant. Thus the DyWT is a "constant-Q" analysis. The variable band width introduces different resolutions at different scales and hence, the DyWT also has a multiresolution capability. The important properties of the DyWT are as follows: 

the DyWT is linear



the DyWT is time shift invariant



the DyWT is scale invariant



if the signal z(t) or one of its derivatives exhibits a discontinuity, then the modulus of the DyWT of x(t), │DyWTx(b, 2i)│, exhibits local maxima around the point of discontinuity and the lines of constant phase of the DyWTx(b, 2i) converge toward the point of discontinuity.

3. QRS Detection using DyWT The flow chart depicting the QRS detection by using wavelet transform is shown in Fig.1. We Compute the DyWT of a windowed portion of length Lw seconds of an ECG signal at the dyadic scales a = 2i, i=im, im+1..... iu. In this study, Lw was set to 750 samples. The starting index im and the ending index iu are chosen based upon known physical constraints. To detect QRS complexes, in a manner similar to the techniques described[2,3] and in [4], we make use of the property that the absolute value of the DyWT has local maxima which occur simultaneously across several scale parameters at the instant of occurrence of the transients. For each scale 2i, we locate the maxima of │DyWTx (b, 2i) │ with respect to the translation parameter, b that exceed a given threshold, where the threshold is chosen as 75% of the maximum peak. If the locations of the local maxima exceeding the threshold correlate across two consecutive scales, we assume that the locations of these maxima correspond to the location of the QRS complexes. To detect the QRS complex, it was determined that we need to compute the DyWT only at three scales 2l, 22 and 23, which significantly reduces computational complexity. Since the computation of the DyWT is independent from scale to scale, the DyWT at three scales could be computed simultaneously enabling a real time implementation of the DyWT based QRS detector.

ISSN: 0975-5462

3039

Ruchita Gautam et. al. / International Journal of Engineering Science and Technology Vol. 2(7), 2010, 3038-3044

Fig. 1 Flow chart depicting the QRS detection by using wavelet transforms.

4. Simulations Methodology In this part, we briefly describe the other QRS detectors and then compare their performance to the DyWT QRS detector on selected ECG data. The Okada algorithm [1] is an early application of digital filter techniques to the problem of QRS detection. The class of algorithms described in [6], referred to as multiplication of the backward difference (MOBD), multiply successive difference samples to exploit the large amplitude, high frequency characteristics of the QRS complex. The linear preprocessing of the ECG is omitted, permitting a faster detector response time. Finally, the QRS detector developed by Hamilton and Tompkins [4] uses an optimized band pass filtering method. The linear stage consists of band pass filtering and differentiator followed by non-linear squaring of the signal and a detection statistics. It should be noted that the DyWT algorithm is conceptually similar to the Hamilton-Tompkins algorithm in that, both techniques, band pass filter and differentiate the ECG signal. However, there are two significant advantages of the DyWT QRS detector: (i) since the octave band pass filters of the DyWT are scaled versions of one another, the DyWT QRS detector can adapt to changes in the bandwidth of the QRS complex and (ii) unlike regular band pass filtering, the DyWT has the additional property that if a “smoothing” wavelet is used, peaks of the DyWT correlate across successive dyadic scales at the occurrence of a transient. The software used is MATLAB and its wavelet toolbox. The ECG signals used were from Common Standard for Electrocardiography (CSE) database available in the website. The entire record was used for the analysis. The method consists of first analyzing the 2000 samples and then performing the CWT of the ECG signals for calculating the coefficient for scales 2, 4 and 8. After calculating the coefficients, the absolute value of these decompositions is taken and the R peaks are determined by using the algorithm. All feature signals were plotted and visually compared. 5. Results and Discussion The validation of the method was assessed by applying the values of CSE database of 12 different leads, each of 2000 samples to the wavelet transform algorithm to a 5-minute portion of the database ECG signals. These are shown if figs 2 to 13. The heart rate was calculated using MATLAB code and the percentage accuracy detected was 86.25% which was far better than other methods.

ISSN: 0975-5462

3040

Ruchita Gautam et. al. / International Journal of Engineering Science and Technology Vol. 2(7), 2010, 3038-3044 1000

200 X: 198 Y: 154.1

100

500

X: 592 Y: 583.9

0 -100

0

-200

-500

-300 -400

-1000 -500 -600

-1500

-700 -800

0

200

400

600

800

1000

1200

1400

1600

1800

2000

-2000

0

200

400

600

800

1000

1200

1400

1600

1800

2000

Fig.2 ECG waveform of database lead V1

Fig.3 ECG waveform of database V2

Practical result by MATLAB code of lead V1 The first R peak occurs at : 198 The second R peak occurs at : 590

Practical result by MATLAB code of lead V2 The first R peak occurs at : 201 The second R peak occurs at : 592

HEART RATE: 76.5306

HEART RATE: 76.7263

800

1000 X: 594 Y: 703.6

600

X: 597 Y: 863.6

400 200 500

0 -200 -400 0

-600 -800 -1000 -1200

0

200

400

600

800

1000

1200

1400

1600

1800

2000

-500

0

200

400

600

800

1000

1200

1400

1600

1800

2000

Fig.4 ECG waveform of databaseV3

Fig.5 ECG waveform of database V4

Practical result by MATLAB code of lead V3 The first R peak occurs at: 203 The second R peak occurs at: 594 HEART RATE: 76.7263

Practical result by MATLAB code of lead V4 The first R peak occurs at: 205 The second R peak occurs at: 597 HEART RATE: 76.5306

1000

1400 X: 207 Y: 916.4

800

X: 358 Y: 1313

1200 1000

600 800 400

600

200

400 200

0 0 -200

-400

-200

0

200

400

600

800

1000

1200

1400

1600

1800

2000

-400

0

200

400

600

800

1000

1200

1400

1600

1800

2000

Fig.6 ECG waveform of databaseV5

Fig.7 ECG waveform of database V6

Practical result by MATLAB code of lead V5 The first R peak occurs at : 207 The second R peak occurs at : 598 HEART RATE: 76.7263

Practical result by MATLAB code of lead V6 The first R peak occurs at : 94 The second R peak occurs at : 358 HEART RATE : 113.6364

ISSN: 0975-5462

3041

Ruchita Gautam et. al. / International Journal of Engineering Science and Technology Vol. 2(7), 2010, 3038-3044 600

1.2

500

X: 598 Y: 540.5

1 X: 211 Y: 0.7895

400 0.8 300 200

0.6

100

0.4

0 0.2 -100 0

-200 -300

0

200

400

600

800

1000

1200

1400

1600

1800

-0.2

2000

0

200

400

600

800

1000

1200

1400

1600

1800

2000

Fig.8 ECG waveform of database I

Fig.9 ECG waveform of database II

Practical result by MATLAB code of lead I The first R peak occurs at : 207 The second R peak occurs at : 598 HEART RATE: 76.7263

Practical result by MATLAB code of lead II The first R peak occurs at : 211 The second R peak occurs at : 603 HEART RATE : 76.5306

1000 300

X: 131 Y: 962.1

800

200

600

100

400

0

X: 205 Y: 226

-100

200 -200

0 -300

-200

-400

-400

0

200

400

600

800

1000

1200

1400

1600

1800

-500

2000

0

200

400

600

800

1000

1200

1400

1600

1800

Fig.10 ECG waveform of database III

Fig.11 ECG waveform of database aVL

Practical result by matlab code of lead III

Practical result by matlab code of lead aVL

The first R peak occurs at : 131 The second R peak occurs at : 421 HEART RATE: 103.4483

The first R peak occurs at : 205 The second R peak occurs at : 596 HEART RATE: 76.7263

500

2000

500

400

400

X: 83 Y: 401.3

300

X: 711 Y: 386.3

300

200 200

100 0

100

-100

0

-200 -100

-300 -200

-400 -500

0

200

400

600

800

1000

1200

1400

1600

1800

2000

-300

0

200

400

600

800

1000

1200

1400

1600

1800

Fig. 12 ECG waveform of database aVf

Fig.13 ECG waveform of database aVR

Practical result by MATLAB code of lead aVF The first R peak occurs at : 83 The second R peak occurs at : 427 HEART RATE: 87.2093

Practical result by MATLAB code of lead aVR The first R peak occurs at : 245 The second R peak occurs at : 711 HEART RATE: 64.3777

ISSN: 0975-5462

2000

3042

Ruchita Gautam et. al. / International Journal of Engineering Science and Technology Vol. 2(7), 2010, 3038-3044 6. Conclusion In this paper, a QRS detection algorithm based on the DyWT was proposed. We have described the properties of the DyWT necessary for ECG signal processing. In particular, the property that local maxima in the DyWT correlate across successive scales and correspond to the occurrence of a transient if a smoothing wavelet is used. We exploited the property that the onset of the local maxima of the │DyWT│ of a transient signal correlates across successive dyadic scales if the mother wavelet is chosen as the first derivative of a smoothing function. The performance of the DyWT-based detector was exhaustively examined by testing the algorithm on standardized CSE database. Moreover, these results were compared to those of well-known QRS detection algorithms. Although no one algorithm exhibited superior performance in all situations, the DyWT-based QRS detector compared well with the standard. The performance of the DyWT based QRS detector is comparable to the performance of the standard techniques and exhibits superior performance over the other techniques in noise corrupted data. We have also checked this algorithm for the signal in which S waves are also detected as R waves and thus gives false detection. The main advantages of the DyWT over existing techniques are its robust noise performance and its flexibility in analyzing non-stationary ECG data. The wavelet analysis is a new promising technique in non-invasive electro cardiology providing improved methods for processing ECG signal. The benefit of wavelet transform lies in its capacity to highlight details of the ECG signal with optimal timefrequency resolution. So we have checked this algorithm on CSE database over all the 12 standard leads, the ECG classification software has successfully classified a given ECG as either normal or abnormal by employing a form of scoring mechanism.

References [1] [2]

M. Okada, ‘A Digital Filter for the QRS Complex Detection”, IEEE Trans. Bio. Eng., vol. - 26, no. - 12, pp. 700-703, Dec., 1979. O. Pahlm, L. Sornmo, “Software QRS Detection in Ambulatory Monitoring-A Review: Med. Biol. Eng. Comp., vol. - 22, pp. 289-297, 1984. [3] E. Skordalakis, “Syntactic ECG processing: A Review”, pattern recognition vol.-19 1986. [4] P. S. Hamilton and W. J. Tompkins, ‘Quantitative investigation of QRS detection rules using the MIT/BIH arrhythmia database: IEEE Trans. Bio. Eng., vol. - 33, pp. 1157-1165, 1986 [5] Meste O and Rix H ,”Detection of late potentials by means of wavelet transform 11th Annual International Conference”, IEEE Eng Med. Biol. Society, pp. 28-29 ,1989 [6] S. Suppappola and Y. Sun, “Nonlinear transforms in QRS detection algorithms”, IEEE Eng. Med. Biol. Society 19th Ann. Intnl. Conf., pp. 816-817, 1990. [7] S. Mallat and W. L. Hwang, “Singularity detection and processing with wavelets,” IEEE Transactions on Information Theory, vol.-38, no.-2, pp. 617–643, 1992. [8] S. Kadambe and G. F. Boudreaux-Bartels, “Application of the Wavelet Transform for Pitch Detection of Speech Signals”, IEEE Zhns. on Information Theory, vol.- 38, no.- 2, March, 1992 [9] Cromwell L., Weibell F.J. and Pfieffer E.A., “Biomedical Instrumentation and Measurements”, Second Edition, Prentice Hall, 1995. [10] C. Li, C. Zheng, and C. Tai, “ Detection of ECG characteristic points using wavelet transforms”, IEEE Trans Biomed Eng, vol.- 42, no.-1,pp. 21, 1995 [11] Senhadji L, Carrault G, Bellanger JJ and Passariello G.,” Comparing wavelet transforms for recognizing cardiac patterns”, IEEE Eng Med. Biol. Mag vol.-33, pp.2162-2169 ,1995 [12] Cuiwei Li, Chongxun Zheng, and Changfeng Tai, “Detection of ECG Characteristic Points Using Wavelet Transforms”, IEEE Trans. on Biol. Eng., vol. - 42, no. -1, Jan., 1995 [13] John G. Webster,” Medical Instrumentation. Application and Design”, John Wiley and Sons, Inc., 1998. [14] Kadambe, Shubha, Murray, Robin and Boudreaux-Bartels,G. Faye,” Wavelet transform-based qrs complex detector”, IEEE Transactions on biomedical Engineering, vol.- 46, no.-7, pp. 838–848, 1999. [15] Sfindor Miklds Sziliigyi, Uszl6 Sziliigyi, , “Wavelet Transform and Neural-Network- Based Adaptive Filtering for QRS Detection”, Proc. of the 22nd Annual EMBS Intnl. Conf., pp. 23-28, Jul., 2000. [16 ] Bert-Uwe Köhler, Carsten Hennig, Reinhold Orglmeister, “ The Principles of Software QRS Detection”, IEEE Eng. Med. Biol. Society, Jan./ Feb. 2002. [17] A. Schuck Jr., J. 0. Wisbeck, “QRS Detector Pre-processing Using the Complex Wavelet Transform”, Proc. of the 25th Annual Intern. Conf. of the IEEE EMBS, pp. 17-21, Sept. 2003. [18] SHI Yunhui RUAN Qiuqi,” Continuous Wavelet Transforms”, ICSP Proceedings 2004. [19] M.J. Vaessen, “A QRS detection method using analog wavelet transform in ECG analysis”, 20th June 2005. [20 ] Donghui Zhang, “Wavelet Approach for ECG Baseline Wander Correction and Noise Reduction”, Proc. of the 2005 IEEE Eng. in Med. and Biol. 27th Annual Conf., pp.1- 4, Sept., 2005 [21] Josko, “Discrete wavelet transform in automatic ECG signal analysis,” in IEEE Instrumentation and Measurement Technology Conference, Warsaw, Poland, 2007. [22] N. M. Arzeno, Z.-D. Deng, and C.-S. Poon, “Analysis of first-derivative based QRS detection algorithms”, ,” IEEE Trans. on Bio. Eng., vol.-55, no.-2, pp. 478–484, 2008. [23] Awadhesh Pachauri, and Manabendra Bhuyan , “Robust Detection of R-Wave Using Wavelet Technique”, World Academy of Sci., Eng. and Tech. 56 2009

ISSN: 0975-5462

3043

Ruchita Gautam et. al. / International Journal of Engineering Science and Technology Vol. 2(7), 2010, 3038-3044 Miss. Ruchita Gautam did her B.E. from Rajasthan University, Jaipur (India) in 2005 and currently pursuing her M.Tech in Digital Communication Systems from Rajasthan Technical University, Kota. She has a teaching experience of 5 years and presently working as Assistant Professor in MAIIT, Kota (India). Her area of interest includes Optical Communication, Biomedical, Signal Processing and Computer Networking

Anil Kumar Sharma (MIEEE) received his M.E. degree in Electronics and Communication Engineering from Birla Institute of Technology, Deemed University, Mesra, Ranchi – India, in 2007 with first division (CGPA of 8.45 in a 10.00-point scale). He has an experience of 20 years on various RADARs and Communication Equipments. He is currently an Associate Professor in the Department of Electronics and Communication Engineering, Institute of Engineering and Technology, Alwar- 301 030, Rajasthan, India. He has published 16 papers in International journals as well as in international/national conferences. His research and teaching interest include Microprocessor, VLSI Design, Neuro-Fuzzy Modeling, RADARs & its Data Handling Systems.

ISSN: 0975-5462

3044

Suggest Documents