Analysis of Computer Aided Identification System for ECG Characteristic Points
Hla Myo Tun^{1}, Win Khine Moe^{2}, Zaw Min Naing^{2}
^{1}Department of Electronic Engineering, Mandalay Technological University, Mandalay, Myanmar
^{2}Department of Research and Innovation, Ministry of Science and Technology, Yangon, Myanmar
Email address:
To cite this article:
Hla Myo Tun, Win Khine Moe, Zaw Min Naing. Analysis of Computer Aided Identification System for ECG Characteristic Points. International Journal of Biomedical Science and Engineering. Vol. 3, No. 4, 2015, pp. 49-61. doi: 10.11648/j.ijbse.20150304.11
Abstract: Digital signal processing and data analysis are very often used methods in a biomedical engineering research. In this work, the descriptions of two detection algorithms for ECG characteristic points are enclosed. The detection algorithms presented in this work are based on Pan and Tompkins’ algorithm and wavelet transform for signal de-noising and detection of QRS complexes. In the first approach, efficient designed filters are focused on removing supply network 50 Hz frequency and baseline drift due to breathing. A special digital bandpass filter reduces false detection caused by the various types of interference present in ECG signals. The next process after filtering is differentiation followed by squaring, and then integration. The integrated signal is detected by thresholding for QRS complex. P wave and T wave detection are performed by using detected QRS complexes. MATLAB program is developed for the characteristic points’ detection. The algorithm for peak detection case is modified and it is applied to show ECG characteristic points. Wavelet Transform (WT) method is used for peak detection in this work. Wavelet based detection algorithms for one-dimensional signals are presented along with the results of detection ECG data. Firstly, ECG signals are decomposed by the Discrete Wavelet Transform (DWT). The decomposed signals are detected by thresholding for QRS complex. Detection of the QRS complex is the most important task in automatic ECG signal analysis. Finally, P wave and T wave detection are performed by using detected QRS complexes. Different types of algorithms are applied and evaluated their performance with sensitivity (Se), positive predictive (+P).
Keywords: Computer Aided Identification System, ECG, Characteristic Points, QRS Complex
1. Introduction
There are many methods to detect the ECG characteristics points for a reliable QRS recognition algorithm. Computer interpretation of the 12-lead ECG is a popular technique. Currently under development are arrhythmia monitors for ambulatory patients which analyze the ECG in real time [1-10]. When an arrhythmia appears, such a monitor can be programmed to immediately store an interval of the abnormal ECG for subsequent transmission to a central station where a physician can interpret it. Such a device requires a very accurate QRS recognition capability. False detection results in unnecessary transmission of data to the central station or requires an excessively large memory to store any ECG segments that are unnecessarily captured. Thus, an accurate QRS detector is an important part of many ECG instruments.
QRS detection is difficult, not only because of the physiological variability of the QRS complexes, but also because of the various types of noise that can be present in the ECG signal. Noise sources include muscle noise, artifacts due to electrode motion, power-line interference, baseline wander, and T waves with high-frequency characteristics similar to QRS complexes. Digital filters reduce the influence of these noise sources, and thereby improve the signal-to-noise ratio. Of the many QRS detectors proposed in the literature, few give serious enough attention to noise reduction.
Software QRS detectors typically include one or more of three different types of processing steps: linear digital filtering, nonlinear transformation, and decision rule algorithms [11].
All three types are used. Linear processes include a band-pass filter. This work was supported a derivative algorithm, and an integration algorithm for ECG characteristics points. The nonlinear transformation that used is signal amplitude squaring. Adaptive thresholds and T-wave discrimination techniques provide part of the decision rule algorithm. The slope of the R wave is a popular signal feature used to locate the QRS complex in many QRS detectors [2].
An analog circuit or a real-time derivative algorithm that provides slope information is straightforward to implement. However, by its very nature, a derivative amplifies the undesirable higher frequency noise components. Also, many abnormal QRS complexes with large amplitudes and long durations are missed in a purely derivative approach because of their relatively low R wave slopes. Thus, R-wave slope alone is insufficient for proper QRS detection.
To achieve reliable performance, other parameters from the signal such as amplitude width, and QRS energy, P wave and T wave must be extracted [9], [5]. It is very important to evaluate a QRS, P wave and T wave detector algorithm using a standard arrhythmia database.
There are now two such databases available: MIT-BIH and AHA (American Heart Association). The performance of an algorithm on a database is not the ultimate answer as to its utility in a clinical environment, but it provides a standardized means of comparing the basic performance of one algorithm to another.
The detection algorithms presented in this work is based on Pan and Tompkins’ algorithm shown in Fig .1 and wavelet transform algorithm for signal de-noising and detection of QRS complexes. Then QRS complexes are detected and each complex is used to find the peaks of the individual waves like P and T, and also their deviations.
2. Sequence of Processing Steps
QRS detection is important in all kinds of ECG signal processing. QRS detector must be able to detect a large number of different QRS morphologies. The detection of QRS complex is necessary to identify the exact R-peak from record data.
First, in order to attenuate noise, the signal passes through a digital bandpass filter composed of cascaded lowpass and high pass filters. The next process after filtering is differentiation followed by squaring, and then integration. Information about the slope of the QRS is obtained in the derivative stage. The squaring process intensifies the slope of the frequency response curve of the derivative and helps restrict false positives caused by T waves with higher than usual spectral energies. The moving window integrator produces a signal that includes information about both the slope and the width of the QRS complex.
The final output stream of pulses marks the locations of the QRS complexes after application of the adaptive thresholds. The algorithm is able to correctly detect QRS complexes in the presence of the severe noise typical of the ambulatory ECG environment.
3. QRS Detection
The QRS complex is the most striking waveform within the electrocardiogram (ECG). Since it reflects the electrical activity within the heart during the ventricular contraction, the time of its occurrence as well as its shape provide much information about the current state of the heart. Due to its characteristic shape, it serves as the basis for the automated determination of the heart rate, as an entry point for classification scheme of the cardiac cycle, and it is often used in ECG data compression algorithms. In that sense, QRS detection provides the fundamentals for almost all automated ECG analysis algorithms [11].The QT interval is one parameter that is needed to receive the maximum attention [12]. Normal QTc length is 420ms, but it maybe potential concern if QTc> 450 ms and it may increase the risk of tachyarrhythmia if QTc> 500 ms. The shape of ST segment in the ECG is another important indication in the diagnosis of heart problem. So, the measurements taken on the ST segment forms another predominant factor in the interpretation phase of the ECG [13].
3.1. QRS Detection Algorithms
A large number of QRS detection scheme are described in the literature [3]. It is hard to compare all of them. Several considerations were used to limit the number of QRS detections schemes to a reasonable cross section of different basic techniques described in the literature. The two basic criteria used in selection were complexity and performance. Only relatively simple algorithms were used [14].
So, four basic types of algorithms were included. The first three types are named by a two letters prefix "AF" for algorithms based on both amplitude and first derivative, "FD" for algorithms based on first derivate only, "FS" algorithm utilizes both first and second derivate. The last one is "median" algorithm.
A. Algorithms based on both amplitude and first derivative (AF1, AF2, and AF3)
AF1 concept for this QRS detector was derived from the algorithm developed by Moriet-Mahoudeaux [6]. If X(n) represents a one-dimensional array of n sample points of the synthesized digitized ECG, an amplitude threshold is calculated as a fraction of the largest positive valued element of that array. A QRS candidate occurs when three consecutive points in the first derivative array exceed a positive slope threshold and followed within the next 100 ms by two consecutive points which exceed the negative threshold.
AF2 algorithm is an adaptation of the analog QRS detection scheme developed by Fraden and Neuman [15]. AF3 concept was taken from Gustafson [16]. The first derivative is calculated at each point of the ECG. The first derivative array is then searched for points which exceed a constant threshold, and then the next three derivative values must also exceed the threshold. If these conditions are met, point can be classified as a QRS candidate if the next two sample points have positive slope amplitude products.
B. Algorithms based on first derivate only (FD1 and FD2)
FD1 algorithm was adapted from the one developed by Menard [7]. FD2 algorithm is a modification of an early digital QRS detection scheme developed by Holsinger [17]. The derivative is calculated for the ECG. This array is searched until a point is found that exceeds the slope threshold. A QRS candidate occurs if another point in the next three sample points exceeds the threshold.
C. Algorithm utilises both first and second derivate (FS1 and FS2)
FS1 algorithm is a simplification of the QRS detection scheme presented by Balda [18]. The absolute values of the first and second derivate are calculated from the ECG. Two arrays are scaled and then summed. One of the array is scanned until a threshold is met or exceeded. Once this occurs, the next eight points are compared to the threshold. If six or more of these eight points meet or exceed the threshold, the criteria for identification of a QRS are met.
FS2 algorithm was adapted from the QRS detection scheme developed by Ahlstrom and Tompkins [2]. The rectified first derivative is calculated from the ECG. Then this first rectified derivative is smoothed. The rectified second derivative is calculated. The first smoothed derivative is added to the rectified second derivative. The maximum value of this array is determined and scaled to serve as the primary and secondary thresholds. The array of summed derivative is scanned until a point exceeds the primary threshold. In order to find a QRS candidate, the next six consecutive points must all meet or exceed the secondary threshold.
D. Algorithm based on median filter
A median filter is a non-linear filter for processing digital signal. It is also a good selection for QRS detection [19].
All of the above-mentioned algorithms have limitations. No algorithm expressed in this research is clearly superior for all sources of QRS complexes considered. The performance of these algorithms was in part attributable to QRS detection. This research will use all of them to find a better one for the detecting QRS complexes.
3.2. QT Interval and ST Segment Analysis
There are two types of QT interval analysis and ST segment detection in ECG characteristics.
A. QT interval analysis
QT interval reflects the electrical signal from ventricular depolarisation to depolarisation. QTc interval is the QT interval corrected for heart rate. In assessing QT interval variability, determination of absolute QT duration is relatively unimportant sometimes, but the method must be sensitive to subtle changes in QT interval from one beat to the next, as well as relatively insensitive to signal noise. The detection and localization of the QT interval requires the detection of onsets and offsets of the QRS complex, the T-wave and J-point. This is done after reliable detection of the QRS complex.
B. ST segment detection:
The ST segment represents the part of the ECG signal between the QRS complex and T wave. Changes in the ST segment may indicate ischaemia caused by insufficient blood supply to the heart muscle. Evaluation and depression of the ST segment together with T-wave changes indicate that the zone of ischaemia is around the applied lead. Therefore, analysis of the ST segment is an important task in cardiac diagnosis [20].
Some of the most recent literatures in the area of QT interval and ST segment analysis are summarised as follows:
Beat to beat QT interval variability was measured by automated analysis on the basis of 256 second records of the surface ECG. A QT variability index (QTVI) was calculated for each subject as the logarithm of the ratio of normalisedQT variance to heart rate variance [12].
Another new algorithm which is composed of several steps: pre-processing, QRS detection to position beats [21], QRS onset and T-wave end definition and selection of possible noisy beats in order to remove them. Algorithm for QT value selection is as follows:
where RR is the previous R-R interval. Tl, T2 is defined as T wave peak; QRS_{1} is defined as the first detected QRS waveform. QT, QTc, QTP, QTPc and RR measurement were obtained from 24-hour holter ECG signal processing.
In dynamic measurement of the QT interval, algorithms to automatically estimate the R, Q and T fiducially points have been developed and their sensitivity to baseline noise and wave morphology fluctuations have been tested on simulated ECGs [22]. The variability of the QT and RR interval is analyzed in the time and frequency domain.
An important limitation when using QT as an indirect marker of hypoglycaemia is the need to compensate for spontaneous variations in QTc. Calculation of the cumulative average and standard deviation is a simple statistical technique used for industrial process control. However, in this clinical situation the test cannot accurately discriminate between the two conditions. Hypoglycaemia also causes flattening of the T wave [23].
In a real-time QT interval measurement method, the first step of data processing consisted of band pass filtering using a moving average filter proposed by Ligtenberg with a bandpass between 0.6 and 39 Hz in order to remove electromyographic artifact and to avoid baseline wander. After that a function of Spatial Velocity (FSV) was computed, point by point, to detect QRS complexes. This step includes two stages: the learning phase and the detection phase. QRS width and RR interval were measured; a mean value was computed for each one. The QT duration was the difference between the T wave offset and the QRS complex onset. The maximum and minimum QT intervals as well as its mean value were computed for each five-minute strip [24].
Generally, the QT interval is an important indicator for the study of the ventricular repolarisation because it is a non-invasive measure of the process. This interval has been studied since the beginning of electrocardiology because of the evidence of a relationship between QT duration and different pathologies.
Many algorithms have been developed to study the QT interval, but these techniques are not considered as standard and research as are looking for better solution. The main problem is to define the T wave offset because it can be influenced by noise and baseline wonder.
Real time study of the QT interval is difficult for different reasons but is very useful while a cardiac patient is monitories in order to study the evolution of his cardiac activity after heart attack.
In one approach for ST segment analysis, software was developed to detect the R wave. It can determine sustained capture, and calculate beat by beat and average ST level and slope on captured beats by five computer methods (single points, average, weighted average, linear least-squares, parabolic least-squares) [25].
The single point’s method was given as an example:
Where f_{s} = sampling frequency (250Hz), ST point=R+80ms, PR point=R-60 ms, rest_ST = average ST level in the rest ECG, S,=ECG signal amplitude at the discrete time index / in mV, ST level is in mV, ST slope is in mV/s, S_{R+100}= R+100ms.
In another approach, the ST segment waveform is extracted by identifying the J-point and the onset of the ensuing T wave. The fiducial points are obtained by separating out the QRS complex and T wave using Eigen filters in the DCT (Discrete Cosine Transform) domain. The method extracted the ST segment features from ECG cycles successfully [20].
4. Use of Pan and Tompkins’s QRS Detection Algorithm
A real-time QRS detection algorithm developed in [25 and 26]. It recognizes QRS complexes based on analysis of the slope, amplitude, and width. Fig.2 shows the various filters involved in the analysis of the ECG signal. In order to attenuate noise, the signal is passed through a bandpass filter composed of cascaded high-pass and low-pass integer filters. Subsequent processes are differentiation, squaring, and time averaging of the signal [26].
In Fig.2, z(n) is the time-averaged signal. y(n) is the band-passed ECG, and x(n) is the differentiated ECG.
A bandpass filter is designed from a special class of digital filters that require only integer coefficients. This permits the microprocessor to do the signal processing using only integer arithmetic, thereby permitting real-time processing speeds that would be difficult to achieve with floating-point processing.
Since it was not possible to directly design the desired bandpass filter with this special approach, the design actually consists of cascaded low-pass and high-pass filter sections. This filter isolates the predominant QRS energy centered at 10 Hz, attenuates the low frequencies characteristic of P and T waves and baseline drift, and also attenuates the higher frequencies associated with electromyographic noise and power line interference. The next processing step is differentiation, a standard technique for finding the high slopes that normally distinguish the QRS complexes from other ECG waves. To this point in the algorithm, all the processes are accomplished by linear digital filters. Next is a nonlinear transformation that consists of point-by-point squaring of the signal samples. This transformation serves to make all the data positive prior to subsequent integration, and also accentuates the higher frequencies in the signal obtained from the differentiation process. The squared waveform passes through a moving window integrator. This integrator sums the area under the squared waveform over a 150-ms interval, advances one sample interval, and integrates the new 150-ms window. The amplitude thresholds applied to the bandpass-filtered waveform and to the moving integration waveform are based on continuously updated estimates of the peak signal level and the peak noise. After preliminary detection by the adaptive thresholds, decision processes make the final determination as to whether or not a detected event was a QRS complex.
Fig. 3 is a sampled ECG that will serve as an example input signal for the processing steps to follow.
4.1. Bandpass Integer Filter
The bandpass filter for the QRS detection algorithm reduces noise in the ECG signal by matching the spectrum of the average QRS complex. Thus, it attenuates noise due to muscle noise, 60-Hz interference, baseline wander, and T-wave interference. The passband that maximizes the QRS energy is approximately in the 5–15 Hz range. The filter implemented in this algorithm is a recursive integer filter in which poles are located to cancel the zeros on the unit circle of the z plane. A low-pass and a high-pass filter are cascaded to form the bandpass filter [26].
4.2. Low-pass Filter
The transfer function of the second-order low-pass filter is
The difference equation of this filter is
The cutoff frequency is about 11 Hz, the delay is five samples (or 25 ms for a sampling rate of 200 sps), and the gain is 36.
In order to avoid saturation, the output is divided by 32, the closest integer value to the gain of 36 that can be implemented with binary shift arithmetic [26].
4.3. High-pass Filter
Fig.4 shows how the high-pass filter is implemented by subtracting a first order low-pass filter from an all-pass filter with delay. The low-pass filter is an integer-coefficient filter with the transfer function
and the difference equation
This filter has a dc gain of 32 and a delay of 15.5 samples. The high-pass filter is obtained by dividing the output of the low pass filter by its dc gain and then subtracting from the original signal. The transfer function of the high-pass filter is
The difference equation for this filter is
The amplitude response and phase response of high pass filter are shown in above Fig.5. The high-pass filter is implemented by subtracting a low-pass filter from an all-pass filter with delay. The low cutoff frequency of this filter is about 5 Hz, the delay is about 16T (or 80 ms), and the gain is 1.
Fig.6 shows the amplitude response of the bandpass filter which is composed of the cascade of the low-pass and high-pass filters. The center frequency of the passband is at 10 Hz. The amplitude response of this filter is designed to approximate the spectrum of the average QRS complex as illustrated in Fig.3. Thus this filter optimally passes the frequencies characteristic of a QRS complex while attenuating lower and higher frequency signals [26].
4.4. Derivative
After the signal has been filtered, it is then differentiated to provide information about the slope of the QRS complex. A five-point derivative has the transfer function
This derivative is implemented with the difference equation
The fraction 1/8 is an approximation of the actual gain of 0.1. Throughout these filter designs we approximate parameters with power-of-two values to facilitate real-time operation. These power-of-two calculations are implemented by shift-left or shift-right operations.
This derivative approximates the ideal derivative in the dc through 30-Hz frequency range. The derivative has a filter delay of 2T (or 10 ms) [26].
4.5. Squaring Function
The previous processes and the moving-window integration, which is explained in the next section, are linear processing parts of the QRS detector.
The squaring function that the signal now passes through is a nonlinear operation. The equation that implements this operation is
This operation makes all data points in the processed signal positive, and it amplifies the output of the derivative process nonlinearly. It emphasizes the higher frequencies in the signal, which are mainly due to the QRS complex. A fact to note in this operation is that the output of this stage should be hard limited to a certain maximum level corresponding to the number of bits used to represent the data type of the signal.
4.6. Moving Window Integral
The slope of the R wave alone is not a guaranteed way to detect a QRS event. Many abnormal QRS complexes that have large amplitudes and long durations (not very steep slopes) might not be detected using information about slope of the R wave only. Thus, we need to extract more information from the signal to detect a QRS event. Moving window integration extracts features in addition to the slope of the R wave. It is implemented with the following difference equation:
where N is the number of samples in the width of the moving window. The value of this parameter should be chosen carefully.
4.7. Thresholding
The set of thresholds that [25] used for this stage of the QRS detection algorithm were set such that signal peaks (i.e., valid QRS complexes) were detected. Signal peaks are defined as those of the QRS complex, while noise peaks are those of the T waves, muscle noise, etc. After the ECG signal has passed through the band pass filter stages, its signal-to-noise ratio increases. This permits the use of thresholds that are just above the noise peak levels. Thus, the overall sensitivity of the detector improves. Two sets of thresholds are used, each of which has two threshold levels. The set of thresholds that is applied to the waveform from the moving window integrator is
SPKI = 0.125 PEAKI + 0.875 SPKI if PEAKI is the signal peak
NPKI = 0.125 PEAKI + 0.875 NPKI if PEAKI is the noise peak
THRESHOLD I1 = NPKI + 0.25 (SPKI – NPKI)
THRESHOLD I2 = 0.5 THRESHOLD I1
All the variables in these equations refer to the signal of the integration waveform and are described below:
PEAKI is the overall peak.
SPKI is the running estimate of the signal peak.
NPKI is the running estimate of the noise peak.
THRESHOLD I1 is the first threshold applied.
THRESHOLD I2 is the second threshold applied.
A peak is determined when the signal changes direction within a certain time interval. Thus, SPKI is the peak that the algorithm has learned to be that of the QRS complex, while NPKI peak is any peak that is not related to the signal of interest. As can be seen from the equations, new values of thresholds are calculated from previous ones, and thus the algorithm adapts to changes in the ECG signal from a particular person.
Whenever a new peak is detected, it must be categorized as a noise peak or a signal peak. If the peak level exceeds THRESHOLD I1 during the first analysis of the signal, then it is a QRS peak. If searchback technique (explained in the next section) is used, then the signal peak should exceed THRESHOLD I2 to be classified as a QRS peak. If the QRS complex is found using this second threshold level, then the peak value adjustment is twice as fast as usual:
SPKI = 0.25 PEAKI + 0.75 SPKI
The output of the final filtering stages, after the moving window integrator, must be detected for peaks. A peak detector algorithm finds peaks and a detection algorithm stores the maximum levels at this stage of the filtered signal since the last peak detection. A new peak is defined only when a level that is less than half the height of the peak level is reached.
5. QRS Detection Using Discrete Wavelet Transform
The strength of DWT is the possibility to obtain good separation of the QRS complex from other ECG components and noise in the time- scale plane. To select the appropriate prototype wavelet plays a key role in applying the DWT. Because there is no absolute way to select the mother-wavelet function, the function similar to the shape of QRS complexes is mostly chosen in the literature. Daubechiesdb4 wavelet is used as a mother wavelet in this research. The threshold to determine QRS complex is 50% of the maximum amplitude of the most QRS energy at the selected scales and the refractory period in which no QRS complex occurs is 0.2s to reduce false positive detection. In this algorithm, the DWT wavelet coefficient from scale 2^{1} (i.e. 1^{st} decomposition level) is used. The remaining coefficients are neglected. The decomposed signal is detected to show ECG characteristic points.
6. Test and Results with Pan and Tompkins’ Algorithm
In this section, computer simulation using MATLAB is applied on a set of ECG signals in order to investigate the quality of the proposed detection technique. The detection algorithm was tested on an ECG signal from MIT-BIH database in MATLAB. The results are obtained through simulation by MATLAB.
Fig. 8 shows the original ECG signal. The DC drift cancellation algorithm reduces noise in the ECG signal by matching the spectrum of the average QRS complex. This attenuates noise due to muscle noise, power line interference, baseline wander, T wave interference. Fig. 9 illustrates the cancellation DC drift and normalization.
First, in order to attenuate noise, the signal passes through a bandpass filter composed of cascaded high-pass and low-pass filters. Fig. 10 shows the ECG signal after processing with the low-pass filter. The most noticeable result is the attenuation of the higher frequency QRS complex. Any 50-Hz noise or muscle noise present would have also been significantly attenuated.
Fig. 11 is the resultant signal after the ECG signal passes through the high pass filter. Note the attenuation of the T wave due to the high-pass filter. According to the results, the low frequency portions of Fig.10 by using highpass filter. Fig 12 is the resultant signal after passing through the cascade of filters including the differentiator. Note that P and T waves are further attenuated while the peak-to-peak signal corresponding to the QRS complex is further enhanced.
After differentiation, the signal is squared point by point. The squaring signal must be described to get the positive signal in Fig. 13. Fig. 14 illustrates the averaging signal and the signal is integrated to obtain the waveform information in addition to the R peak in Fig. 15.
The squared waveform passes through a moving window integrator. This integrator sums the area under the squared waveform over a suitable interval, advances one sample interval, and integrates the new predefined interval window. Fig. 15 shows the output of the moving window integral for the sample ECG signal.
Fig 16 illustrates the relationship between the QRS complex and the window width. The width of the window should be approximately the same as the widest possible QRS complex. If the size of the window is too large, the integration waveform will merge the QRS and T complexes together. On the other hand, if the size of the window is too small, a QRS complex could produce several peaks at the output of the stage. The width of the window should be chosen experimentally. For a sample rate of 200 samples per second, the window chosen for this algorithm was 30 samples wide (which correspond to 150 ms).
(QS: QRS width. W: Width of the Integrator Window.)
The integrated signal must be changed to form the number of samples in Fig. 17. Since the QRS complexes have a time-varying morphology, they are not always the strongest signal component in an ECG signal. Therefore, P-waves or T-waves with characteristics similar to that of the QRS complex, as well as spikes from high frequency pacemakers can compromise the detection of the QRS complex.
In addition, there are many sources of noise in a clinical environment that can degrade the ECG signal. QRS detectors must be invariant to different noise sources and should be able to detect QRS complexes even when the morphology of the ECG signal is varying with respect to time. The QRS detector is divided into two stages: preprocessor stage to emphasize the QRS complex and a decision stage to threshold the QRS enhanced signal. The algorithm has been implemented using MATLAB to find QRS complex only and tested with data available from MIT-BIH arrhythmia data base. Fig.18 shows the P, QRS and T point detection.
7. Use of Wavelet Transform in QRS Peak Detection
Wavelets are a powerful tool for the representation and analysis of ECG signal. They have been implemented for the analysis of physiological waveforms like ECG, Phonocardiogram etc. This is because wavelet has finite duration as compared to Fourier methods based on sinusoids of infinite duration. Wavelet Transform involves the decomposition of signal into various components. They provide both time and frequency view. Unlike Fourier Transform, they are very efficient for non-stationary signals like ECG. To select the appropriate prototype wavelet plays a key role in applying the DWT. Because there is no absolute way to select the mother-wavelet function, the function similar to the shape of QRS complexes is mostly chosen in the literature. Daubechiesdb4 wavelet is used as a mother wavelet in this research. The threshold to determine QRS complex is 50% of the maximum amplitude of the most QRS energy at the selected scales and the refractory period in which no QRS complex occurs is 0.2s to reduce false positive detection. In this algorithm, the DWT wavelet coefficient from scale 2^{1} (i.e. 1^{st} decomposition level) is used. The remaining coefficients are neglected. The results of the detection are shown in Fig. 19.
In this work, ECG signal characteristic points are detected by two methods. In the above section, the simulation results of peak detection system with Pan and Tompkins Algorithm are described. In this section, the test results of wavelet based ECG signal peak detection system are illustrated.Firstly the ECG signal from MIT-BIH database is loaded into workspace as shown in Fig. 19. The wavelet decomposition signals in four levels are shown in Fig. 20. Fig.20 shows the approximation coefficients after decomposition in Level 4 and it shows the actual accuracy and reliability of the algorithm based on the specific electric voltages with respect to sample. All characteristic points are detected as shown in Fig. 21.
8. Performance Evaluation of QRS Detection Algorithms
The performance of detection for the implemented algorithms is first visually inspected. The algorithms were then statistically compared by calculating the number of false positives (FP), true positives (TP) and false negatives (FN) for each record.
Detection is said to be true positive (TP) if the algorithm correctly identifies the QRS complex and it is said to be false negative (FN) if the algorithm fails to detect the QRS complex. False positive (FP) detections are obtained if non-QRS wave is detected as a QRS complex. The two parameters, sensitivity (Se) and positive prediction (+P) are calculated using the following equations respectively.
Pan and Tompkins’ Method is used for QRS complex detection. This algorithm has been correctly detected 100% for QRS complex. Eleven record signals from MIT-BIH Database are tested with Daubechies wavelet transform. This algorithm has been detected 100% for QRS complex except data 109 for positive predictive. In evaluations, both methods can properly detect only 69.23 and 66.667 percent of peak for P wave in data 104. In comparison, Pan and Tompkins’ algorithm is better than Wavelet transform method. The assessment of performance of QRS detection algorithms was done using well annotated MIT-BIH Arrhythmia database. The information about the QRS complex obtained by this method is very useful for ECG classification and cardiac diagnosis. This information can also serve as an input to a system that allows cardiac diagnosis.
Peak Detection using Pan and Tompkins’ algorithm | |||||||||||||||
No. | QRS Complex | P Wave | T Wave | ||||||||||||
MIT/BIH record | TP | FN | FP | Sensitivity | Positive Predictive | TP | FN | FP | Sensitivity | Positive Predictive | TP | FN | FP | Sensitivity | Positive Predictive |
100 | 13 | 0 | 0 | 100% | 100% | 13 | 0 | 0 | 100% | 100% | 11 | 0 | 1 | 100% | 91.667% |
101 | 11 | 0 | 0 | 100% | 100% | 11 | 0 | 1 | 100% | 91.667% | 11 | 0 | 0 | 100% | 100% |
102 | 12 | 0 | 0 | 100% | 100% | 12 | 0 | 0 | 100% | 100% | 12 | 0 | 0 | 100% | 100% |
103 | 11 | 0 | 0 | 100% | 100% | 11 | 0 | 1 | 100% | 91.667% | 11 | 0 | 1 | 100% | 91.667% |
104 | 12 | 0 | 0 | 100% | 100% | 8 | 4 | 0 | 66.667% | 100% | 11 | 1 | 1 | 91.667% | 91.667% |
105 | 14 | 0 | 0 | 100% | 100% | 14 | 0 | 0 | 100% | 100% | 13 | 1 | 1 | 92.857% | 92.857% |
106 | 10 | 0 | 0 | 100% | 100% | 10 | 0 | 0 | 100% | 100% | 9 | 0 | 1 | 100% | 90% |
109 | 16 | 0 | 0 | 100% | 100% | 16 | 0 | 0 | 100% | 100% | 15 | 1 | 0 | 93.75% | 100% |
201 | 14 | 0 | 0 | 100% | 100% | 13 | 1 | 0 | 92.85% | 100% | 14 | 0 | 0 | 100% | 100% |
202 | 9 | 0 | 0 | 100% | 100% | 9 | 0 | 0 | 100% | 100% | 8 | 0 | 1 | 100% | 88.889% |
205 | 15 | 0 | 0 | 100% | 100% | 13 | 2 | 0 | 86.66% | 100% | 14 | 0 | 1 | 100% | 93.333% |
Experimentally if the automatic method is able to detect truly a point, it is visually inspected to be TP. If the algorithm fails to detect the point by visual inspection, it is considered to be FN. If the algorithm detects the intended point, it is said to be FP.
The methods for ECG peak detection including Pan-Tompkins’ Method and Discrete Wavelet Transform have been implemented. Pan and Tompkins’ algorithm is proposed for signal de-noising and detection of QRS complexes. Designed filters are applied on removing noise in ECG signal. The next process is differentiation followed by squaring and then integration. The integrated signal is detected by thresholding for QRS complex. P wave and T wave are detected by using detected QRS complexes. The DWT method is found to have a sensitivity and positive prediction. The best feature of this method is that it is suitable for non-stationary signals like ECG. Thus peak detection using Discrete Wavelet Transform is a novel, efficient method having less computation time, hence suited for analysis of ECG signal for clinical purposes. The performances evaluation of two detection methods have been applied in sensitivity (Se) and positive prediction (+P). The performance of Pan and Tompkins’ algorithm is better than Wavelet Transform method for sensitivity and positive prediction.
Peak Detection using Wavelet Transform | |||||||||||||||
No. | QRS Complex | P Wave | T Wave | ||||||||||||
MIT/BIH record | TP | FN | FP | Sensitivity | Positive Predictive | TP | FN | FP | Sensitivity | Positive Predictive | TP | FN | FP | Sensitivity | Positive Predictive |
100 | 13 | 0 | 0 | 100% | 100% | 13 | 0 | 0 | 100% | 100% | 11 | 0 | 1 | 100% | 91.667% |
101 | 11 | 0 | 0 | 100% | 100% | 11 | 0 | 1 | 100% | 91.667% | 11 | 0 | 0 | 100% | 100% |
102 | 12 | 0 | 0 | 100% | 100% | 12 | 0 | 0 | 100% | 100% | 12 | 0 | 0 | 100% | 100% |
103 | 11 | 0 | 0 | 100% | 100% | 11 | 0 | 1 | 100% | 91.667% | 11 | 0 | 1 | 100% | 91.667% |
104 | 12 | 0 | 0 | 100% | 100% | 8 | 4 | 0 | 100% | 11 | 1 | 1 | 91.667% | 91.667% | |
105 | 14 | 0 | 0 | 100% | 100% | 14 | 0 | 0 | 100% | 100% | 13 | 1 | 1 | 92.857% | 92.857% |
109 | 14 | 0 | 2 | 100% | 87.5% | 14 | 0 | 2 | 100% | 87.5% | 13 | 1 | 2 | 92.857% | 86.667% |
201 | 14 | 0 | 0 | 100% | 100% | 13 | 1 | 0 | 92.857% | 100% | 14 | 0 | 1 | 100% | 93.333% |
202 | 9 | 0 | 0 | 100% | 100% | 9 | 0 | 0 | 100% | 100% | 8 | 0 | 1 | 100% | 88.889% |
205 | 15 | 0 | 0 | 100% | 100% | 15 | 0 | 0 | 100% | 100% | 14 | 0 | 1 | 100% | 93.333% |
9. Conclusion
ECG is an essential tool in the diagnosis and analysis of the heart activity. Today, in accordance with the advancement of computer technology, many researches based on computer have been done for automatic diagnosis and processing over many decades. However, computer-based ECG system is not able to use widely for all people, the rich and the poor, and everywhere, urban and the countryside because of its implementation cost and the higher price of software. In addition, the system is still dependent of the decision of doctor and the physician. This work is intended to support all people with low cost and user friendly software. A high quality of feature set is undoubtedly the first important factor for good performance of ECG analysis algorithms. In this work the algorithm for detection of ECG characteristics points are presented. The different digital filters are designed and implemented to remove noises and to improve the signal to noise ratio. At the implementation of filters, band pass filter is applied with subdivided type of filters such as low pass filter and high pass filter. It can be called preprocessing of ECG signal. After preprocessing, the QRS complexes, P wave and T wave are detected with the Pan and Tompkins’ algorithm and Wavelet transform method. The performances of two detection methods are calculated with sensitivity (Se) and predictivity (+P) using the MIT-BIH database. The two methods can provide reliable and accurate detection of the characteristic points such as P wave, QRS complex and T wave. To estimate positive predictivity and sensitivity, the points; TP, FP, FN are identified visually. The positive prediction and sensitivity of QRS complexes using Pan and Tompkins’ algorithm are approximately 100% for tested signals from MIT-BIH database. The detection rate of QRS complexes using Wavelet Transform is also nearly 100% of sensitivity and positive prediction except for positive prediction in data 109. Both methods can only detect 69.23 and 66.667 percent of P wave in sensitivity for data 104. Although Wavelet transform method can only detect 86.887% for T wave in positive prediction, Pan and Tompkins’ algorithm can detect 100%. In comparison, Pan and Tompkins’ algorithm can more detect the characteristic points than Wavelet Transform method.
References