Automatic detection of the electrocardiogram T-wave end I. K. Daskalov
I.I. Christov
Centre of Biomedical Engineering, Bulgarian Academy of Sciences, Acad. G, Bonchev str., BL105,
Sofia 1113, Bulgaria AbstractmVarious methods for automatic electrocardiogram T-wave detection and Q-T interval assessment have been developed. Most of them use threshold level crossing. Comparisons with observer detection were performed due to the lack of objective measurement methods. This study followed the same approach. Observer assessments were performed on 43 various T-wave shapes recorded: (i) with lOOmms -1 equivalent paper speed and 0.5mVcm - I sensitivity; and (ii) with 160rams -7 paper speed and vertical scaling ranging from 0.07 to O.02mVcm -~, depending on the T-wave amplitude. An automatic detection algorithm was developed by adequate selection of the T-end search interval, improved T-wave peak detection and computation of the angle between two lO ms long adjacent segments along the search interval The algorithm avoids the use of baseline crossing and direct signal differentiation. It performs well in cases of biphasic and/or complex Twave shapes. Mean differences with respect to observer data are 13.5ms for the higher gain/speed records and 14.7ms for the lower gain/speed records. The algorithm was tested with 254 various T-wave shapes. Comparisons with two other algorithms are presented. The lack of a "gold standard" for the T-end detection, especially if small waves occur around it, impeded adequate interobserver assessment and evaluation of automatic methods. It is speculated that a simultaneous presentation of normal and high-gain records might turn more attention to this problem. Automatic detection methods are in fact faced with "high-gain" data, as high-resolution analogue-to-digital conversion is already widely used. Keywords--Electrocardiogram, T-wave end detection, Automatic detection algorithm, Signal processing. Med. Biol. Eng. Comput., 1999, 37, 348-353
1 Introduction
MANY STUDIES were conducted linking the changes in QT interval and QT interval dispersion to risk or prognosis in patients of ventricular arrhythmia and fibrillation and other cardiac complications, and eventually of sudden cardiac death (AHNVE et al., 1978; PUDDU et aL, 1981; PUDDU and BOURASSA, 1986; DAY et aL, 1990; BARR et al., 1994; LO et al., 1996). Therefore, the importance and significance of automatic measurement of this interval raises methodological and algorithmic problems. They have been assessed by many authors (COWAN et al., 1988; MERRI et aL, 1989; LAGUNAet aL, 1990; STATTERSet al., 1994; FRANZ, 1994; MOLNARet al., 1996; XUE and REDDY, 1996). While the onset of the QRS complex can be measured with good accuracy due to its higher frequency content (MURRAY and MCLAUGI-ILIN,1995), :the Twave end presents greater difficulties. Observer determination shows dispersion and dependence Of the recording parameters (MURRAY et aL, 1994). Algorithms for automatic T-end measurement depending on signal derivatives and baseline
Correspondence should be addressed to Professor Dr. Eng L K. Daskalov; emaih
[email protected] First received 25 August 1998and in final form 13 January 1999 9 IFMBE: 1999 348
crossing (LAGUNA et al., 1990; MCLAUGHLINet al., 1995; XUE and REDDY, 1996) may strongly depend on noise and wave shape. A related problem is the accurate detection of the T-wave peak, from where the end is to be found (especially in biphasic waves), not uncommon when measuring dispersion in the 12 leads. We are concerned in this study with automatic T-end detection by adequate preprocessing and scaling, avoiding the use of direct signal differentiation and threshold crossing. Thresholds are used for delineating search intervals, but not for T-end and T-peak detection, where a function for assessment of the angle between adjacent slopes is used.
2 Method
For an experiment on visual T-end detection by independent observers we selected 43 ECG T-waves from our database of 12-channel records, with 400 Hz sampling rate and 4.88mVbit -1 resolution, in an attempt to include as many different shapes as possible. A comb filter was applied with a first zero at 50 Hz so as not to disturb T-wave waveforms. QRST complexes were amplified and recorded (with smoothly joined sampled points) by an ink-jet ~rinter on white paper with an equivalent speed of 100 m m s- , and vertical scale of
Medical & Biological Engineering & Computing
1999, Vol. 37
0.5 mV cm -~. A second recording of the T-waves of the same records was obtained with 160 mm s -l horizontal scale and vertical scale adjusted (depending on each T-wave amplitude) to give a span of 5 cm. This was equivalent to a scaling in the range 0.07 to 0 . 0 2 m V c m -t. Electrocardiogram records with absolute arrhythmia, intermittent AV blocks and WPW syndrome were not included in this study. The selected QRST complexes in both recording formats were given to three experienced cardiologists and one biomedical engineer (not one of the authors) for visual marking of the T-end using a fine needle. They were unaware of the fact that the unlabelled recordings, plotted and arbitrarily mixed with the two types of scaling, were from the same selection of 43. In other words, the observers were given 86 apparently different recordings for assessment. The T-end coordinates were then measured by a digitiser. The observer markings in the different records were transferred to one record per corresponding wave to enable comparison. In addition, the following procedure for automatic detection was applied. 1. QRS detection and calculation of the Q T interval by the well-known relation Q T = 0.4(RR) 1/2 [s]
2. An 'isoelectric' (flat or of low slope) segment to the right of the QRS is searched, according to the following criteria:
3. Two adjacent segments forming 'wings' are defined, each segment being of 40 ms length: W 1 = Si_16 -
4. A point Tis is searched starting 10ms after Tp, where the end part of the T-wave has a local extremum or where it is nearly flat, by measuring the product of two 'wings' of 5 ms length. If (Si_ 2 -
-0.0
T R y _ _t _ q 600 800 ills a
i
-0.32~ -0.34~ :~ -0.36
600 rrI$ b
800
Tis ~
/
i 700
TO
_
-0.42 680
///
ms c
r
720
3 ~tV
then i is taken as the abscissa of Tis (Figs. la and c).
Tampl = ISrp - S~sl 6. A search region starting point Ts is defined, where Ts = 0.2T~npl, as shown in Fig. lc, which is a 'zoomed' presentation of the interval Ts - Tis in Fig. la. The procedure described in points 1 to 6 is used for evaluation of the interval wherein the T-end should be searched. 7. The smallest angle between 'wings' of 10ms length, the interval Ts - Tis , is taken as the T-end (Fig. lc).
3 Results
i
400
Si+2) <
The threshold values used above for defining search intervals were set after tests on 254 T-waves from our database. The 'slope intercept' and 'peak slope intercept' procedures for T-end detection were borrowed from the work of MCLAUGHLIN et al. (1995). The search intervals and T-peak detection described above were used for applying the two intercept algorithms, as no alternative was originally proposed by the authors. These two procedures were compared with our method throughout the study.
ri~ r ~ ~
~
Si)(S i -
5. The T-wave amplitude is given by
9 slope condition if the above condition is met: the difference between the boundary samples of the 20 ms segment should be less than Crit. The most right sample of this segment is taken as the 'isoelectric' point right of QRS (Sis, Fig. la).
, 400
Si+16
The 'wings' function (W 1 multiplied by W2) obtained at each successive sample in the interval from Sis to the end of the Q T interval prolonged by Q T / 7 ms, is shown in Fig. lb. The minimum of this function corresponds to the T-wave peak: Tm Checking for biphasic T-wave is done by searching for a second negative peak of the 'wings' function Q T / 6 ms after the first one is found. If there is such a second peak and its amplitude is greater than 80% of the amplitude of the first, the wave is considered as biphasic. Then this second extremam determines Tp, needed for further application of the T-end detection algorithms. This procedure, based again on the 'wings' function, is used also for undulating wave peak detection. These 'wings' have been introduced as an efficient means not only for peak detection, but also for evaluation of the signal slope, as shown in items 4 and 7 of this section.
Crit = O.O08(max(Q R S ) - min(Q RS) )
-0.6
W 2 ~-- S i -
where S are the corresponding signal samples.
9 linearity condition: eight successive differences between adjacent samples spaced at 2.5 ms should be less than Crit. Here Crit is not fixed, but is defined as a percentage (0.8% in this case) of the QRS peak-to-peak excursion:
-0.2 -0.4
Si
i
740
Fig. 1 Presentation of the algorithm. (a) T-wave end with markings of the algorithm characteristic points. (b) 'Wings 'function for searching the T-wave peak. (c) Zoomed portion of the search interval Medical & Biological Engineering & Computing
Table 1 shows the statistical data of deviations for each observer between his own detected points in the low-gain/ speed and high-gain/speed recordings. Table 2 shows the statistical data of detected points deviations from the mean value for all observers, obtained from high and low-gain recordings. Deviations from the algorithm detected points taken as a base and the four observer's detections (from high and lowgain recordings) are given in Table 3. A typical example of these tests (data given for one observer only, for simplicity) is shown in Fig. 2, where normal (a) and high-gain (b) records are shown. The T-end points marked by the observer in the higher gain records are labelled 'o' and the
1999, Vol. 37
349
Table 1 Differences in each observer detection from high and low gain records
Deviation [ms]
First cardiologist Second cardiologist Third cardiologist Biomed. Engineer
Max
Mean
Standard deviation
Ao.95*
66.7 30.8 74.2 56.2
19.7 11.7 14.3 17.1
15.8 7.0 12.2 14.9
4.86 2.16 4.40 5.26
* A0.95 = to.95S(N) 1/2
Table 2 Differences in observer detections with respect to the overall mean values
Deviation [ms]
Higher gain Smaller gain
Table 3
Max
Mean
Standard deviation
Ao.95
56.7 64.2
10.6 8.8
14.2 12.6
3.27 2.70
Differences between observer and algorithm detection
detected points in the lower gain are labelled 'x'. These marks have been transferred from one type of record to the other, to better express the differences. The usual findings were as in Fig. 2: observers marked the T-end in the high-gain version at points located more to the right, then points in the lower-gain records. From 86 T-wave end assessments there were 15 exceptions to the above described findings, with one example shown in Fig. 3 (a-normal and b-high-gain record), where the opposite observer decision occurred. Some o f the results from a total of 254 automatic detections are demonstrated in Figs. 4-8. With well-shaped monophasic T-waves, typically obtained data are shown in Fig. 4. Vertical lines mark the detected points. The shortest lines correspond to the 'peak slope intercept' method, the medium length lines are used for the 'slope intercept' and the longest lines are for the proposed method. This type o f marking is used in all figures. Fig. 5 shows detection in the case of a negative T-wave. A more complicated case with undulating T-wave and U-wave is presented in Fig. 6. Biphasic T-wave end detection is demonstrated in Fig. 7. An example showing the advantage of a higher gain presentation is given in Fig. 8. The results shown in Figs. 4 to 8 are representative of the 254 T-wave shapes studied. For the sake of demonstration one record was taken with atrial flutter. The F-waves in a V1 lead (Fig. 9a and b) did not prevent correct detection, as proven by the data from lead II of the same patient (Fig. 9c and d), but this is not so for other atrial flutter cases.
Deviation [ms]
Higher gain Smaller gain
Max
Mean
Standard deviation
A0.95
73.8 78.0
13.5 14.7
14.8 15.4
4.15 4.52
4 Discussion
The data from the observer experiment showed considerable differences in measurement o f one and the same wave from records of different amplification (Fig. 2, Tables 1 and 2). Slightly better clustering between observers was found in the
1.0
1.0
0.5
0.5
0
o
-0.5
-0.5
-1.0
-1.0
I
I
I
a 0.10
l
-0.08 0.05
-0.10 > -0.12 E -0,14
o -0.05
-0.16 -0.1
-0.18
4OO 6O0 800
4OO
350
600
800
b
b
Fig. 2
-
The most common observer markings in lower (a) and highergain (b) records. The T-end points marked in the higher gain records are labelled by "o' and the detected points in the lower gain are labelled by 'x'. These marks have been transferred from one type of record to the other, in order to better express the differences.
Fig. 3
Observer marks in a case of biphasic T-wave in lower (a) and higher-gain (b) records. The T-end points marked in the higher gain records are labelled by 'o" and the detected points in the lower gain are labelled by 'x'. These marks have been transferred from one type o f record to the other, in order to better express the differences
Medical & Biological Engineering & Computing
1999, Vol. 37
1.51
0.5 1.0
>0.5E0
:~ -0.5 -1,0
-0.5 -1.5
I
I
a
a 0.8
-0.2 r
0.6 0.4
~ -o.4 "r 0.2 0 -0.6 - ~ Ill 400
t 600 1338 b
I 800
400
Fig. 4 Automatic detection in a well-shaped monophasic T-wave. Short mark-`peak slope intercept' method; medium mark'slope intercept' method, and long mark-proposed algorithm, in lower (a) and in higher gain (b) records
low-gain records. Looking at the highly amplified T-waves, we tend to accept the corresponding detections as more accurate, compared to those from conventional records, but the lack of an accepted standard precludes any objective corroboration. With lower amplification observers tend to mark the T-end earlier in time (Fig. 2). This may be due to the fact that small peaks appearing at the wave end are not seen in this scaling. These findings correspond to those of MURRAY et al. (1994), which showed a tendency for longer QT interval observer data with higher gain recordings.
Fig. 6
I 600 ms b
I 800
A case with undulating T-wave. Short mark-'peak slope intercept' method; medium mark-'slope intercept' method; and long mark-proposed algorithm, in lower (a) and in higher gain (b) records
One of the 15 exceptions found (from a total of 86 observer markings) is demonstrated in Fig. 3. Here the T-wave shows a slight biphasic course (Fig. 3b). The negative deflection seen in high amplification (Fig. 2a) was not included in the wave (in the low-gain record) by the observer. Similar patterns seen in the high-gain records could explain these exceptions. The observer experiment as a whole was not directed towards assessment of observers' abilities and the dependence upon recording parameters, which has been well documented in previous studies. Our intention was to show that the lack of a
1.0 0
0,5
> E
-0.5 I
-1.0
-0.5 -1.0
-1.5 I
I
a
I -2.0 I
I a
I
400
600 ms b
800
0.20 -0.8 0.15 >
E
-0.9 0.10 :~ -1.0 0.05 -1.1
I
4OO
6OO ms
8OO -1.2
b Fig. 5
Automatic detection in a case of negative T-wave. Short mark-'peak slope intercept' method; medium mark-'slope intercept" method; and long mark-proposed algorithm, in lower (a) and in higher gain (b) records. The shorter and longer marks are placed one under the other, as they virtually coincide
Medical & Biological Engineering & Computing
1999, Vol. 37
Fig. 7
Biphasic T-wave end detection. Short mark-'peak slope intercept' method; medium mark-'slope intercept' method; and long mark-proposed algorithm, in lower (a) and in higher gain (b) records 351
1
> E 0
-1
I
I
I
a
b
-0.2
0
I
400
600 Ills b
800
Fig. 8 An example where the T-end seems inadequately marked by the algorithm (a), but the high-gain record (b) shows the mark was correctly positioned. Short mark- 'peak slope intercept' method, medium mark-"slope intercept' method; and long mark-proposed algorithm
'gold standard' for T-end detection, especially if small waves occur around it, impedes precise evaluation of automatic methods. These methods are faced, in fact, with 'high-gain' and 'high-speed' data, as currently high-resolution analogueto-digital conversion is preferred and widely used. A question could be raised concerning optimal recording formats to obtain maximum acceptable detectability by visual
:~
0.5
1.0
0
0.5
-0.5
o
-1.0
-0.5
-1.5
-1.0 I
I
I
I
a
I
I
c
-0,40
0.10 ,!
-0.45
0.05
-0.50
o
-0.55
-0.05
400
600 ms b
800
The lack of a 'gold standard' for the T-end detection impedes adequate comparison between observers and the evaluation of automatic methods. The T-wave end detection by several observers showed a slight tendency towards better consistency when lower-gain records were used, although marked differences were found in detections of the same Twave end in high and low-gain records. The question could be raised whether observer/manual measurement should be performed on standard recording formats. It remains to be seen whether further adequate expansion of the horizontal scale above 100 mm s -1 would improve observer assessment. Maybe a simultaneous presentation of low and high-gain records might improve visual detection. The proposed algorithm favourably compares with visual assessment (especially from high-gain records) and with two published algorithms. It avoids the use of baseline crossing and direct signal differentiation in the T-end marking. Its acceptable performance in cases of biphasic and/or complex T-wave shapes is due to accurate T-peak detection, to adequate selection of the T-end search interval and to the computation of the angle between 10ms long adjacent segments along this interval. National Research Fund, Grant MU-BM-25/96.
1
I
I
400
600 ms d
800
References
Fig. 9 A case with atn'alflutter. F-waves are present in the V1 lead, but the T-end was correctly detected (a, b) as proven by the lead 11 record (c, d). Short mark-'peak slope intercept" method; medium mark-"slope intercept' method; and long mark-proposed algorithm, in lower (a, c) and in higher gain (b, d) records
352
5 Conclusion
Acknowledgment--This work was supported in part by the
-0.10
-0.60
assessment. It should also be noted that mean deviations between the proposed method and observer data are acceptable. The good performance of the algorithm in negative and biphasic waves is due to the accurate location of the last Twave extremum (Figs. 5 and 7). The undulating monophasic Twave with U-wave in Fig. 6 was correctly detected at step 6 of the algorithm. The example of Fig. 8 shows that, although the algorithmdetected T-end seems too far, the amplified recording confirms that this was a correct position. Other similar cases were found. The example of a record containing atrial flutter (Fig. 9) was included to illustrate that in some cases a relatively well expressed T-wave could be"detected even in the presence of F-waves. This example does not mean that T-end detection was successful in other cases of atrial flutter or fibrillation. The overall performances of the proposed algorithm and the 'slope intercept' and 'peak slope intercept' methods were comparable in cases of well-shaped T-waves, but it should be underlined that the T-wave peak and the baseline point were detected with the proposed procedure. Moreover, in some complex shapes the algorithm was of better accuracy, as judged from tests with the 254 cases and represented by the examples of high-gain records shown in Figs. 4-8. The proposed search interval was tested on cases with long QT and especially where long QT was combined with short RR (stress-testing, cases of acute cor pulmonale and pulmonary emboly, myocardial infarction with tachycardia, thyreotoxicosis, etc.) The reserve provided by adding QT/7 and the fact that T-peak is searched in this interval and not T-end, proved sufficient in all considered cases.
AHNVE, S., LUNDMAN, T. and SHOALEH-VAR,M. (1978): 'The relationship between QT interval and primary ventricular fibrillation in acute myocardial infarction', Acta Med. Scand., 204, pp. 17-19 BARR, C. S., NAAS, A., FREEMAN,M., LANG, C. C. and STRUTHERS, A. D. (1994): 'QT dispersion and sudden death in chronic heart failure', Lancet, 343, pp. 327-329
Medical & Biological Engineering & Computing
1999, Vol. 37
COWAN, J. C., YASOFF,K., AMOS, P. A., GOLD, A. E., BOURKE, J. R, TANSUPHASWADIKUL,S. and CAMPBELL, R. W. E (1988): 'Importance of lead selection in QT interval measurement', Am. J Cardiol., 61, pp. 83-87 DAY, C. R, MCCOMB, J. M. and CAMPBELL, R. W. E (1990): 'QT dispersion: an indication of arrhythmia risk in patients with long QT intervals', Brit. Heart J., 63, pp. 342-344 FRANZ, M. (1994): 'Time for yet another QT correction algorithm? Bazett and beyond', J Am. Coll. Cardiol., 23, pp. 1554-1556 LAGUNA, P., THAKOR, N. V, CAMINAL, P., JANE, R., YOON, H. R., BAYES DE LUNA, A., MARTI, V. and GUINDO, J. (1990): 'New algorithm for QT interval analysis in 24-hour Holter ECG: performance and applications', Med. Biol. Eng. Comput., 28, pp. 67-73 LO, S. S. S., MATHIAS,C. J. and SUTTON,M. S. J. (1996): 'QT interval and dispersion in primary autonomic failure', Heart, 75, pp. 498501 MCLAUGHLIN,N. B., CAMPBELL,R. W. E and MURRAY,A. (1995): 'Comparison of automatic QT measurement techniques in the normal 12 lead electrocardiogram', Br. Heart J., 74, pp. 84-89 MERRI, M., BENHORIN, J., ALBERTI,M., LOCAT,E. and MOSS, A. J. (1989): 'Electrocardiographic quantitation ofventricular repolarization', Circulation, 80, pp. 1301-1308 MOLNAR, J., ZHANG, E, WEISS, J., EHLERT,E A. and ROSENTHAL,J. E. (I996): 'Diurnal pattern of QTc interval: how long is prolonged? Possible relation to circadian triggers of cardiovascular events', J Am. Coll. Cardiol., 27, pp. 76-83 MURRAY, A. and MCLAUGHLIN, N. B. (1995): 'Variation in the identification of Q wave initiation and its contribution to QT measurement', Physiol. Meas., 16, pp. 39-42 MURRAY, A., MCLAUGHLIN, N. B., BOURKE, J. P., DOIG, J. C., FURNISS, S. S. and CAMPBELL,R. W. E (1994): 'Errors in manual measurement of QT intervals', Br. Heart J., 71, pp. 386-390 PUDDU, P. E., JOUVE, R., TORRESANI,J. and JOUVE, A. (1981): 'QT interval and primary ventricular fibrillation in acute myocardial infarction', Am. HeartJ., 101, pp. 118-119
Medical & Biological Engineering & Computing
PUDDU, P. E. and BOURASSA, M. G. (1986): 'Prediction of sudden death from QTc interval prolongation in patients with chronic ischemic disease', J Electrocardiol., 19, pp. 203-212 STATTERS, D. J., MALIK, M., WARD, D. E. and CAMM, J. (1994): 'QT dispersion: problems of methodology and clinical significance', J Cardiovasc. Electrophysiol., 5, pp. 672--685 XUE, Q. and REDDY,S. (1996): 'New algorithm for QT dispersion analysis', IEEE Comput. CardioL, pp. 293-296
Authors" biographies IVAN DASKALOVgraduated in Electronic Engineering, wrote his PhD thesis on complex stimulation for physiological research and carried out his DSc work on screening analysis of physiological signals. He has been a Professor of Biomedical Engineering at the Medical Academy Institute of Medical Engineering since 1976. Since 1993 he has been Director of the Centre of Biomedical Engineering Bulgarian Academy of Sciences. His current professional interests include biomedical signal analysis, electrical stimulation, ultrasonic diagnostic instrumentation and instrumentation for physiological research. [VAYLO CHRISTOVhas an MScEE in Medical and Nuclear Engineering, gained at the Faculty of Radio-electronics, Sofia. He joined the Institute of Medical Engineering of the Medical Academy, and obtained a research engineer position in 1981. His PhD thesis was on signal acquisition, analysis and processing of electrocardiograms. He joined the Centre of Biomedical Engineering at the Bulgarian Academy of Sciences in 1994 and since 1995 has been an Associate Professor of Biomedical Engineering. He is currently working on several projects, including biomedical signal analysis, microcomputer ECG, EEG and EGG instrumentation and portable ECG recorders.
1999,Vol. 37
353
Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.