|Home | About | Journals | Submit | Contact Us | Français|
Quantitative analysis of the electrocardiogram (ECG) requires delineation and classification of the individual ECG wave patterns. We propose a wavelet-based waveform classifier that uses the fiducial points identified by a delineation algorithm. For validation of the algorithm, manually annotated ECG records from the QT database (Physionet) were used. ECG waveform classification accuracies were: 85.6% (P-wave), 89.7% (QRS complex), 92.8% (T-wave) and 76.9% (U-wave). The proposed classification method shows that it is possible to classify waveforms based on the points obtained during delineation. This approach can be used to automatically classify wave patterns in long-term ECG recordings such as 24-hour Holter recordings.
The electrocardiogram (ECG) is an important clinical tool for diagnosing heart disease. The ECG may reveal unusual patterns or abnormal configurations of the individual waves and complexes which can provide the clinician with clues to the underlying etiology of disease. In many cases the diagnosis may also rely importantly on the measurement of specific intervals on the ECG which are defined by the location of the so-called fiducial points (peaks, onsets and offsets of P, QRS, T and U-waves).
Annotating fiducial points on the ECG and revealing specific wave configurations can be performed manually by a cardiologist or these tasks can rely on computer-based methods.
The accuracy of manual delineation depends on the training of the individual and there can be significant inter-observer variability [1,2]. Long-term ECG recordings such as 24-hour Holter contain on average 100,000 beats and with such data, manual annotation and classification of wave configurations is a daunting task. Commercial products are limited to automatic detection of fiducial points and the reporting of static measurements which summarize long term recordings, but there is an increasing interest in extracting more information on a beat to-beat basis from Holter ECGs. For example, it would be valuable to identify subtle ECG manifestations of cardiac disease such as altered waveform configurations and information about beat-to-beat changes in intervals which are not usually measured, and thus not commonly accessible to the clinician.
In this paper we therefore present a computerized procedure for automatic delineation and classification of wave configurations in continuous Holter. We modified existing wavelet-based delineation methods proposed by Martinéz et al.  and Boichat et al.  and we used our algorithm to identify the following fiducial points: Ponset, Ppeak, Poffset, QRSonset, Rpeak, QRSoffset, Tpeak, Toffset, Upeak and Uoffset. We further expanded the ability of the algorithm to determine predefined configurations of all QRS-, P-, T-. and U-waves.
The QT database (QTDB) from PhysioNet  was used to assess delineation performance and the classification accuracy of automatically identified wave configurations. The QTDB contains ECG recordings of 15-minute duration and was designed to include various pathophysiological morphologies. Data was digitally recorded at 200 samples per second and contained two leads.
The database is suitable for testing delineation algorithms against human annotators because all records have been manually annotated for Ponset, Ppeak, Poffset, QRSonset, QRSoffset, Tpeak, Toffset, Upeak and Uoffset. Only sinus beats were included in this study. Furthermore, waveforms that could not be manually classified were excluded from further analysis.
Nineteen different categories of wave configurations were defined for P, QRS, T and U after manual inspection of healthy and pathological wave shapes in the QTDB dataset. These wave patterns and polarities (+, -) were then used to assess how accurately the algorithm classified wave configurations into the predefined categories.
The delineation algorithm is based on work by Martinéz al.  and Boichat et al. . The ECG signal was decomposed into 5 scales using a quadratic spline wavelet, which is equivalent to differentiating the signal in different frequency bands. In each wavelet scale, maxima and minima pairs were located (maxima-moduli) including the zero-crossing between the pairs, which corresponds to peaks in the ECG, e.g. to a peak in the T-wave. The polarity of a peak in the ECG depends on the sign of the first extremum in the maxima-moduli pair. If the first extremum is positive, the peak is positive and vice versa.
The scale which were used to locate the different waves varied depending on the estimated frequency range of the waveform. Scale 2 was used for the Q, R and S and scale 4/5 was used for the P-, T- and U-waves.
Identification of the fiducial points was done in four parts: Finding QRS locations and identifying the largest deflection within the complexes, detection and delineation of individual QRS components, identification of QRSonset and QRSoffset and identification of the peaks, onsets and offsets of the P-, T- and U-waves.
A location in the vicinity of each QRS was initially detected using a beat detection algorithm proposed by Afonso et al. . The largest deflection within a 280 ms window centered on the QRS locations was identified as the zero-crossing between the largest maxima-moduli pair in the second scale. Depending on the polarity, all these extrema on the ECG represented a Q, R, R' or S wave.
A search for additional components of the QRS complex within this window was performed in the second wavelet scale. If additional maxima-moduli pairs of substantial amplitudes were identified within this window, the total number of maxima-moduli pairs in the vicinity of the largest QRS deflections and their polarities, determined the configuration of the QRS complex, i.e. QRS, RSR', QR, RS, QS or R.
The locations of QRSonset and QRSoffset were identified in the fourth wavelet scale using the method described by Boichat et al. . However, if an onset or offset was not found, we applied the onset/offset method described by Martinéz et al. .
From QRSonset, a search for the P-wave was performed towards the left in the fourth wavelet scale using the following search window:
Maxima-moduli pairs in each window exceeding 0.25max(|SWp|) were then identified. If one pair was found in a search window, the peak of the P-wave was defined as the zero-crossing between the extremum in the maxima-modulus pair. If two or more pairs were found, the first and second maxima-moduli pairs determined a biphasic P-wave. Ponsets were located in the fourth wavelet scale as the first point where the value was below a threshold based on the leftmost extremum value (ExV alPleft) in the maxima-moduli pair (threshold = 0.5|ExV alpPleft|). A fraction of the rightmost extremum value (ExV alPright) in the maxima-moduli pair was used as the threshold (0.9|ExV alPright|) to identify Poffset.
A search was performed to the right of each QRSoffset for the T-wave using a search window (SWT) inspired by Boichat et al. :
The procedure for identifying a single peak in the T-wave or for biphasic T-waves - two peaks, was similar to the procedure which was used to find peaks in the P-wave. T-wave peak(s) were located at points in the fourth wavelet scale where the maxima-moduli pairs exceeded 0.125max(|SWT|). A fraction of the rightmost extremum value in a maxima-moduli pair (ExV alTright) was used as the threshold (0.4|ExV alTright|) to identify Toffset similar to the way it was done for Poffset.
For positive and negative T-waves, a search window for the U-wave (SWU) inspired by  was extended to the right in the fourth wavelet scale from the rightmost extremum value in a maxima-moduli pair (Ex ValTright):
A U-wave was present only if a maxima-moduli pair in the search window exceeded a threshold given by:
The locations for U-wave offsets were found using the method described by Boichat et al.  for QRSoffset with the same threshold they used for QRSonset.
For both ECG leads, the manually annotated fiducial points were compared with the automatically detected points. The lead with the smallest difference between manual and automatic methods was used for a given fiducial point to calculate the overall mean difference and standard deviation between the manual and automatically annotated fiducial points.
If the difference between manual and automatic locations for a fiducial point was below 40ms a true positive (TP) was registered and otherwise a false positive (FP) was registered. These indicators were subsequently used to estimate the positive predictive value (PPV) for the delineation algorithm.
The configuration associated with each of the automatically detected waves (QRS, T, P and U) was compared with the manually predefined configurations and to assess classification accuracy. For example, a set of two peaks in the order: negative and positive, within the QRS complex would suggest that the QRS configuration is a QR complex.
The classification accuracy was obtained by evaluating each class separately, i.e. if the manual annotated class was a positive T-wave and the algorithm classified it as a positive T-wave a true positive was registered for “positive T-wave” and a true negative was registered for all other T-wave classes. If instead, the positive T-wave was classified by the algorithm as a negative T-wave, then the following was registered: False negative for the “positive T-wave”, false positive for the “negative T-wave” and true negative for the remaining classes.
The precision for the identification of fiducial points on the ECG is shown in table 1.
Automatic detection of the U-wave, and the peak of the P-wave, were the most difficult. All other fiducial points were automatically identified within 5 ms of manual annotations. This discrepancy between the manual and automatic annotation methods corresponded to one sampled point on the ECG.
The accuracies for classification of QRS, P and T-wave configurations are given in tables 2, ,33 and and4.4. Compared to all other waveforms in the ECG, the highest agreements between manual and automatic classification were observed for these waveforms. The U-wave on the other hand, was the most difficult electrocardiographic wave to classify, table 5.
The delineation and classification of the ECG waveform patterns are relevant to diagnostic decisions, and enabling the automatic delineation and classification of all waves in 24-hour Holter ECG recordings is of a growing interest since continuous hospital  and home monitoring devices  are likely to be increasingly present in our daily life.
We have developed a new ECG delineation method inspired by the work of Martinéz et al.  and Boichat et al.  and we have expanded their approaches to also include a delineation of the U-wave. The fiducial points from the delineation process have further been used to add information about the individual ECG wave configurations.
Our results indicate that the delineation algorithm provides a level of accuracy similar to the algorithms developed by Martinéz et al.  and Boichat et al. , suggesting that wavelets can provide robust method for ECG delineation. However, the wavelet technique suffers from the inherent problems with thresholding, i.e. for some signals the QRS complexes were classified as R-waves instead of a QRS, due to low amplitude Q and S wave.
The U-wave remains an under-evaluated wave of the surface electrocardiogram. Its genesis and clinical significance is still debated , yet it is usually reported in clinical trials investigating the safety of new pharmacological compounds.
In our work, we suggested an approach for U-wave delineation. The method provided a limited accuracy and thus needs to be improved. The mean error and standard deviation on U-wave related points was higher than those of the other complexes in the ECG. This is most likely caused by problems related to ECGs with high heart rates in which the P-wave moves closer to the end of the T-wave and thus may be wrongly identified as a U-wave. Additional work is needed to strengthen the algorithm in order to differentiate between the P-wave and the U-wave.
Despite such shortcomings, our findings indicate that it is possible to classify some wave configurations on the ECG with fair success based solely on the points obtained during delineation. Higher classification accuracy might be obtained by including more than just the fiducial points in the classification process, e.g. by placing a window on the main wave and classifying the complex using machine learning, e.g. a support vector machine. Further studies are needed to investigate such opportunities.
There are many challenges ahead, but it is possible that we will see manual ECG processing being replaced either fully or partially by automatic methods in the future as the development of simple computerized procedures for delineation and classification of wave configurations improve.
The authors would like to thank Juan Pablo Martinéz for his support during the development of the code.