ELEKTROTEHNIŠKI VESTNIK 78(3): 128–135, 2011 ENGLISH EDITION An algorithm to estimate the transient ST segment level during 24-hour ambulatory monitoring AlešSmrdel Faculty of Computer and Information Science, University of Ljubljana, Ljubljana, Slovenia E-mail: ales.smrdel@fri.uni-lj.si Abstract. An algorithm to estimate the transient ST segment level and to construct the ST segment-level functions from 24-hour ambulatory ECG records is presented. The algorithm was developed and tested using the Long-Term ST Database (LTST DB). Initially, the average heart beats are constructed from normal and non-noisy heart beats of the records of the database in a 16-second neighborhood of each heart beat. Then positions of the isoelectric reference point and the J point are located in each average heart beat. The ST segment-level functions are derived for each ECG lead as a difference in the amplitudes at the point of measurement of the ST segment level (80 ms after the J point) and at the isoelectric reference point. The aggregate average error between the amplitudes of the samples of the ST segment-level functions for all 86 records of the LTST DB, of the total duration of 1991:50:49 [h:min:sec], constructed automatically and those constructed using manually determined positions of the isoelectric reference points and J points was only 0.69 V (st. dev. 8.89 V). The ST segment-level functions derived contained no significant artifacts. Key words: 24-hour ambulatory ECG monitoring, ST segment level, position of the isoelectric level, position of the J point 1 INTRODUCTION The electrocardiogram (ECG) is a recording of the elec- trical activity of the heart. Abnormal heart conditions are reflected as changes in the ECG signal morphology. The most important are those in the ST segment level and in the ST segment morphology compatible with ischemia (ischemic changes). Since these changes are not always present and appear during normal daily activities, most often asymptomatically, the ECG is recorded over longer periods (24 hours or more). These ambulatory ECG (AECG) data may show wide and significant (>100 V) clinically significant transient changes in the amplitude of the ST segment level and in the ST segment morphol- ogy connected to ischemia. Unfortunately, non-ischemic changes in the ST segment amplitude and morphology can also appear. These changes are due either to the changes in the heart rate (heart-rate related changes), electrical axis of the heart caused by sudden changes in the body position (axis shifts), ventricular conduction of the heart (conduction changes), or effects of medications or normal diurnal activities (slow drifts). In order to detect transient ischemia and to differentiate between ischemic and non-ischemic changes, the ST segment- level functions should be constructed. They are needed to search in them transient ST segment episodes, which contain time dimension and lasting from 30 seconds up Received 6 January 2011 Accepted 23 February 2011 to several hours. The transient episode is characterized by the change in the ST segment level over time. Since transient ST segment episodes contain the time dimen- sion, tracking of the time course of the ST segment- level changes along the record has to be performed enabling correct estimation and detection of transient ST segment episodes. Huge amount of data necessitates use of automated procedures for construction of these functions. Many automated systems rely on analysis of the time domain ST segment-level functions for detection of ST segment changes [1], [2], [3], [4], [5], [6]. For such time domain systems to work reliably, the ST segment level has to be estimated accurately and the ST segment level functions have to be constructed reliably. The paper presents an accurate and reliable algorithm for estimation of the ST segment level. Its main advan- tage is int that its working on 24-hour ambulatory ECG records and in each heart beat determines the position of the J point. 2 METHODS The algorithm was developed and tested using the records of the Long-Term ST Database (LTST DB) [7]. The LTST DB contains 86 2- and 3-lead 24-hour AECG records of 80 patients, sampled at 250 samples per second ( T = 4 ms) per lead, collected during regular clinical practice. The records of the LTST DB AN ALGORITHM TO ESTIMATE THE TRANSIENT ST SEGMENT LEVEL DURING 24-HOUR AMBULATORY MONITORING 129 underwent a considerable preprocessing phase [7] during the development of the database, which included: obtain- ing a stable QRS complex fiducial point (FP) for each heart beat using the ARISTOTLE arrhythmia detector [8], noise removal, derivation of the instantaneous heart rate, automatic search for the positions of the isoelectric level, measurement of the ST segment level, deriva- tion of the Karhunen-Loève (KL) transform-based QRS complex and ST segment-morphology feature vectors, removal of abnormal heart beats and their neighbors, and removal of noisy heart beats in the KL feature space. Then human expert annotators of the LTST DB manually determined positions of the isoelectric level and J point for normal and non-noisy heart beats, which were used to derive the ST segment-level functions. The ST segment-deviation functions were then obtained as the ST segment-level functions from which the manu- ally annotated time-varying ST segment reference-level functions were subtracted. Finally, the transient ischemic and transient non-ischemic heart-rate related ST segment episodes were manually annotated in the ST segment deviation functions. The input to the developed algorithm were raw ECG data of the records and the ARISTOTLE’s fiducial points of normal and non-noisy heart beats which passed the LTST DB preprocessing phase. (The fiducial points are stored in *.ari files of the LTST DB and are available to the users of the LTST DB.) The algorithm initially constructs an average heart beat for each individual normal and non-noisy heart beat using normal and non- noisy heart beats in a 16-second neighborhood of the current heart beat. Fig. 1 shows an example of a two- lead average heart beat as seen in the lead 0 (above, x(0;k)) and in the lead 1 (below, x(1;k)), where k denotes the signal sample number. In these average heart beats, two procedures search for the isoelectric reference point (IRP) (the position of the isoelectric level) and for the J point (JP) (end of QRS complex) in each lead. To determine the position of the IRP, I(i;j), where i denotes the lead number and j denotes the heart- beat number, a procedure initially searches from the ARISTOTLE’s fiducial point, FP (j), backwards in each ECG lead up to the point FP (j) T Q (T Q = 60 ms) for a signal sample where the amplitude difference of two consecutive signal samples equals zero or changes the sign, Q(i;j). The Q(i;j) may actually be the end of the P-Q interval, the R peak or indeed the Q peak (see Fig. 1). Note that the ARISTOTLE’s fiducial point is not aligned with the R peak, but lies in the center of gravity of the QRS complexes detected (over all leads). The procedure then searches from Q(i;j) backwards to the point FP (j) T iso (T iso = 108 or 148 ms) for the “flattest” 20 ms interval [9]. The flattest 20 ms interval is defined as that interval, which yields the minimum sum of the absolute deviations of the differences of the signal Fiducial point (FP) R Lead 0, x(0,k) Lead 1, x(1,k) P wave Isoelectric level Q S J point (JP) J+60 ms J+80 ms T wave time time ST segment level 100 ms 500 uV Isoelectric level P-Q interval ST segment IRP Figure 1. Average heart beat with marked peaks and intervals. The heart beat is displayed in the lead 0 (x(0;k)) and in the lead 1 (x(1;k)). samples and the intervals own mean. The flattest interval found is considered as the P-Q interval containing the IRP, and the middle sample of this interval defines the position of the IRP, I(i;j). The usual average width of the QRS complex is about 80 ms for most people and in most cases, but sometimes heart beats with wider QRS complexes appear. On the other hand, the position of the ARISTOTLE’s fiducial point is placed in the center of gravity of the QRS complex, which is not necessarily close to the R peak. In such cases, the position of the IRP may lie quite far from the FP (j). For these reasons, the procedure searches for the position of IRP in two regimes [10]. For the records with wider QRS complexes, the procedure uses a longer interval for searching the position of the IRP, T iso = T P Qw = 148 ms; otherwise it uses shorter intervals, T iso = T P Q = 108 ms. The T iso is determined in the learning phase, encompassing the first 50 normal and non-noisy heart beats. In this phase, the procedure searches for I(i;j) using T iso = 108 ms and calculates the distance of the Q(i;j) from the FP (j). If this distance is T Q l = 48 ms or more for at least 40 out of the first 50 heart beats in at least one ECG lead, the T iso is set for all remaining heart beats to T iso =T P Qw ; otherwise it is set to T iso =T P Q . The fact is that the positions of the IRP in consecutive average heart beats should be close. Unfortunately, too fast changes in the position of the isoelectric level in consecutive heart beats may occur due to erroneously determined positions of the IRP. The procedure thus 130 SMRDEL calculates the average distance of the positions of IRP for a current heart beat from the corresponding fiducial points for the last N = 16 heart beats [10], D I (i;j) = 1 N N X m=1 (FP (j m) I(i;j m)) (1) and compares this average distance to the distance of the position of the current IRP, D I (i;j) =FP (j) I(i;j): (2) If the D I (i;j) and D I (i;j) differ for more than 8 ms, the procedure searches again for the flattest 20 ms interval, this time from the FP (j) D I (i;j), in either direction for 8 ms, towards the FP (j) D I (i;j), and the middle sample of this 20 ms interval defines the position of the IRP,I(i;j); otherwiseI(i;j) remains as previously determined [10]. This ensures robustness of the procedure and also enables tracking of slow changes in the distance of the positions of the IRP [10]. So far the positions of the IRP for a given heart beat in each single lead were obtained. Since the positions of the IRP in different leads for a given heart beat occur simultaneously, their estimates as determined by the algorithm are expected to be close. If the positions of the IRP for thej-th heart beat,I(i;j), from at least two different leads, differ for more than 8 ms, the procedure determines one unique final position of the IRP for thej- th heart beat for all leads; otherwise, the positions of the IRP,I(i;j), remain as determined. This unique position of the IRP is selected from the existing positions of the IRP, I(i;j), in this heart beat. The procedure sums up the absolute deviations over all leads (in 20 ms intervals) at each position of the IRP, I(i;j). The position of the IRP, I(i;j), for which this sum of absolute deviations over all leads is minimal is taken as one unique final position of the IRP for all leads,I(j). This rule ensures, that the positions of the IRP for the j-th heart beat in the leads are unique, but still allowing slight variations [10]. Next, another procedure of the algorithm searches for the position of the JP, J(i;j). The procedure initially searches forward in each ECG lead from the FP (j) up to a pointFP (j)+T S (T S = 32 ms) for a signal sample, where the amplitude difference of two consecutive signal samples equals zero or changes the sign, S(i;j). This may actually be the R peak or indeed the S peak (see Fig. 1). The procedure then searches from this point,S(i;j), (or simply again from theFP (j) if such a signal sample was not found) up to the pointS(i;j)+T J (T J = 68 ms) for the interval of the waveform which “begins to flatten” [10]. The procedure calculates, for each signal sample, the absolute amplitude difference between the mean of the signal samples in a 12 ms interval preceding and in a 12 ms interval trailing current signal sample. If the absolute difference between these two 12 ms intervals is less then K J = 15 V for the consecutive signal samples (within 12 ms), then the first signal sample within this 12 ms sequence is considered as the position of the JP, J(i;j). A slope criterion for the detection of the morphology change of the signal waveform was adopted from [11]. Sometimes, the correct position of the JP is simply not possible to determine automatically. If there exists no segment of the waveform beginning to flatten, the procedure sets the position of the JP simply 40 ms after theFP (j),J(i;j) =FP (j)+40 ms, since the usual average width of the QRS complex is 80 ms. Then the unique position of the JP for the j-th heart beat, J(j), is determined as the position of the JP from the leads which is the furthest from the FP (j), J(j) = max i=1;2::: (J(i;j)): (3) As was the case with the position of the IRP, the positions of the JP in consecutive average heart beats should be close. If the distances of the J points from the corresponding fiducial points in consecutive average heart beats are not similar, an erroneous estimation of the position of the J point would occurre. The procedure therefore calculates the average distance of the positions of the JP for a current heart beat from the corresponding fiducial points for the last N = 16 heart beats D J (j) = 1 N N X m=1 (J(j m) FP (j m)); (4) and compares this average distance to the distance of the position of the current JP, D J (j) =J(j) FP (j): (5) If the D J (j) and D J (j) differ for more than 8 ms, an error in estimation has probably occurred and the final position of the JP is moved for 8 ms, in either direction, towards the FP (j) +D J (j); otherwise the position of the JP, J(j), remains as previously determined [10]: J(j) = 8 < : J(j) 8 ms : if (D J (j) D J < 8 ms) J(j) + 8 ms : if (D J (j) D J > 8 ms) J(j) : otherwise. (6) This ensures robustness of the procedure and also en- ables tracking of slow changes in positions of the JP. Based on the position of the JP, J(j), and heart rate, the point of measurement of the ST segment level,S(j), is determined following [7]: S(j)= 8 > > < > > : J(j) + 80 ms : if HR(j)< 100 J(j) + 72 ms : if 100 HR(j)< 110 J(j) + 64 ms : if 110 HR(j)< 120 J(j) + 60 ms : if 120 HR(j); (7) where HR(j) denotes the heart rate at the j-th heart beat, measured in beats per minute [bpm]. Using the positions of the IRP and the point of measurement of the AN ALGORITHM TO ESTIMATE THE TRANSIENT ST SEGMENT LEVEL DURING 24-HOUR AMBULATORY MONITORING 131 0 (a) Heart rate 40 80 120 160 Lead 0 0 (b) ST Level Annotators -100 -50 50 100 0 (c) ST Level Algorithm -100 -50 50 100 Lead 1 0 (d) ST Level Annotators -100 -50 50 100 0 (e) ST Level Algorithm -100 -50 50 100 Annotations Annotators (f) Time [h:m:s] 11:00:00 11:30:00 12:00:00 12:30:00 13:00:00 13:30:00 14:00:00 14:30:00 15:00:00 15:30:00 16:00:00 16:30:00 Record: s20041 Figure 2. 6-hour excerpt of the ST segment-level functions of the record s20041 (refer also to Figs. 3, 4 and 5, record number 4) of the LTST DB, starting 11 hours after the beginning of the recording. Legend: (a) heart rate [bpm]; (b) and (d) the ST segment-level functions for the leads 0 and 1, respectively, constructed using manually determined positions (see text) [ V]; (c) and (e) the ST segment-level functions for the leads 0 and 1, respectively, constructed automatically by the developed algorithm [ V]; (f) the transient ischemic ST segment episodes for the leads 0 and 1, combined in the sense of the logical OR function (small rectangles below the line) and axis shifts for the leads 0 and 1 (small vertical lines below the line), as annotated by the human expert annotators of the LTST DB. The average errors (the leads 0 and 1, respectively, with standard deviations) for the positions of the IRP were: 1.42 3.74 ms and 1.33 4.54 ms; for the positions of the JP were: -1.52 6.23 ms and -0.83 7.12 ms; and for the amplitudes of the samples of the ST segment-level functions constructed were: 3.08 8.53 V and 4.43 11.00 V . ST segment level,S(j), in the average heart beats, given lead, the algorithm then constructs the ST segment-level function, s(i;j), as: s(i;j) =a(i;j) z(i;j); (8) where a(i;j) is the signal amplitude at the point of measurement of the ST segment level,S(j), andz(i;j) is the signal amplitude at the position of the IRP,I(i;j). Both amplitudes, a(i;j) and z(i;j), are determined as the mean values of amplitudes in a 20 ms interval surrounding S(j) and I(i;j). Optimization of the algorithm consisted from deter- mining the optimal values for the following architectural parameters: T Q , T Q l , T P Q , T P Qw , T S , T J , and K J . The values were initially estimated empirically on the basis of expert knowledge of the shape and duration of intervals of the ECG heart beat. For each combination of reasonable values (T Q = 60 ms, T Q l = 48 ms, T P Q = 84; 88; 92; 96; 100; 104; 108 ms, T P Qw = 148 ms, T S = 32 ms, T J = 68; 80; 92 ms and K J = 5; 10; 15; 20 V) the ST segment-level functions were derived. The aggregate average errors between the amplitudes of the samples of the ST segment-level functions derived automatically and those derived using manually determined positions of the IRP and JP were calculated. The best result in terms of the minimal ag- gregate average error (0.69 V) and without significant outliers in the ST segment-level functions was obtained using following values of the parameters: T Q = 60 ms, T Q l = 48 ms, T P Q = 108 ms, T P Qw = 148 ms, T S = 32 ms, T J = 68 ms, and K J = 15 V . 3 RESULTS Fig. 2 shows a 6-hour excerpt of the ST segment- level functions derived automatically and those derived using the manually determined positions of the IRP and JP. The transient ischemic ST segment episodes are clearly visible in the ST segment-level functions as significant changes in the amplitude (see also the episode annotations in Fig. 2.f). To complicate matters, there are also axis shifts present between the first two episodes (see the axis shift annotations in Fig. 2.f) and a slow drift, appearing in both leads throughout the record. A visual inspection and a comparison of the ST segment- level functions derived automatically and those derived using manually determined positions of the IRP and JP show that they resemble each other well, with no apparent significant artifacts. Table 1 shows the aggregate average errors between the automatically and manually determined positions of the IRP, between automatically and manually determined positions of the JP, and between the amplitudes of the samples of the ST segment level functions constructed automatically and using manually determined positions of the IRP and JP. (The positions of the IRP and the JP, 132 SMRDEL IRP JP ST segment level L 0 -2.80 7.55 ms -2.05 5.06 ms 0.38 9.17 V L 1 -3.59 7.77 ms -3.84 5.15 ms 1.60 8.73 V L 2 -2.70 6.70 ms -5.83 5.90 ms -2.23 8.27 V All -3.15 7.57 ms -3.22 5.18 ms 0.69 8.89 V Table 1. Aggregate average errors with standard deviations between automatically and manually determined positions of the IRP, of the JP, and of the amplitudes of the samples of the ST segment level functions obtained automatically and using manually determined positions of the IRP and JP, for the leads 0 (L 0), 1 (L 1), and 2 (L 2), and for all leads (All) of the LTST DB. The total length of the records in the LTST DB is 1991 h, 50 min and 49 sec, totally containing 7,831,024 normal and non-noisy heart beats. as determined manually by the human expert annotators of the LTST DB, are available to the users of the LTST DB and are stored in the *.16a files of the database.) The aggregate average error between the automatically and manually determined positions of the IRP for all the 190 leads of the LTST DB was -3.15 ms (st. dev. 7.57 ms), and the aggregate average error between automatically and manually determined positions of the JP for all the leads was -3.22 ms (st. dev. 5.18 ms). The aggregate average errors between automatically and manually determined positions of the IRP and JP were relatively small (considering that the time step between the signal samples is T = 4 ms), which indicates good “real world” performance of the algorithm. The aggregate average error between the amplitudes of the samples of the ST segment-level functions derived using automatically determined positions of the IRP and the JP and those derived using manually determined positions for all leads of the LTST DB, encompassing 7,831,024 normal and non-noisy heart beats, was 0.69 V (st. dev. 8.89 V) (see Table 1). As before, the error was relatively small (below 1 V), especially if we consider that the amplitude of the clinically significant change in the ST segment level is more than 100 V . On the other hand, we can see that the standard deviations were quite high, meaning that the samples of the ST segment- level functions obtained using automatically determined positions of the IRP and JP oscillated around the samples of the ST segment-level functions obtained by using manually determined positions. Fig. 3 shows results of a comparison of the au- tomatically and manually determined positions of the IRP, while Fig. 4 shows results of a comparison of the automatically and manually determined positions of the JP for all the 190 leads of the LTST DB. The average error between automatically and manually determined positions of the IRP was in most cases under 8 ms. In only four leads this difference exceeded 20 ms: the record 59 (s20561) in lead 0 and the record 80 (s30751) in all three leads. Similarly, the average error between the automatically and manually determined positions of the JP was in most cases under 8 ms. But in 14 leads the error in positions of the JP was over 20 ms: the record 5 (s20051) in both leads, the record 24 (s20241) in the lead 1, the record 35 (s20321) in both leads, the record 52 (s20491) in the lead 1, the record 53 (s20501) in both leads, the record 75 (s30721) in all three leads, and the record 84 (s30781) in all three leads. And in both leads of the record 35 (s20321), the error exceeded 40 ms. Fig. 5 shows results of a comparison between the amplitudes of the samples of the ST segment-level functions derived automatically and those derived using manually determined positions of the IRP and the JP for all 190 leads of the LTST DB. The average error was small and was under 10 V for majority of the leads. In only five leads the average error exceeded 25 V: the record 24 (s20241) in the lead 1, the record 34 (s20311) in the lead 1, the record 35 (s20321) in the lead 0, and the record 53 (s20501) in both leads. None of the records, with a large average error in positions of the IRP, exhibited a large average error in amplitudes, but in four out of the five leads with large average error in the amplitudes, automatically and manually determined positions of the JP differed extensively. Fig. 6 shows a 6-hour excerpt of the ST segment- level functions constructed automatically and those con- structed manually for the record s20501 (the record number 53) of the LTST DB, which is the worst case in estimating of the ST segment level in the records of the LTST DB. The average error between the samples of the ST segment-level functions derived automatically and using manually determined positions of the IRP and JP for this record was the greatest. The automatically derived functions actually resemble those derived us- ing manually determined positions of the IRP and JP quite well, although the amplitude of the samples of the automatically derived ST segment-level functions is constantly too high but never for more than 100 V . Also, after the time 13:30:00 the amplitude change after the axis shift is much too small in the automatically derived ST segment-level functions. This is most ob- vious approximately from 13:30:00 in the lead 0 and from 14:45:00 in the lead 1, to approximately 15:30:00 in both leads. The average error is quite high for this record, but still not producing any clinically significant artifacts. Note that the clinically significant ST segment- level change is 100 V . The error in estimating the ST segment-level for this record was due to the erroneously determined positions of J points (see Fig. 4, record number 53). 4 DISCUSSION AND CONCLUSIONS Automatically determined positions of the IRP are usu- ally set further from the fiducial point than those set AN ALGORITHM TO ESTIMATE THE TRANSIENT ST SEGMENT LEVEL DURING 24-HOUR AMBULATORY MONITORING 133 -40 -20 0 20 40 Average error [ms] Lead 0 -40 -20 0 20 40 Average error [ms] Lead 1 -40 -20 0 20 40 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 Average error [ms] Lead 2 Record number Figure 3. Results of a comparison between the automatically and manually determined positions of the IRP for the leads 0 (top), 1 (middle), and 2 (bottom) of the LTST DB. Average errors for each lead with standard deviations are shown. -40 -20 0 20 40 Average error [ms] Lead 0 -40 -20 0 20 40 Average error [ms] Lead 1 -40 -20 0 20 40 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 Average error [ms] Lead 2 Record number Figure 4. Results of a comparison between the automatically and manually determined positions of the JP for the leads 0 (top), 1 (middle), and 2 (bottom) of the LTST DB. Average errors for each lead with standard deviations are shown. manually, since the procedure is capable of differentiat- ing between small differences in “flatness”, eventually overlooked by a human expert. These differences in positions of the IRP do not cause any significant error in the ST segment-level functions. The automatically determined positions of the JP are usually set closer to the fiducial point than those set manually. A correction might be achieved by strengthening the condition for determining when the waveform begins to flatten. In general, this would cause the detection of the positions of the JP further from the fiducial point, but in some cases the condition could be too strict, the JP would not be found, thus a default position would be set which would then result in a greater error. For some records of the LTST DB, the expert human annotators set unique positions of the IRP for each heart 134 SMRDEL -40 -20 0 20 40 Average error [uV] Lead 0 -40 -20 0 20 40 Average error [uV] Lead 1 -40 -20 0 20 40 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 Average error [uV] Lead 2 Record number Figure 5. Results of a comparison of the amplitudes of the samples of the ST segment-level functions constructed on the basis of automatically determined positions of the IRP and the JP and those obtained on the basis of manually determined positions for the leads 0 (top), 1 (middle), and 2 (bottom) of the LTST DB. Average errors for each lead with standard deviations are shown. 0 (a) Heart rate 40 80 120 160 Lead 0 0 (b) ST Level Annotators -100 -50 50 100 0 (c) ST Level Algorithm -100 -50 50 100 Lead 1 0 (d) ST Level Annotators -100 -50 50 100 0 (e) ST Level Algorithm -100 -50 50 100 Annotations Annotators (f) Time [h:m:s] 12:00:00 12:30:00 13:00:00 13:30:00 14:00:00 14:30:00 15:00:00 15:30:00 16:00:00 16:30:00 17:00:00 17:30:00 Record: s20501 Figure 6. 6-hour excerpt of the ST segment-level functions of the record s20501 (refer also to Figs. 3, 4 and 5, record number 53) of the LTST DB, starting 12 hours after the beginning of recording. Legend: (a) heart rate [bpm]; (b) and (d) the ST segment-level functions for the leads 0 and 1, respectively, constructed using manually determined positions (see text) [ V]; (c) and (e) the ST segment-level functions for the leads 0 and 1, respectively, constructed automatically by the developed algorithm [ V]; (f) axis shifts for the leads 0 and 1 (small vertical lines below the line), as annotated by the human expert annotators of the LTST DB. The average errors (the leads 0 and 1, respectively, with standard deviations) for the positions of the IRP were: 2.85 4.41 ms and -8.05 5.38 ms; for the positions of the JP were: -24.30 11.91 ms and -36.69 12.03 ms; and for the amplitudes of the samples of the ST segment-level functions constructed were: 45.74 44.03 V and 50.33 40.37 V . beat, over all leads. These records were s20231, s20251, s20272, s20391, s20411, and from s20581 to s30801. They also set unique positions of the JP in records from s20581 to s30801. In all other records they set positions of the IRP and/or the JP in each lead separately. The developed algorithm sets the position of the IRP for each heart beat in each lead separately, except in the case where the “flat” intervals in different leads are wide AN ALGORITHM TO ESTIMATE THE TRANSIENT ST SEGMENT LEVEL DURING 24-HOUR AMBULATORY MONITORING 135 apart. In such cases, the algorithm treats the positions as erroneously determined, and sets robustly the unique position of the IRP for all the leads. Also, the algorithm always sets the unique position of the JP for all leads in heart beats. The aggregate average error between the amplitudes of the samples of the ST segment-level functions derived automatically and those derived using manually deter- mined positions of the IRP and the JP was small. Some leads exhibited a fairly high average error. However a visual inspection and a comparison of the automatically derived ST segment-level functions and those derived using manually determined positions of the IRP and JP showed that this did not lead to any significant artifacts in the ST segment level function, still keeping this algorithm suitable for automated derivation of the ST segment-level functions. Comparing the performances of the developed al- gorithm with other algorithms is not possible since there are no reported results on evaluation of other such algorithms. Many other algorithms generate the ST segment-level functions but they either do not at all search for the positions of the JP or do not report the performance in detecting the positions of the JP. Also, no other algorithm has been evaluated regarding the performance of determining the positions of the IRP. The LTST DB enables assessment of the performance of the algorithms detecting the positions of the IRP and JP, since the database includes manually set annotations of the positions of the isoelectric level and J point, but the performance of no such other algorithm has been estimated so far. Many algorithms used in detection of transient ischemia search for positions of the IRP and some even of the JP, but no results have been published. Determining of the positions of the JP in all ECG records is very difficult. Due to this reasons no results on performance of such algorithms exist. The developed algorithm is good since it determines positions of the JP in all ECG records of the LTST DB and is so far the only algorithm of which per- formances were evaluated using 24-hour records. The other algorithms using the LTST DB detect transient ST segment episodes, classify between the transient ST segment episodes and the non-ischemic events, or classify transient ST segment episodes into the ischemic and heart-rate related episodes, but nobody has so far evaluated their accuracy in determining positions of the IRP and JP, and accuracy in determining the ST segment-level according to manually set annotations which are available in the LTST DB. In conclusion, a simple, accurate and efficient algo- rithm to be used in automatic searching of the positions of the IRP and the JP, estimation of the ST segment- level and construction of the ST segment-level functions was developed. The algorithm performs well in 24-hour records of the LTST DB thus allowing for a reliable detection of the transient ST segment episodes. REFERENCES [1] F. Jager, R. G. Mark, and G. B. Moody, “Analysis of transient ST segment changes during ambulatory ECG monitoring”, Proc of Comput Cardiol 1991, pp. 453-456, 1991. [2] A. Taddei, G. Constantino, R. Silipo, M. Emdin, and C. March- esi, “A system for the detection of ischemic episodes in ambu- latory ECG”, Proc of Comput Cardiol 1995, pp. 705-708. [3] J. Garcia, L. Sörnmo, S. Olmos, and P. Laguna, “Automatic de- tection of ST-T complex changes on the ECG using filtered RMS difference series: application to ambulatory ischemia monitoring, IEEE Trans Biomed Eng, V ol. 47, pp. 1195-1201, 2000. [4] A. Smrdel and F. Jager, “Automated detection of transient ST segment episodes in 24-hour electrocardiograms”, Med Biol Eng Comp, V ol. 42, pp. 303-311, 2004. [5] A. Minchole, B. Skarp, F. Jager, and P. Laguna, “Evaluation of a root mean squared based ischemia detector on the Long-Term ST database with body position change cancellation”, Proc of Comput Cardiol 2005, pp. 853-856, 2005. [6] L. Dranca, A. Goñi, and A. Illaramendi, “Real-time detection of transient cardiac ischemic episodes from ECG signals”, Physiol Meas, V ol. 30, pp. 983-998, 2009. [7] F. Jager, A. Taddei, G. B. Moody, M. Emdin, G. Antoli"c, R. Dorn, A. Smrdel, C. Marchesi, and R. G. Mark, “Long-term ST database: a reference for the development and evaluation of automated ischaemia detectors and for the study of the dynamics of myocardial ischaemia”,MedBiolEngComp, V ol. 41, pp. 172- 182, 2003. [8] G. B. Moody and R. G. Mark, “Development and evaluation of a 2-lead ECG analysis program”, Proc of Comput in Cardiol 1982, pp. 39-44, 1982. [9] F. Jager, “Automated detection of transient ischemic ST-segment changes during ambulatory ECG-monitoring”, PhD thesis, Uni- versity of Ljubljana, Faculty of Electrical and Computer Engi- neering, 1993. [10] A. Smrdel, “Robust automated detection of transient ST segment episodes in 24-hour electrocardiograms”, PhD thesis, University of Ljubljana, Faculty of Computer and Information Science, 2004. [11] I. K. Daskalov, I. A. Dotsinsky, and I. I. Christov, “Development in ECG acquisition, preprocessing, parameter measurement, and recording”, IEEE Eng Med Biol, V ol. 17, pp. 50-58, 1998. Ale"s Smrdel is employed as lecturer with the Faculty of computer and Information Science, University of Ljubljana, Slovenia. His re- search interests include biomedical signal processing.