Detection and Identification of ECG waves by Histogram ... - IEEE Xplore

2 downloads 0 Views 329KB Size Report
Abstract— A histogram based simple and novel idea is proposed here for detection and identification of R wave, P wave and T wave from noise removal ECG ...
2016 2nd International Conference on Control, Instrumentation, Energy & Communication (CIEC)

Detection and Identification of ECG waves by Histogram approach 1

B.Halder1, S.Mitra2, M.Mitra3 Department of Information Technology, Neotia Institute of Technology, Management & Science, (Affiliated to WBUT), 24-pgs(s) - 743368, W.B (India) , E-mail: [email protected] 2 Department of Electronics, Netaji Nagar Day College, (Affiliated to University of Calcutta), Kolkata 700 092, W.B (India), Email: [email protected] 3 Department of Applied Physics, Faculty of Technology, University of Calcutta, 92 APC Road, Kolkata - 700 009, India, E-mail: [email protected]

Abstract— A histogram based simple and novel idea is proposed here for detection and identification of R wave, P wave and T wave from noise removal ECG Signal. The identification of ECG waveforms and their characteristic features is an important task for the diagnosis. In this work, histograms, a graphical demonstration of numerical data of equal size, is used as an estimator of the above mentioned waves of ECG signal. For this purpose the whole signal is divided into few small windows of predefined width having maximum 60 sample values in each. The Histograms are basically generated by measuring the variations of the orientations among these sample values in some quantized directions. After getting the histograms, few zones are depicted as QRS zones having the area more than a pre-defined threshold. The local maxima of these zones are considered as the Rpeak. Based on same technique, P and T wave can also be detected. The method is advantageous as it can be used directly for online analysis without using any complex mathematical models. The whole technique has been established to be useful to a variety of ECG records for all the 12 leads taken from CSE Multi-lead ECG database which contains 5000 samples recorded at a sampling frequency of 500Hz. The algorithm is implemented on MATLAB R2010a environment. The performance of the proposed technique is evaluated. The accuracy of the proposed technique is achieved in Sensitivity (Se=99.86%), Positive Predictivity (+p=99.76%) and Detection accuracy (DA 99.8%) and hence we conclude that the proposed technique may be used for ECG analysis and classification Keywords—Sensitivity; Detection accuracy

Positive

Predictivity;

histogram,

depolarization or conduction and indicates the start of atrial reduction for pumps blood to the ventricles. The QRS complex is most important parameter employed in the analysis and classification of the ECG signal. The voltage amplitude of QRS complex may give information about the cardiac disease. The ventricular depolarization of myocardium is reflected by the QRS complex and indicates the start of ventricular reduction for pumps blood to the lungs and the rest of the body [1]. The repolarisation of the ventricular myocardium is presented by the T wave and is longer in duration than depolarization.

Figure 1: Main components ECG signal. Each wave describes a distinct phase of cardiac cycle.

threshold,

Table1: Amplitude and duration of waves, segments and intervals [8][9] of ECG signal.

I. INTRODUCTION An Electrocardiogram (ECG) is a most precious diagnostic tool for recording the heart’s electrical motion by repeated wave series of P, QRS and T wave. The recorded waveforms give us the basic information about a patient’s condition. An ECG signal contains P wave, QRS complex and a T wave. These units of electrical activity can be further broken down into the PR interval, the ST segment, and the QT interval. End of the QRS complex and beginning of the ST segment marked by the J point. Figure 1 illustrates a general indication of the P-wave, QRS complex, T-wave , RR interval and Table 1 illustrates the standard value of frequency and duration of waves, segments and intervals of ECG signal. The deviation from these standard values of the normal ECG signal leads to various cardiac abnormalities. The P wave is the first component of a normal ECG waveform. It represents atrial

978-1-5090-0035-7/16/$31.00©2016IEEE

SL No 1 2 3 4 5

Feature P wave PQ/PR interval QRS complex QTc interval ST segment

Frequency (Hz) 8-10 10-40 -

Duration (ms) 60-80 120-200 80-120 360-440 100-120

6

T wave

5-8

120-160

7

RR interval

-

(0.6-1.2)s

8

PR segment

-

50-120

The feature extraction system of ECG signal provides fundamental features (frequency and duration) may be used

168

2016 2nd International Conference on Control, Instrumentation, Energy & Communication (CIEC)

for automatic ECG analysis. A number of techniques are reported to improve the accuracy of QRS complex detection and identification from ECG signal because the accurate identification of QRS complex is complicated, as the ECG signal is added with different types of noise like electrode motion, power-line interferences, baseline wander, muscles noise etc. [4]. Pan and Tompkins [5] developed an algorithm for the detection of QRS complex by linear filtering, nonlinear transformation and decision rule system. In another algorithm was presented in [6] where the QRS complex of ECG signal was detected using multi rate signal processing and filter banks. Hilbert transform and the first differentiation of ECG signal is reported to find the location of R-peak in the ECG signal [1, 7]. Wavelet transform of Multi-resolution, wavelet decomposition and continuous wavelet transform are reported for ECG feature extraction [2, 10, 11, and 13]. Genetic Algorithm and Artificial Neural Network (ANN) [12] are also reported for detection and identification of QRS complexes from ECG signals. Normally, a thresholding method is required for detection and identification of R wave in ECG signal. In [16] Xu and Li have shown that using adaptive thresholding for automatic determining of threshold provides appropriate results for the detection of R wave peak. Online ECG parameter extraction approach by Directional histogram [3] is reported to improve the QRS detection accuracy. A Statistical approach [18] is also reported for determination of time plane feature extraction from digitized ECG samples. In this paper a relatively simple without any mathematical complexity and innovative approach is proposed for extraction of a small amount of clinically significant features from ECG signals that may be used to identify the cardiac disease. The features are extracted by the histogram based method and adaptive threshold value which is calculated from the maximum bin of the histogram. R peak is detected first and then consequently T wave and P wave are also been detected. In ECG signal, there are different types of noises like baseline wander noise; power line interference noise, motion artifact, etc are included. We also removed this type of noise from the ECG signal. High recognition accuracy is obtained in detection of QRS, P and T waves by this method. The performance of the algorithm is evaluated using 50, original simultaneously recorded 12-lead ECG recordings from the standard CSE ECG database. The remaining paper is organized as follows. In section II we demonstrate our Detection methodology which includes linear filtering for noise removal, baseline wander removal, QRS complex detection, P wave and T wave detection. Next, in section III we show the results performed on the standard CSE database. Finally, conclusion is reported in Section VI. II. METHODOLOGY This section algorithm development technique is described for the detection and identification of different features in simultaneously recorded 12 lead ECG signal. Normally, there are two main parts of the ECG signal, namely QRS complex

region and non-QRS complex region. P and T waves mainly compose non-QRS region. The most prominent part of ECG signal is the QRS complex and detected at first. The whole work is divided into the few steps. A. Signal filtering and Baseline wander correction. B. R peak detection C. P wave detection and D. T wave detection. A. Signal filtering and Baseline wander correction With a raw ECG signal, we get a noisy signal with a baseline drift (voltage not centered on 0V and increases or decreases over time). We desire to uncover the ECG signal behind this noise and drift. After getting the ECG dataset, the first step is to remove the inherent noise from the ECG signal. The typical noises that affect the ECG signal are electric or power line interference of 60/50Hz.The finite impulse response (FIR) is used to remove 50Hz power line interference. After filtering the signal using the FIR filter, the filtered signal was passed through median filters to correct for the baseline wander correction. Initially, from the beginning 200ms of samples were extracted and stored in rising order. After that its median was computed. Till the end of the ECG signal, for every 200 ms of samples, the same method was carried out. After that, these samples are fed to the 600 ms window median filtering as input. Then, the median value is calculated for every 600 ms of samples. To remove the baseline wander of the ECG signal, calculated median values were subtracted from the original waveform. Figure 2 and Figure 3 shows the result of the baseline wander filter. B. R peak Detection Algorithm From the filtered ECG signal, all the necessary features are extracted. The detection of the QRS complex is the fundamental and most important component for feature extraction i.e. identifying the R point for each beat of the signal. With the reference of R point, other characteristic points on the wave are detected. Thus to detect an accurate QRS complex is an important task in ECG analysis. The outline of the proposed approach is described stepwise as follows: Step1: Noise removal ECG signal (D) is used as an input signal and normalization have been performed on D signal to bring the integer sample values by using the following equation: y[n] = fix((D/max(D))*100) (1) Step2: For Generation of histogram, divide the entire range of normalized sample values into a series of intervals which is considered as a window of length of 60 sample values and is chosen on purely trial and error basis. The number of intervals is obtained by using the following equation. wn= round((y[n]/window) (2) Step3: Now count how many sample values differs in each wn interval of ECG signal and stored in z[n] array ,where n = 1 to length(wn) . Step4: Here histogram is a graphical display to show the frequency of sample values in successive intervals of

169

2016 2nd International Conference on Control, Instrumentation, Energy & Communication (CIEC)

equal size. Let n be the total number of intervals and k be the total number of bins, the histogram mi meets the following conditions: k ∑ m i = 1

n =

Step 8: Now, on the based on the standard duration of QRS complex [Table 1, 80-120ms], most recently detected R peak is taken as reference, searching left side samples of the R peak and right side sample values of the R peak within the particular range calculated by the following way

(3)

i

Input ECG Signal(Original signal) Input File ::D 0009.TXT ,LEAD = V5

range= (1+60*(n-1)) to 60*n Q(n)=min(y[(range(1)-10) to R(i)]) S(n)=min(y[R(i) to (range(last)+15)])

0

800 600

Volts

400 200

(6) (7) (8)

0 -200

Using the equation 6 and 7, Q and S point is successfully identified within the R peak region of Histogram.

-400 -600

0

0.5

1

1.5

2

2.5 Seconds

3

3.5

4

4.5

5

After Filtering and Baseline wander correction

Histogram for Peak Region

600

40

400

35

Volts

200 0

30

-400

1

1.1

1.2

1.3

1.4

1.5 Seconds

1.6

1.7

1.8

1.9

Different Sample values

-200

2

Figure 2: Original ECG file and after filtering and baseline wander correction Input ECG Signal(Original signal) Input File ::D00002.TXT ,LEAD = III 1000

25 20 15 10

500 Volts

5

0

-500

0

0

0.5

1

1.5

2

2.5 Seconds

3

3.5

4

4.5

200

Volts

100 0 -100 -200

1

1.1

1.2

1.3

1.4

1.5 Seconds

1.6

1.7

1.8

1.9

10

20

30 40 50 60 Number of Peak Region

70

80

90

C. T peak detection algorith After successfully detection of R peak, the marked histogram bin can be deleted from the histogram and for the marked of T region, linear searching technique is applied to the right side of the R region. When second largest bin is first found, the searching technique is stop and founded bin is marked as the T region. Again window range is computed by following rule and within this range the maximum sample value is calculated from the noise free ECG signal and T wave point is obtained. range=[(60*(n-1)+1) to ((60*n)+50)] (9) T(i)=max( y[range]) (10) Where n is the R peak position and I is the T peak position.

After Filtering and Baseline wander correction 300

-300

0

Figure 4: Histogram from z[n] array

5

2

Figure 3: Original ECG file and after filtering and baseline wander correction

Step 5: Threshold value is assigned to thy which is obtained by using the following equation. thy= integer (max(wn)/2)+4 (4) After computation of this threshold value, all the R peak regions are detected accurately. This threshold value (thy) is a function of wn which is chosen on purely a trial and error basis

D. P peak detection algorithm: The P wave is determined by analogous approach as T wave. Before the R peak region of the histogram, P peak region is identified. Using the linear search technique, the left side of the R peak is searched. When the largest bin is first found, then searching processed stop and the founded region is marked as P region of the histogram. Now based on the R peak region, the particular range is calculated by the following way and the maximum sample value of this region is computed. The computed position is the P peak position. range=[(60*(n-1)-20)+1 to ((60*n)-15)] (11) P(i)=max( y[range]) (12) Where n= R peak position. Figure 5 shows the above

Step 6: Based on the following condition, marked the largest Histogram bin as the R peaks region. The condition is, if z [n-1]< z[n]> z [n+1] and z[n]> thy. Step 7: Now the R peaks location is found from the entire marked histogram bin by computation of maximum value within the histogram bin from y[n] array. So R peaks R (i) = y[j] (5) Where i= number of R peaks, y = noise removal ECG signal and j= 1 to length of ECG signal.

170

2016 2nd International Conference on Control, Instrumentation, Energy & Communication (CIEC)

mathematical morphology detects QRS’ with a sensitivity of 99.38% and positive predictivity of 99.48% [19]. So our technique compares satisfactorily with the other methods. Moreover, our technique is relatively simple without any mathematical complexity.

described three peak region that is detected by the proposed algorithm.

Table 2: Sensitivity, Predictivity and Accuracy of R peak detection

Figure 5: Histogram for Region detection of P, R and T wave

III. PERFORMANCE MEASURES

171

SL NO

Table 3: Sensitivity and Positive Predictivity comparison Method Se(%) +P(%)

1 2 3 4 5 6

First Derivative[14] CWT[15] Hilbert Transform[17] Wavelet Transform [11] morphology based[19] Proposed

99.68 99.91 99.94 99.80 99.38 99.86

99.6 99.72 99.93 99.96 99.48 99.76

ECG Signal with P,Q,R,S,T points Input File ::MA1008.TXT ,LEAD = 1 1500 ECG P Q R S T

1000

500

0

-500

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

1.6

1.7

1.8

1.9

2

ECG Signal 1-3 second 1500

1000 Volts

To evaluate the performance of the proposed method, 12 different leads of ECG waves is taken from CSE diagnosis ECG database. The algorithm is capable to detect the R peak perfectly. Three statistical measurements were commonly used to evaluate the performance of R peak detection. These are Sensitivity (Se), the ratio of the number of correctly detected events, TP (true positives), to the total number of events is given by TP Se(%) = (13) % TP + FN Where FN (false negatives) is the number of missed events. Positive predictive accuracy (+P), (or just positive predictivity) is the ratio of the number of correctly detected events, TP, to the total number of events detected by the analyzer and is given by TP (14) +P(%)= % TP + FP Where FP (false positives) is the number of falsely detected events. Another performance measure is Detection accuracy obtained by percentage of detected peaks among total number of peaks Detected _ peak Detection accuracy (DA) = (15) x100% Total _ peak Table 2 shows Sensitivity (Sc %), Positive predictivity(+P%) and Detection accuracy (DA%) of R peak of some ECG data file. Table 3 shows Sensitivity (Sc %) and Positive predictivity (+P%) comparison with other methods and the proposed method. Figure 6 and 7 shows different characteristics points of ECG signal that detected by the proposed algorithm. The performance of the developed Histogram based ECG wave detector is satisfactory and we obtained the accuracy of the QRS detector is 99.8% on an average, whereas ‘Analysis of First Derivative based QRS Detection Algorithm’ [14] gives 99.68 % Sc and 99.6% +p. ‘A Wavelet-Based ECG Delineator: Evaluation on Standard Databases’ [11] yields 99.80% Sc and 99.96 % +p. Among the other methods, ‘Pattern defined heuristic rules and directional histogram based online’ [3] with accuracy 99.5%, ‘an approach based on

500

0

-500

1

1.1

1.2

1.3

1.4

1.5 LEAD =1 Time -->

Figure 6: Different ECG characteristics points

2016 2nd International Conference on Control, Instrumentation, Energy & Communication (CIEC)

The part of the work is funded by the University Grant Commission (UGC), Govt. of India. The authors are thankful to UGC for providing financial assistances.

ECG Signal with P,R,T Spoints Input File ::D00002.TXT ,LEAD = 1 800 ECG R T P Q S

600 400 200

References

0

[1]

-200 -400

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

[2]

ECG Signal 1-3 second 1000 800 600

[3]

V olts

400 200 0

[4]

-200 -400 0.1

0.2

0.3

0.4

0.5 0.6 LEAD =1 Time -->

0.7

0.8

0.9

1

[5] Figure 7: Different ECG characteristics points [6]

N um ber of D iff erent S am p le v alue

Histogram for Region detection of P, R and T wave Different Sample value R Peak Region T Peak Region P wave region

[7]

[8]

[9] [10]

11 10

[11] 2

11

20

29

38 47 Number of Block

56

65

74

83

Figure 8: Histogram for Region detection of P, QRS and T wave [12]

IV. CONCLUSION Detection and identification of different patterns of ECG waves by a graphical representation of sample values of simultaneously recorded 12-lead ECG signal is described in this paper. The novelty of this approach is to compute the Histogram by 60ms different sample values on noise free ECG signal for the Identification of R peak region. With the help of threshold value, R region bin is marked. After calculation of the maximum value of the R region bin, the R peak is identified. Same technique is used for the detection and identification of T and P wave. The present approach is tested on the CSE 12 lead ECG database and the performance is found to be fairly acceptable. A reasonable amount of Sensitivity (99.86%) and Predictivity (99.76%) is obtained using this algorithm. The Detection accuracy (DA) for R peak is 99.8% and hence it can be therefore concluded that proposed method may be used for ECG analysis and classification. Acknowledgment

172

[13]

[14]

[15]

[16]

[17]

[18]

[19]

S.K.Mukhopadhyay, M.Mitra and S.Mitra, ‘Time Plane ECG Feature Extraction Using Hilbert Transform, Variable Threshold and Slope Reversal Approach’,International Journal of Biomedical Engineering and Technology,vol 9,No 4, 2012 V.Saritha, Sukanya, and Y. Narasimha Murthy, ‘ECG Signal Analysis Using Wavelet Transforms’, Bulgarian Journal of Physics, vol. 35, pp. 68-77, 2008. S. Mitra, M. Mitra and B.B. Chaudhuri, ‘Pattern defined heuristic rules and directional histogram based online ECG parameter extraction’, Measurement 42 ,pp.150–156 ,2009 W. Jiang and S. G. Kong, ‘Block-based neural networks for personalized ECG signal classification’, IEEE Trans. Neural Netw., vol. 18, no. 6, pp. 1750–1761, Nov. 2007. J.Pan and W.J.Tompkins, ‘A real-time QRS detection algorithm’,IEEE Trans. Biomed. Eng., 32, pp. 230–236. 1985: P.de Chazal, M.O. Duyer, and R.B. Reilly, ‘Automatic classification of heartbeat using ECG morphology and heart beat interval features’, IEEE Trans. Biomed. Eng. vol. 51, pp. 1196-1206, 2004. D. Benitez, P.A. Gaydecki, A. Zaidi and A.P. Fitzpatrick, ‘The use of the Hilbert transform in ECG signal analysis’, Computers in Biology and Medicine 31,PP.399–406, 2001 Y.C. Yeha and W. J. Wang, ‘QRS complexes detection for ECG signal the Difference Operation Method (DOM)’, Computer methods and programs in biomedicine, vol. 9, pp. 245–254, 2008. R.M. Rangayyan,’Biomedical Signal Analysis: A Case-study Approach’, Wiley–Interscience, New York, pp.18–28, 2001. S. Mahmoodabadi, A. Ahmadian, A.M. Bolhasani, M. Eslami and J.Bidgoli, ‘ECG feature extraction based on multiresolution wavelet transform’, Conf. Proc. IEEE Eng. Med. Biol. Soc. 4 ,pp.3902– 3905. (2005) J.P.Martínez,R.Almeida,S.Olmos,A.P.Rocha,and P.Laguna, ‘A WaveletBased ECG Delineator: Evaluation on Standard Databases’, IEEE Transactions on Biomedical Engineering Vol. 51, No. 4, pp. 570-581, 2004. K.Prasad and J. S. Sahambi, ‘Classification of ECG Arrhythmias using Multi-Resolution Analysis and Neural Networks’, IEEE Transactions on Biomedical Engineering, vol. 1, pp. 227-231, 2003. C.Li, C.Zheng and C.Tai, ‘Detection of ECG Characteristic Points using Wavelet Transforms’, IEEE Transactions on Biomedical Engineering, Vol. 42, No. 1, pp. 21-28, 1995. N.M. Arzeno, Z.De. Deng, and C.S.Poon, Fellow IEEE, ‘Analysis of First Derivative based QRS Detection Algorithm’, IEEE Trans Biomed Eng. 55(2): pp.478–484, 2008 A. Ghaffari, H. Golbayani and M. Ghasemi, ‘A new mathematical based QRS detector using continuous wavelet transform’, Computers and Electrical Engineering 34 ,pp.81–91, 2008 X.Xu and Y. Liu, ‘Adaptive threshold for QRS complex detection based on wavelet transform’. 27th Annual Int. Conf Proc IEEE Eng Med Biol Soc ,pp.7281-4. 2005 R.J. Bolton and L.C. Westphal, ‘ECG display and QRS detection using the Hilbert Transform’, Ripley KL (Ed.). Computers in Cardiology,IEEE Computer Society, Washington, DC, pp. 463–466, 1985 H.K.Chatterjee, R.Gupta. M.Mitra, ‘A Statical approch for determionation on time plane features from digitized ECG’,Computers in Biology and Medicine (Elsevier),41,pp.278-284, 2011 P.E.Trahanias, An approach to QRS complex detection using mathematical morphology, IEEE Trans. Biomed. Eng. BME-40 ,pp.201–205.,1993

Suggest Documents