Dipjyoti Bisharad1,Debakshi Dey1, Brinda Bhowmick1 1 NationalInstitute of Technology Silchar, Silchar – 788010, Assam, India{dipjyotibisharad.

nit, deydebakshi16,brindabhowmick}@gmail.comAbstract.Electrocardiography (ECG or EKG) is a medical test thatisheavily used to assess human heart condition and investigatea large setcardiac diseases. Automated ECG analysis has become a task of increasedclinical importance since it can aid physicians in improved diagnostics. Mostof the automated ECG analysis techniques requires first identifying the onsetand offset locations of its fiducial points and characteristic waves. Two ofthe important characteristic waves are P and T waves.

They mark the beginning andend of aECG cycle respectively. In this paper, a fast technique is proposedthat can segment ECG signals by accurately identifying the P and T waves. Inthis work, we evaluate the performance of our model on standard QT database4. We achieved high accuracies above 99% and 97% while detecting P waves andT waves respectively.Keywords: electrocardiogram, ECG features, ECG delineation, ECG segmentation.1   IntroductionECG signal originates from theelectrical activity of the heart that is synchronouswith the contraction andrelaxation of the atria and ventricles of the heart. Monitoring electricalactivities of heart can help to identify various types of heart diseases.Nowadays several methods are existing for ECG analysis and it has become aquite mature field.

Some well annotated datasets have been developed that hasboosted the research in ECG data analysis 4-6. Many works have been done tilldate for determining characteristic points in ECG signals. But most of them arecomputationally expensive because of implementing complex signal processingtechniques. In 10, the QRS complexes are recognized using the information onthe signal’s slope, amplitude and width.

Another proposed method uses thewavelet transform to detect all the P, QRS and T complexes but when noise ishigh, the detection of P and T onsets and offsets is very difficult 11.Hidden Markov Model is used to detect P wave along with QRS complex in 12. In13, P and T waves detection is based on length transformation technique. Somehardware based implementation alsoexists such as the Xilinx fpga based  P and T wave detection algorithm in whichauthors used slope detection approach 14. ECG delineation algorithmintroduced in 15 uses simple line fitting technique but cannot identify somekind of arrhythmias. A SVMbased method used to detect P and T waves is proposedin 16. In 17 the QRS complexes have been clustered into several groups withthe help of self-organizing neural networks for detection. The algorithmproposed in 18 is based on digitalfractional order differentiation for P and T waves detection anddelineation.

Though in this work we focused on single lead ECG system, theauthors in 19 found that the detection of wave boundaries in multi-lead ECGsignals giving better performance for measurements of T waves than the othercharacteristic waveforms.In this paper, segmenting an ECG cycle is by detecting the P and Tcomplexes using local context window around R peaks. The proposed method showsvery high detection accuracy and has linear computational complexity withrespect to length of the ECG signal. All the ECG signals used in this work isobtained from modified limb lead II (MLII), which is placed on the chest.The remainderof this paper is organized as follows. In section 2, composition of ECG signalis discussed and its characteristic waveforms. In section 3, the methodologiesand algorithms are discussed.

The results of the proposed method are shown insection 4. Finally, the paper concludes in section 5.2    Structure of ECG SignalIn this section, we provide abrief overview of the structure of ECG signal.

Electrical signals are generatedduring one heartbeat in a human undergo depolarization and repolarization. Themagnitude and direction of these electrical events is what that is captured bythe ECG. An electrical event takes place which is indicated by one of themultiple waveforms contained in the components of a normal ECG tracing duringone cardiac cycle.

A short and upward P wave which indicates atrialdepolarization. Then, the QRS complex follows it which signifies ventricularrepolarization. After this, the T wave is observed which is usually a smallupward waveform but it may be inverted in some cases 2. These waves follow acharacteristic duration. The P wave exists for about 80 ms and one ST-segment duration varies from 80 ms to 120 ms.One ST-Interval is achieved as 320 ms in 3. Fig.

1. Waveform of single ECG wave 13   MethodologyFrom the review of ECG signal, itis clear that the P and T waves have distinct physical characteristics.Further, if R peak is known, then these two waves can be identified from itszone with fair accuracy. For instance, P peak can be approximated as the localmaxima between the R peak of the corresponding wave and T peak of the previouswave. After detecting P and T waves, boundary the ECG wave is determined. 3.

1   Preprocessing the signals Electromyogram (EMG) signals thatoriginate from muscles corrupt the raw ECG signals. High frequencyinterferences, DC offset and baseline wandering occurring from electricalequipmentscan also corrupt it 7. In order to reduce these noises, the signalis passed through a bandpass filter with cutoff frequency of 3 Hz and 45 Hz. Todetect the R peaks, the Hamilton segmentation algorithm 8 is used on thefiltered ECG signal. 3.

2   Detection of the peakof P wave After locating R peaks, wedetermine the location of P peaks. From the structure of ECG signal we findthat P peak can be approximated as the local maxima between T peak of theprevious waveform and R peak of the present waveform. But the region between Tand R peaks is quite wide, can be noisy and have multiple peaks and troughs. Soit can lead to increased false positives if entire region is considered. Hence,a smaller context window of 100 ms duration is used which is offset from R peakby 100 ms on the left as shown in Fig 2. The maximum of the values in the context window is chosen as the peak ofP wave. Fig.

2.M and N is the onset and offset of P wave respectively; M and Nare 100 ms apart; Point Nis 100 ms offset from R peak.  3.3   Detection of the peak of T waveIt is more difficult toaccurately detect T wave than detecting QRS complex. This is due to lowsignal-to-noise ratio (SNR), low amplitudes, variation in morphology andamplitude and probable overlapping of P and T waves 10. Thus the initiallyfiltered signal is again passed through a 2nd order butterworth filter havinglower and upper cutoff frequency of 0.

5 Hz and 25 Hz. As already mentionedbefore in section 2, T wave may be inverted in certain cases. Hence, within thecontext window, the T peak can be either the maxima or minima, depending onwhich one has the maximum absolute magnitude. To eliminate this uncertainty,all the values within the window are squared. This essentially makes the T peakto be located at the index of the value having maximum squared magnitude. Butif the T peak is inverted, the voltage level at the peak might possibly liebetween 0 mV and -1 mV.

Thus squaring a value between 0 and 1 will make thevalue even smaller. Thus 1 mV is added to all the values before squaring.T waves havelonger duration compared to P wave. Also QT interval is longer than PRinterval. Thus the size of context window is set to 200 ms and its onset iskept at 200 msahead of R peak. Fig. 3 shows the window boundaries M and N forlocating T peak. Fig.

3.M and N is the onset and offset of T wave respectively; M and Nare 200 ms apart; Nis 200 ms ahead of R peak.  3.

4Estimating theboundaries of ECG wave As stated earlier, P wave and T wavemarks the beginning and end of one ECG cycle respectively. On having determinedthe location of peak of P wave and T wave, the onset and offset of ECG segmentscan be estimated. Since P wave is approximately 80 ms in duration, we set theonset of ECG wave as 50 ms off the peak of the P wave. Also T wave is about 250ms in duration.

Thus the end of ECG segment is set to 100 ms ahead of T peak.Fig. 4 shows the boundary estimation performance of our proposed method on 2ECG samples.    Fig. 4. The points A and Bis the estimated boundaryof 1stECG cycle.

The points C and D is the estimated boundary of 2nd ECG cycle.   4  Results and Discussions Theresults obtained after quantitative analysis of our model on all the 105records in database is discussed here. A total of 9 sets of annotation filesare considered in the dataset.

We have chosen two sets of annotation files fromthe dataset – .pu0 and .q1c for verification of our proposedmethod. The .pu0 annotation has thewaveform boundary measurements automatically determined for all beats. The.q1c annotation contains manuallydetermined waveform boundary measurements for some beats.

The results are comparedagainst reference annotations allowing for a 5% tolerance level; ,a predictionis considered to be correct if its value lies within a range of ±5% of thereference value. Table 1. Evaluationresults. Wave Annotation Total number of correct predictions Total number of incorrect predictions Overall Accuracy Median Accuracy P .pu0 88652 88 0.9990 1.

0 .q1c 2724 189 0.935 1.0 T .pu0 73133 2093 0.

9721 1.0 .q1c 2323 1040 0.6908 1.0  For each P andT, the total number of correct predictions are listed. Moreover, the totalnumber of incorrect predictions, overall accuracy and median accuracy acrossall the 105 records are determined using our proposed method for the respectivepeaks and troughs.

The resultsthat we have obtained are exceptionally good. A median accuracy of 100% isachieved on 105 records for both the waves on both reference annotations. Theaccuracy for .q1c annotations is not as good as that obtained for .pu0annotations. However,manual inspection of .

q1c annotations showed us that manyannotations were fairly deviated from where they should be. Also table 1.shows that the overall accuracy for T peak detection is lower than the P peak.It is to be mentioned that detecting T peaks is in fact an inherently difficulttask due its varying morphology 9. The approximation used in this proposedmethod to detect boundaries of T wave works accurately for most classes of ECGsignal but may provide inaccurate results for some abnormal ECG signals. Thiscan be considered as a limitation of our proposed method. 5   ConclusionIn this work we demonstrate anaccurate and efficient method to segment ECG signals by detecting the peaks ofP waves and T waves.

The information of P and T waves gives an estimatedboundary of an ECG cycle. The algorithm has O(n) complexity with respect tosize of ECG input data. The proposed technique is shown to be highly robust fora wide class of ECG signals. AcknowledgmentsThe authors would like to thankInnovation & Entrepreneurship Development Centre, NIT Silchar for fundingthis project. The authors are also grateful to Mr. Arkajyoti Saha and Ms.Maitrayee Deb of Silchar Medical College and Hospital for their valuable inputsand suggestions.References1 Badilini, Fabio F.

“Methodand apparatus for extracting optimum holter ECG reading.” U.S.

Patent8,560,054, issued October 15, 2013.2 Hoffman, B.F. and Cranefield, P.F.

,1960. Electrophysiology of the Heart.McGraw-Hill, Blakiston Division.3 Joshi, Anand Kumar, ArunTomar, andMangeshTomar. “A Review Paper on Analysis of Electrocardiograph (ECG)Signal for the Detection of Arrhythmia Abnormalities.

” InternationalJournal of Advanced Research in Electrical, Electronics and InstrumentationEngineering 3, no. 10 (2014).4 Laguna P, Mark RG, Goldberger AL,Moody GB.

A Database forEvaluation of Algorithms for Measurement of QT and Other Waveform Intervals inthe ECG. Computers inCardiology24:673-676 (1997)5 Moody GB, Mark RG. The impact ofthe MIT-BIH Arrhythmia Database. IEEE Engin Med and Biol 20(3):45-50 (May-June 2001). (PMID: 11446209)6 Taddei A, Distante G, Emdin M,Pisani P, Moody GB, Zeelenberg C, Marchesi C. The European ST-T Database:standard for evaluating systems for the analysis of ST-T changes in ambulatoryelectrocardiography. European HeartJournal13: 1164-1172 (1992)7 Thakor, Nitish V.

, and Y-S. Zhu. “Applications of adaptivefiltering to ECG analysis: noise cancellation and arrhythmiadetection.” IEEE transactionson biomedical engineering 38.8 (1991): 785-794.8 Hamilton, P. “Open source ECG analysis.

” In Computers in Cardiology, IEEE (2002): 101-104.9 Elgendi, Mohamed, Bjoern Eskofier, and Derek Abbott. “Fast T wavedetection calibrated by clinical knowledge with annotation of P and Twaves.” Sensors 15,no. 7 (2015): 17693-17714.10 Pan, Jiapu, and Willis J.Tompkins.

“A real-time QRS detection algorithm.”IEEE transactions on biomedical engineering 3 (1985): 230-236.11 Li, Cuiwei, Chongxun Zheng, andChangfeng Tai. “Detection of ECG characteristic points using wavelettransforms.”IEEE Transactions onbiomedical Engineering 42, no.

1 (1995): 21-28.12 Coast, Douglas A., Richard M.Stern, Gerald G.

Cano, and Stanley A. Briller. “An approach to cardiacarrhythmia analysis using hidden Markov models.”IEEE Transactions on biomedical Engineering 37, no. 9 (1990):826-836.

13Gritzali, F., G.Frangakis, and G. Papakonstantinou. “Detection of the P and T waves in anECG.” Computers and Biomedical Research 22, no. 1 (1989):83-91.14 Chatterjee, H.

K., R. Gupta, and M. Mitra. “Real time P and T wavedetection from ECG using FPGA.

” Procedia Technology4 (2012):840-844.15 Leutheuser, Heike,Stefan Gradl, Lars Anneken, Martin Arnold, Nadine Lang, Stephan Achenbach, andBjoern M. Eskofier. “Instantaneous P-and T-wave detection: Assessment ofthree ECG fiducial points detection algorithms.

” In Wearable and Implantable Body Sensor Networks (BSN), 2016 IEEE 13thInternational Conference on, pp. 329-334. IEEE, 2016.16 Mehta, S. S.

, and N.S. Lingayat. “Detection of P and T-waves in Electrocardiogram.” In Proceedings of the world congress onEngineering and computer science, pp. 22-24.

2008.17 Lagerholm, Martin,Carsten Peterson, Guido Braccini, Lars Edenbrandt, and Leif Sornmo.”Clustering ECG complexes using Hermite functions and self-organizingmaps.

“IEEE Transactions onBiomedical Engineering 47, no. 7 (2000): 838-848.18 Goutas, Ahcène, Youcef Ferdi, Jean-Pierre Herbeuval, Malika Boudraa, andBachir Boucheham. “Digital fractional order differentiation-basedalgorithm for P and T-waves detection and delineation.” ITBM-RBM 26,no. 2 (2005): 127-132.19 Laguna, Pablo, Raimon Jané, and Pere Caminal.

“Automatic detectionof wave boundaries in multilead ECG signals: Validation with the CSEdatabase.” Computers and biomedical research 27, no. 1(1994): 45-60.



I'm Katy!

Would you like to get a custom essay? How about receiving a customized one?

Check it out