Abstract
Background
Detection of characteristic waves, such as QRS complex, P wave and T wave, is one of the essential tasks in the cardiovascular arrhythmia recognition from Electrocardiogram (ECG).
Methods
A multiscale morphological derivative (MMD) transformbased singularity detector, is developed for the detection of fiducial points in ECG signal, where these points are related to the characteristic waves such as the QRS complex, P wave and T wave. The MMD detector is constructed by substituting the conventional derivative with a multiscale morphological derivative.
Results
We demonstrated through experiments that the Q wave, R peak, S wave, the onsets and offsets of the P wave and T wave could be reliably detected in the multiscale space by the MMD detector. Compared with the results obtained via with wavelet transformbased and adaptive thresholdingbased techniques, an overall better performance by the MMD method was observed.
Conclusion
The developed MMD method exhibits good potentials for automated ECG signal analysis and cardiovascular arrhythmia recognition.
Background
The detection of the major characteristic waves in ECG, namely the QRS complexes, P and T waves, is one of the essential tasks in ECG analysis. The performance of an automated ECG analysis system depends heavily on the reliable detection of these fiducial waves. The difficulties of characteristic waves detection lie in oscillations in the baseline, irregular morphology of the waveforms, and frequency overlapping among the wideband distribution of the characteristic waves [1], etc.
A significant amount of research effort has been devoted to the automated detection of the fiducial (reference) points of the ECG characteristic waves [212]. Most of these methods are filtering or adaptive thresholding based, which exhibit limitation in real application. Very few algorithms work well for the detection of all fiducial points such as the onsets and offsets of the P wave, T wave and the QRS complex (also known as the ECG wave boundaries). The main drawback of filteringbased approach is that frequency variations in the characteristic waves often adversely affect its performance. The frequency distribution of QRS complexes generally overlaps with that of the noise, resulting in both false positive and false negative detections. The main problems of the thresholding techniques are their high noise sensitivity and their low efficiency when dealing with odd morphologies. Therefore, more sophisticated signal processing techniques are needed to facilitate the development of new detection schemes with higher detection accuracy.
As a nonlinear filtering technique, it has been proven that morphological dilation and erosion satisfy the causality and the additive semigroup property required by multiscale analysis [1315] for signals of any dimension with local maxima and local minima as singular points. The fiducial points in ECG signal, such as the Q wave, R peak, S wave, the onsets and offsets of the P wave and T wave, can be regarded as such singular points [16,17]. In this paper, a new multiscale morphological derivative (MMD) transformbased technique, was developed for the detection of the fiducial points of the ECG characteristic waves. By applying a morphological derivative transform defined at different scales, noise sensitivity inherent in single scale operation can be reduced in MMD method. In addition, the problem of position deviation existed in wavelet transformbased techniques [10] can be avoided due to the nonlinearity of morphological transform. As a result, tracing across scales to locate the singular points is not needed.
The proposed multiscale morphological derivative (MMD) detector
In the present study, the signal to be processed is limited to continuous function f : ^{2 }→ with only finite oscillations on a closed interval which is differentiable everywhere except at some singular points. A singular point in the onedimensional signal is defined as a point with derivative on the right and the derivative on the left exist with different signs.
For the singular point to be defined using multiscale morphological derivative, the derivative on the right can be represented by morphological supderivative , which is defined as
Similarly, the derivative on the left can be represented by morphological infderivative , which is defined as
Here, the notation of [18] is used to introduce morphological operators on functions. Denoting the functions, f : D ⊂ ^{n }→ and g_{s }: G_{s }⊂ ^{n }→ (s > 0), the two fundamental operations of multiscale morphology are:
where D_{x }is the translation of D, D_{x }= x + t:t ∈ D, sup(f) and inf (f) refer to the supremum (least upper bound) and infimum (greatest lower bound) of f, s is scale, and g_{s }is the scaled structuring function [19]. In the discrete case where the function is a finite set of points, max() and min() are used instead of sup() and inf().
We propose a multiscale morphological derivative difference , to be defined to characterize the difference between the left and right derivatives as follows:
The scaled version of at scale s, , can then be defined as:
By choosing a flat structuring function, where g_{s}(x) = 0, x ∈ G, where G = {x: x ≤ s} [14], the above multiscale morphological derivative transform described by Equation (6) is simplified to the following process: Choose a moving window with a length of (2s + 1) samples and find the maximum and minimum values in the window, as well as the value of the signal at the cental point f(x). Then, the MMD transform at the central point can be specified as
At a positive peak in ECG signal, its left derivative is positive and its right derivative is negative, therefore, positive peaks in the ECG signal correspond to the local minima in . At the onset or offset of a positive peak, there is an abrupt increase in its derivative value from left to right. So, the onsets and offsets correspond to the local minima in . As applied to ECG lead II signal, the R peak, Q wave an S wave correspond to the local minima of the , while the onsets and offsets of the P wave and T wave correspond to the local maxima of the . Hence the characteristic QRS complex, P wave and T wave, can be detected using the proposed MMD detector by detecting the local extrema in the MMD transformed signal.
Characteristic wave detection in ECG using the MMD detector
The MMD detector is a single lead detection method. In this paper, we only use the ECG lead II for algorithm development and testing. A similar analysis can be done to extend method to other leads. The detailed procedure for ECG characteristic wave detection using the proposed MMD detector, is described as follows:
1. ECG signal is preprocessed by morphological filtering for noise reduction and baseline correction.
2. Multiscale morphological transform is performed on the preprocessed input signal.
3. The local maxima and minima with absolute amplitude larger than a threshold, Th_{f}, at a selected scale s_{m }are detected (s_{m }= 20 for MITBIH database and s_{m }= 15 for QT database in this study). The local minima with absolute amplitude larger than a threshold, Th_{R}, are detected as R peaks, where, the selection of Th_{R }and Th_{f }is based on an adaptive thresholding from the histogram of the MMD transformed data.
4. For each detected R peak, the first local maximum point on its left is detected as the beginning of the R wave; the first maximum point on its right side is detected as the end of the R wave.
5. The first local minimum from the left of the positive R wave is detected as the Q wave. If the minimum cannot be detected, the Q wave is judged to be missing. (There is a time interval for Q wave detection, which is set as the prior clinical value of QRS complex, here, 0.12s).
6. The first local minimum from the right of the positive R wave is detected as the S wave. Otherwise, the S wave is judged to be missing. Same time interval as for Q wave detection is set for S wave detection.
7. The subsequent two consecutive local maxima from the left of the Q wave are detected as the offset and onset of the P wave; the first and second local maxima from the right of the Q wave are detected as the onset and offset of the T wave, respectively.
The preprocessing in step 1 is performed as follows:
where f_{o }is the original input signal; f_{b }is the baseline drift signal; f is the signal after preprocessing; o is morphological opening operator; • is morphological closing operator; structuring elements, B_{o}, B_{c }and B, are selected based on the properties of ECG characteristic waves. Further details can be found in [20]. For each preprocessed signal, its morphological derivative at scale s_{m }was calculated according to Equation (7) and its local maxima and minima were detected. It is known that the number of maxima or minima at a larger scale is much less than that at a lower scale. In addition, high frequency noise decays greatly at large scales so that less extrema due to noise are found at larger scale. Therefore, morphological derivative transformed signal at a larger scale was used for detecting the locations of the objective feature points. However, in order not to smooth the characteristic waves in ECG, s_{m }should be as large as possible but less than W_{w}f_{s}, where W_{w }is the width of the characteristic wave, and f_{s }is the sampling frequency of ECG signal. The width of QRS is generally from 0.06s to 0.12s. The P wave and the T wave are generally longer than the QRS complex. Hence, in the proposed study, s_{m }= 20 for MITBIH database and s_{m }= 15 for QT database, were chosen. No calculation was performed at other scales since MMD operation does not cause drift of singular points across different scales.
For the detection of local maxima and minima, two thresholds Th_{R }and Th_{f }were used, which were adaptively computed from the histogram of the MMD transformed data. The two betweenpeak valleys in the histogram gave rise to the values of Th_{R }and Th_{f}. Th_{R}was used for the detection of the local minima, which correspond to R peaks; Th_{f }was used for the detection of the local minima, which correspond to other characteristic waves.
In any single ECG beat, the R peak, Q wave and S wave correspond to adjacent local minima in the morphological derivativetransformed signal. The onset and offset of the P wave correspond to local maxima adjacent to the Q wave. In the normal cases, the onset and offset of the T wave are local maxima adjacent to S wave. Otherwise, the T wave is judged as inverted. However, for other abnormal T waves, such as the biphasic T wave, the MMD detector may falsely detect the onset and offset of the T wave.
Results and discussion
The proposed morphological approach for the characteristic wave detection in ECG signal was tested using the first ECG leads from the MITBIH arrhythmia database [21] and the QT database [22]http://www.physionet.org webcite, which were developed with the aim to be benchmarking references for automated analysis of ECG. The MITBIH arrhythmia database contains 48 records (each 30 minutes long) with a sampling frequency of 360 Hz. The QT database is a mixed database with a sampling frequency of 250 Hz, which consists of 105 excerpts (each 15 minutes long) taken from other ECG databases, where, 15 from MITBIH Arrhythmia Database, 6 from the MITBIH ST Change Database, 13 from the MITBIH Supraventricular Arrhythmia Database, 10 from the MITBIH Normal Sinus Rhythm Database, 33 from the European STT Database, 24 from "sudden death" patients from BIH, and 4 records from the MITBIH LongTerm ECG Database.
For each input ECG signal, the following procedures were performed: (i) signal preprocessing; (ii) multiscale morphological derivative transform; (iii) detection of local maxima and minima in morphological derivativetransformed signals; (iv) detection of characteristic waves in the original ECG signal. Some results using MMD detector for characteristic wave detection are given in Figure 1, where (a) is for normal ECG beat, (b) is for left bundle branch block (LBBB) ECG beat, (c) is for atrial premature contraction (APC), and (d) is for premature ventricular contraction (PVC). In each subfigure, the three plots from top to bottom are: the single ECG beat selected from the MITBIH database; the MMD transformed signal with marked points (the onset and offset of the R wave are marked with 'Δ'; other fiducial points, such as, the Q wave, R peak, S wave, as well as the onsets, offsets, the peaks of the P wave and T wave, are marked with '*'); the automatically detected characteristic waves are in solid line.
Figure 1. Results of characteristic wave detection for single ECG beat. The three plots in each subplot from top to bottom are: original ECG signal; the MMD transformed signal at scale 20 with the detected characteristic points marked; detected characteristic waves in solid line. (a) Normal ECG beat (b) LBBB (c) APC (d) PVC.
As shown in Figure 1, the characteristic waves in normal beat are observed to be well detected. For LBBB, in spite of the appearance of a subR peak, the boundaries of all waves are still well detected. In APC or PVC no preceding premature P wave appears. In addition, the position of the left 'Δ ' overlaps with the '*' because the onset of the preceding T wave is submerged in the QRS complex. The position of the right 'Δ' also overlaps with the '*' and the Q wave is judged to be missing.
Figure 2 gives more results of characteristic wave detection in ECG signal series. It is obvious that all three characteristic waves (the QRS complex, the P wave, the T wave) in ECG time series with normal beats, APCs, and LBBB beats, are detected reliably. Even the onsets and offsets of inverted T waves in PVCs can be detected reliably.
Figure 2. Detection results of ECG series, from top to bottom, they are: original ECG signal; MMD transformed signal with fiducial points marked; detected characteristic waves highlighted in bold. (a) ECG series with normal beats and PVC (b) ECG series with normal beats and APC (c) ECG series with LBBBs.
More than 20000 annotated ECG beats randomly selected from MITBIH arrhythmia database were used to test the performance of the proposed MMD detector. An overall false detection rate of 0.35% was obtained for the QRS complex detection. In addition, more than 2500 annotated ECG beats randomly selected from the QT database were tested for evaluating the performance of the proposed MMD detector for ECG wave boundaries detection. In the QT database, a minimum of 30 beats from each of its 105 records had been manually annotated by one or more cardiologists. The annotation files were taken as reference for evaluating the performance of automated algorithms for detecting the onsets and offsets of the P wave, T wave, and the QRS complex during ECG analysis.
In order to quantify the performance of ECG characteristic wave detection by the proposed MMD technique, three parameters were used, which included the mean error (m) and standard deviation (σ) of the differences between the annotation results and the automated detection results, as well as Sensitivity (Se). m is used to determine how close the automated detection results are to the annotation results. σ gives an idea of the stability of detection. Se is defined as , for measuring the detection sensitivity, where TP is the number of true detections; FN is the number of manual annotations that are not registered in the automatic detections.
The statistical results for m, σ, and Se, for ECG fiducial points and characteristic waves detection by the proposed MMD technique were compared with the thresholdbased detector (TD) [22] and the waveletbased detector (WD) [23], and they are shown in Table 1. The accepted standard deviation tolerances from the measurements required by CSE were given in the last row of Table 1.
Table 1. Comparative Results of ECG characteristic wave detection
The proposed MMD method works best for the QRS complex detection. Lower values of mean bias and standard deviation as well as higher value of detection sensitivity are observed. The average detection bias for the QRS's onset and offset are 3.5 ms and 2.4 ms respectively. The corresponding standard deviations are 6.1 ms and 10.3 ms, both of which are within the acceptable limits required by the CSE committee.
However the requirements can not be fully satisfied by the TD and WD methods although the mean bias obtained by the WD method is a little better than the results obtained by the MMD method. As for the P wave onset detection, only the MMD method can fulfill the CSE requirement while it fails for the P wave offset detection. The WD method performs better for P wave offset detection while worse for P wave onset detection compared with the MMD method. TD method fails to meet CSE requirements for both P wave onset and offset. As for the T wave offset detection, all three methods can satisfy the limit required by the CSE committee. Among them, the MMD and the WD methods perform much better than the TD method. The clinically important intervals for arrhythmia recognition, such as the PR interval (from the onset of the P wave to the onset of the R wave), the QT interval (from the Q wave to the offset of the T wave), are not related to the positions of the offset of the P wave and the onset of the T wave. Therefore, the weakness of the proposed MMD technique does not cause significant problem for arrhythmia recognition. The correlation coefficients between the results obtained by MMD method and those computed from annotation data are 0.9264 for PR interval, 0.9542 for QRS complex, and 0.9316 for QT interval.
The proposed MMD method for ECG wave boundary detection is well performed with reasonable mean bias and standard deviation values within the limits required by CSE, on over 79% of the records. In the QT database, best detection performance is observed for records from the MIT normal sinus rhythms database. Records with poor detection performance are mostly from the European STT database and the Supraventricular database, in which, low signaltonoise ratio or nonhomogeneous repolarization exists. In summary, it is concluded that the proposed MMD detector has acceptable performance comparable to those given by experts.
Conclusion
In this paper, a new algorithm based on multiscale morphological derivative transform, called MMD detector, has been developed for fiducial point detection and applied for ECG wave boundary detection. The MMD detector could not only work for the QRS complex, but also the onsets and offsets of the characteristic waves. The standard deviations for important ECG characteristic wave detection obtained by the proposed MMD detector were within the limits required by the CSE committee. Furthermore, the statistical results obtained by the MMD detector were compared with those obtained by wavelet transformbased and adaptive thresholdingbased techniques. In overall, better performance by the MMD technique was observed, considering that less empirical parameters were needed. Therefore we conclude that the proposed MMD method exhibits good potentials in the clinical applications for automated analysis of ECG signal.
Competing interests
The author(s) declare that they have no competing interests.
Authors' contributions
SY conceived the study, performed data analysis and drafted the manuscript. CKL and KSM guided the study, helped the analysis and interpretation of the results, and critically reviewed the manuscript. All authors read and approved the final script.
Acknowledgements
The authors wish to extend their sincere appreciation to Nanyang Technological University, Singapore for supporting this work. The authors also acknowledge the clinical collaboration from Singapore General Hospital.
References

Emilio ES, Sober MM: Application of adaptive signal processing for determining the limits of P and T waves in an ECG.
IEEE Transactions on Biomedical Engineering 1998, 45(8):10771080. PubMed Abstract  Publisher Full Text

Goldberger AL, Bhargava V: QRS duration measurement using highfrequency electrocardiography: applications and limitations of a new technique.
Comput Biomed Res 1982, 15(5):474484. PubMed Abstract  Publisher Full Text

Willems D, Hildreth E: Influence of noise on wave boundary recognition by ECG measurement programs.
Comput Biomed Res 1987, 20(6):543562. PubMed Abstract  Publisher Full Text

Hamilton PS, Tompkins WJ: Quantitative investigation of QRS detection rules using the MITBIH arrhythmia database.
IEEE Transactions on Biomedical Engineering 1996, BME33:11571187.

Gritzali F, Frangakis G, Papakonstantinous G: Detection of the P and T waves in ECG.
Computers in Biomedical Research 1989, 22:8391. Publisher Full Text

Coast DA, Stern RM, Cano GG: An approach to cardiac arrhythmia analysis using hidden Markov models.
IEEE Transactions on Biomedical Engineering 1990, BME37(9):826836. Publisher Full Text

Laguna P, Thakor NV, Caminal P, Jane R, Yoon HR, Bayes de Luna A, Marti V, Guindo J: New algorithm for QT interval analysis in 24hour Holter ECG: performance and application.
Med Biol Eng Comput 1990, 28(1):6773. PubMed Abstract

Laguna P, Jane R, Caminal P: Automatic detection of wave boundaries in multilead ECG signals: validation with the CSE database.
Comput Biomed Res 1994, 27(1):4560. PubMed Abstract  Publisher Full Text

Kemmelings JG, Linnenbank AC, Muilwijk SL, SippensGroenewegen A, Peper A, Grimbergen CA: Automatic QRS onset and offset detection for body surface QRS integral mapping of ventricular tachycardia.
IEEE Trans Biomed Eng 1994, 41(9):830836. PubMed Abstract  Publisher Full Text

Li C, Zheng C, Tai CF: Detection of ECG characteristic points using wavelet transforms.
IEEE Transactions on Biomedical Engineering 1995, 42:2129. PubMed Abstract  Publisher Full Text

Daskalov IK, Christov II: Automatic detection of the electrocardiogram Twave end.
Med Biol Eng Comput 1999, 37(3):348353. PubMed Abstract

Daskalov IK, Christov II: Electrocardiogram signal preprocessing for automatic detection of QRS boundaries.
Med Eng Phys 1999, 21(1):3744. PubMed Abstract  Publisher Full Text

Park KR, Lee CN: Scalespace using mathematical morphology.
IEEE Transactions on Pattern Analysis and Machine Intelligence 1996, 18(11):11211126. Publisher Full Text

Jackway PT, Deriche M: Scale space properties of the multiscale morphological dilationerosion.
IEEE Transactions on Pattern Analysis and Machine Intelligence 1996, 18(1):3851. Publisher Full Text

Boomgaard RV, Smeulders A: Morphological multiscale image analysis,. In chapter Proc. First Int'l Workshop on Math. Morphology and Its Applications to Signal Processing. Univ. Politecnica de Catalunya, Barcelona, Spain; 1993.

Mallat S, Zhong S: Characterization of signals from multiscale edges.
IEEE Transactions Pattern Analysis and Machine Intelligence 1992, 14(7):710732. Publisher Full Text

Witkin AP: Image Understanding. Norwood, NJ:Ablex; 1984:7995.

Haralick RM, Sternberg SR, Zhuang X: Image analysis using mathematical morphology: Part I.
IEEE Transactions on Pattern Analysis and Machine Intelligence 1987, PAMI9:532550.

DePree JD, Swartz CW: Introduction to Real Analysis. John Wiley, New York; 1988.

Sun Y, Chan KL, Krishnan SM: ECG signal conditioning by morphological filtering.
Computers in Biology and Medicine 2002, 32(6):465479. Publisher Full Text

MITBIH arrhythmia Database. Beth Israel Hospital, Biomedical Engineering Division Room;

Laguna P, Mark RG, Goldberger AL, Moody GB: A database for evaluation of algorithms for measurement of QT and other waveform intervals in the ECG.

Martinez JP, Olmos S, Laguna P: Evaluation of a waveletbased ECG waveform detector on the QT database.
Prepublication history
The prepublication history for this paper can be accessed here: