**4. Validation and results**

#### **4.1. QRS detection**

The developed algorithm for QRS detection [18] has been first tested on eight 30 min recordings resampled to 500 Hz from the MITDB [23], in which only channel 1 of the two-channel ECG recordings was used. The selected recordings included serious noise bursts, baseline drifts and movement artifacts. **Table 3** shows that QRS detector had 81 false QRS detections of 17,095 beats (0.47%); 51 of them were false positives and 30 were false negatives.


**Table 3.** Validation results for the QRS detection algorithm applied to eight records from the MITDB.

### **4.2. Delineation of characteristic points of the QRS complex and T wave**

and absolute values of the found local maxima (Wpt) or minimum (Wnt). **Figure 13** shows peak and end of the positive and biphasic T wave and their characteristic points of CWT at scale w3. Flowchart of the Tp and Te detection algorithm of T wave monophasic or biphasic

Once Qi and Te have been detected, the algorithm measures the QT and RR interval points in each quasi-orthogonal lead. Finally, the algorithm calculates QTd as the difference in duration between the longest and the shortest QT intervals measured in the three quasi-orthogonal leads, in which each QT interval is the average of three consecutive QT intervals. HR is calculated from the average of RR intervals measured in the same leads, in which each RR interval

The developed algorithm for QRS detection [18] has been first tested on eight 30 min recordings resampled to 500 Hz from the MITDB [23], in which only channel 1 of the two-channel ECG recordings was used. The selected recordings included serious noise bursts, baseline drifts and movement artifacts. **Table 3** shows that QRS detector had 81 false QRS detections of 17,095 beats (0.47%); 51 of them were false positives and 30 were

**Beats FP FN False detections**

 2272 0 1 1 0.04 1864 0 1 1 0.05 2187 0 0 0 0 2084 0 0 0 0 2229 17 4 21 0.9 2571 31 13 44 1.71 2135 0 1 1 0.04 1753 3 10 13 0.7 **Total 17,095 51 30 81 0.47**

**Table 3.** Validation results for the QRS detection algorithm applied to eight records from the MITDB.

**Beats %**

**3.3. Measurement of QT and RR intervals and calculus of QTd and HR**

is the average of two consecutive RR intervals.

**4. Validation and results**

FP, false positives; FN, false negatives.

**4.1. QRS detection**

false negatives.

**ECG record number**

is shown in **Figure 14**.

38 Topics in Splines and Applications

The developed algorithm for delineation of Qi and Se of the QRS complex and Te of the T wave has been tested on 25 recordings from the CSE database [25], which includes 15 ECG leads and manual annotations on them. **Table 4** shows the average (m) and standard deviation (sd)


**Table 4.** Validation results for delineation algorithm of characteristic points Qi, Se and Te on 25 annotated recordings of the CSEDB.


**Table 5.** Validation results of the delineation algorithm of characteristic points Qi and Te for 15 recordings from the QTDB in ms.

of the difference between the (WT-based) automatic and the (CSE) manual (annotated) location of those characteristic points. The results for that difference are within the tolerance limits accepted by the CSE experts, as shown in the last row of **Table 4** [32].

**5. Application in chronic kidney disease**

CKD before, during and after the HD treatment.

statistically significant.

effective to differentiate both groups.

**5.1. QTd analysis in normal subjects and patients with CKD**

The QTd algorithm was applied in two studies. In the first study, QTd was evaluated in normal subjects and patients with CKD. In the second study, QTd was analyzed in patients with

An Algorithm Based on the Continuous Wavelet Transform with Splines for the Automatic…

http://dx.doi.org/10.5772/intechopen.74864

41

In this study, 14 ECG recordings belonging to the PTBDB were used [26, 27], where the three quasi-orthogonal leads DI, aVF and V2 have been analyzed to obtain QTd. This database includes records of healthy people and patients with different pathologies. The study group was of seven normal subjects (two women and five men, age 66 ± 3.6 years) and seven renal insufficiency patients (three women and four men, age 70 ± 4.5 years). QTd corresponding to both groups was compared by the Wilcoxon rank sum test, where *p* < 0.05 was considered

**Table 6** shows QTd and HR in both groups. Difference in HR in both groups is not significant and therefore HR influence is similar in both groups [(67.7 ± 9) beats/min vs. (70.8 ± 12) beats/ min, *p* = 0.53]. QTd was significantly larger in patients with CKD than in normal subjects [(67.7 ± 28) ms vs. (21.4 ± 12), *p* = 0.0041]. The results obtained showed that the algorithm is

In this study, four ECG records of patients with CKD in the stage referred to as kidney failure or ESRD of the THEWDB [28], before (pre-HD), during and after (post-HD) HD session were used. For each patient, the three quasi-orthogonal leads DI, aVF and V2 have been analyzed to obtain QTd in a period of 10 h, in which pre-HD, HD and post-HD periods correspond to

*p* **0.0041 0.53**

**5.2. QTd analysis in patients with CKD before, during and after hemodialysis**

**Normal QTd HR Patients QTd HR** patient121 2.6 84.9 patient012 54.6 49.94 patient122 17 63.6 patient013 116 86.12 patient239 40.6 69.0 patient078 70 73.20 patient248 17.6 63.9 patient079 74.6 62.37 patient255 27.6 67.2 patient140 21.6 86.41 patient266 25.6 72.6 patient145 65 68.72 patient267 18.6 52.8 patient216 72 69.44 **m ± sd 21.4(11) 67.7(9) m ± sd 67.7(28) 70.8(12)**

QTd in ms; HR in beats/min; m, mean; sd, standard deviation; *p* value is from Wilcoxon rank sum test.

**Table 6.** QTd and HR in seven normal subjects and seven CKD patients.

Also, the algorithm has been tested on 15 recordings from MITDB included in the QTDB [24]. Within each record of two channels, between 30 and 100 representative beats were manually annotated by cardiologists, who identified among other characteristic points of ECG waves, Qi of the QRS-complex and Te of the T-wave. Channel 1 was used in most recordings, in case of ECG distorted, channel 2 was used. **Table 5** shows the mean (m) and standard deviation (sd) of the differences between the manual measurements (C1) and automatic measurements (WT) of Qi and Te for each record. The results for the differences between WT and C1 are within the tolerances for deviations with respect to the measurements made by the CSE experts, as shown in the last row of **Table 5** [32].

**Figure 15** shows some ECG excerpts of records with different T wave morphologies from QTDB with the manual annotations (square symbol) and the automatic detections (star symbol). It can be seen that Qi and Te are well determined by the algorithm, and its accuracy is comparable to a manual measurement of human experts.

**Figure 15.** Automatic detections (star) and manual annotations (square) of Qi and Te with different types of morphologies of QRS complex and T wave in patterns of two beats of four records from QTDB. (a) rS positive T wave, (b) qRs biphasic T wave, (c) Rs biphasic T wave and (d) qR negative T wave.
