Biomedical Signal Processing and Control 7 (2012) 118–128
Contents lists available at ScienceDirect
Biomedical Signal Processing and Control journal homepage: www.elsevier.com/locate/bspc
A novel method for detecting R-peaks in electrocardiogram (ECG) signal M.Sabarimalai Manikandan a,∗ , K.P. Soman b a b
Department of Electronics and Communication Engineering, Amrita Vishwa Vidyapeetham, Coimbatore, Tamilnadu, India Center for Excellence in Computational Engineering and Networking, Amrita Vishwa Vidyapeetham, Coimbatore, Tamilnadu, India
a r t i c l e
i n f o
Article history: Received 22 November 2010 Received in revised form 3 March 2011 Accepted 4 March 2011 Available online 2 April 2011 Keywords: Biosignal processing QRS detection ECG analysis Signal detection
a b s t r a c t The R-peak detection is crucial in all kinds of electrocardiogram (ECG) applications. However, almost all existing R-peak detectors suffer from the non-stationarity of both QRS morphology and noise. To combat this difficulty, we propose a new R-peak detector, which is based on the new preprocessing technique and an automated peak-finding logic. In this paper, we first demonstrate that the proposed preprocessor with a Shannon energy envelope (SEE) estimator is better able to detect R-peaks in case of wider and small QRS complexes, negative QRS polarities, and sudden changes in QRS amplitudes over that using the absolute value, energy value, and Shannon entropy features. Then we justify the simplicity and robustness of the proposed peak-finding logic using the Hilbert-transform (HT) and moving average (MA) filter. The proposed R-peak detector is validated using the first-channel of the 48 ECG records of the MIT-BITH arrhythmia database, and achieves average detection accuracy of 99.80%, sensitivity of 99.93% and positive predictivity of 99.86%. Various experimental results show that the proposed R-peak detection method significantly outperforms other well-known methods in case of noisy or pathological signals. © 2011 Elsevier Ltd. All rights reserved.
1. Introduction Automatic detection of the R-peaks in a long-term electrocardiogram (ECG) signal is the most important step for diagnosis of cardiac disorders, heart-rate variability analysis, biometric, and ECG coding systems [1–3]. The performance of these systems heavily rely on the accuracy of the R-peak detector. Many methods based on the derivatives [6], digital filters [7–10], linear prediction, wavelet transform [1,12–14], mathematical morphology [15,16], and empirical mode decomposition (EMD) [17], geometrical matching [18], neural networks [19] and hybrid approach [11] have been developed for the detection of R-peaks. Methods based on the filtering techniques and decision rules are computationally efficient and hence ideal for any automatic ECG analysis [9]. Most of the methods include a preprocessing or feature extraction stage and a decision stage [4]. Generally, preprocessing stage applies various signal processing techniques to accentuate the QRS complex and suppress noises but most of them have some drawbacks. In [7], the tradeoff between misses and false detections relies on the selection of bandwidth of the filter and size of the moving-window integrator. The WT-based QRS detector has the choice problem of mother wavelet and scales to obtain QRS events. Although the EMD-based approach in [17] can overcome the choice problem of basis function,
∗ Corresponding author. Tel.: +91 0422 2656422. E-mail address:
[email protected] (M.Sabarimalai Manikandan). 1746-8094/$ – see front matter © 2011 Elsevier Ltd. All rights reserved. doi:10.1016/j.bspc.2011.03.004
selection of a set of intrinsic mode functions (IMFs) is very difficult under noisy environments. The performance can be improved by designing more effective filtering and better threshold adjustment procedures [17]. However, it is hard to design a single comprehensive preprocessing technique for achieving simultaneous QRS enhancement and noise reduction effectively in practice. Therefore, most of the works paid attention on constructing suitable decision rules based on the preprocessing results. The decision stage of the filtering approaches commonly consists of a set of heuristic rules and a set of tactics for finding the approximate location of candidate R-peak. These thresholds are adapted periodically based upon amplitudes, durations and RRintervals of past detected R-peaks. In such a case, performance relies highly on the accurate estimation of initial parameters in the learning phase. Most of methods had higher false-negative (FN) and false-positive (FP) detections in case of small and wider QRS complexes. Therefore, additional decision rules have been developed from a positive view but they have negative effects. For example, in [9], failure instances of the five QRS detection methods with and without use of secondary threshold were investigated by using the MIT-BITH arrhythmia database records 108 (negative R-peaks and high noises) and 208 (wide-QRS complexes). Experimental results showed that the detection accuracy of the Method I, modified Method I, and Method III is very poor for negative R-peaks in record 108 [9]. Furthermore, Method I and Method III fail to detect small and wider QRS complexes in record 208. In this case, modified Method I, Method II and modified Method II had better detections
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128
with use of secondary threshold but it results in higher FP detections for noisy ECG signal. Moreover, many methods had higher FN for ECG with small and wider QRS complexes. Therefore, two rules with adaptive amplitude-dependent and time-dependent thresholds were widely adopted to reject or include identified R-peaks located at tm and tn : (i) if tn − tm < 0.2 s (refractory period) and (ii) search back if tn − tm > 1.5RRavg . These rules may improve detections for regular rhythms but some rules may be in conflict with others. Furthermore, searchback mechanism cannot be halted in case of irregular rhythms with varying QRS complexes. Moreover, there are often lots of thresholds defined in heuristic rules. The above detection issues clearly indicate that it is hard to find a proper rule set in case of (i) wide QRS complexes, (ii) low-amplitude QRS complexes, (iii) negative QRS polarities, (iv) sudden changes in RR intervals, (v) sudden changes in QRS amplitudes, (vi) sudden changes in QRS morphologies, and (vii) sharp P- and T-waves. All of the aforementioned constraints on the preprocessor and heuristic rules of the existing QRS detectors demonstrate that detection of R-peaks is still very challenging task. In this paper, we propose a new preprocessor which is based on the Shannon energy envelope estimator and a simple peak-finding logic using the Hilbert-transform (HT) and moving average (MA) filter to combat the detection problem of unusually shaped QRS complexes and noises. The rest of this paper is organized as follows. In Section 2, the four-stage R-peak detection methodology is described in detail. We here introduce our new preprocessor and a novel automatic peak-finding scheme without using any amplitude threshold and prior knowledge of detected R-peaks. The experimental results to demonstrate the effectiveness of the proposed preprocessor and peak-finding scheme are presented in Sections 2.2 and 2.3. We experimentally evaluate our method using the wellknown MIT-BIH arrhythmia database, and a comparison between the proposed methodology and other approaches is presented in Section 3. Finally, in Section 4, we discuss and conclude our study. 2. The proposed R-peak detection methodology The block diagram of the proposed R-peak detection algorithm is shown in Fig. 1. It consists of four stages, namely, digital filtering, Shannon energy envelope extraction, peak-finding logic, and true R-peak locator. The first stage of the proposed algorithm includes a bandpass filter, an amplitude normalization and first-order forward difference operation to emphasize the QRS complex and to remove the noise in ECG signal. In the second stage, Shannon energy estimation and zero-phase filtering are applied to obtain a smooth Shannon energy (SE) envelope that plays the most critical role in the proposed algorithm. We can observe that major local maxima in the SE envelope represent approximate locations of the R-peaks in ECG signal. In the third stage, the proposed peak-finding technique is developed based on the Hilbert transformation, drift removal and zero-crossing point (ZCP) detection. The proposed technique identifies accurate locations of the local maxima by detecting positive zero-crossing points in Hilbert-transformation of the SE envelope. We here show that the positive ZCP in Hilbert sequence of the envelope, s[n], indicates local peaks of the s[n] and the MA filter reduces the effect of ZCP drift in positive and negative directions. Finally, locations of the local maxima are used as guides to find accurate locations of the R-peaks in ECG signals. The detailed discussions on each stage in Fig. 1 are presented in the following subsections. 2.1. Noise suppression and enhancement of QRS complex In the realistic environments, ECG signals may be corrupted by various kinds of noise, including power line interference, electrode contact noise, motion artifacts, muscle contraction and baseline
119
Stage 1: Linear Digital Filtering
ECG x[n]
Bandpass Filtering (BPF)
First-Order Forward Differencing (FOFD)
f[n]
d[n]
Amplitude Normalization (AN) [n]
Stage 2: Smooth SE Envelope Extraction
Shannon Energy (SE) Computation
Zero-Phase Filtering
s[n] Stage 3: Peak-Finding Logic Hilbert Transformation
Moving Average Filtering
z[n] Positive Zero Crossing Point (ZCP) Detection
Stage4: Identification of the real RPeak in the ECG within 25 samples Time Instants of R-peaks Fig. 1. Block diagram of the proposed four-stage R-peak detection methodology.
drift and also have large P and T waves. Therefore, the digital filtering stage is constructed using bandpass filter (BPF) and first-order differentiation to accentuate the QRS complex, and to reduce noise and the influence of the P and T waves. The 4th order Chebyshev type I bandpass filter is designed for the bandwidth of [6 18] Hz. Here, the filter is applied in both the forward and reverse directions to avoid the phase distortion. Then, the filtered signal, f[n], is differentiated to provide information about the slope of the QRS complexes. The differentiation of the filtered ECG is implemented as d[n] = f [n + 1] − f [n],
(1)
which acts as a high-pass filter. The differentiation stage further reduces the interference of tall P- and T-waves. The output of the differentiator is a bipolar signal and thus a rectification is required to simplify the detection of negative R-peaks. After band-pass filtering and differentiation, we normalize the differentiated ECG (dECG) signal, d(n), by ˜ d[n] =
d[n] maxN (|d[n]|) n=1
,
(2)
where N denotes the number of samples in ECG segment. 2.2. Shannon energy and smooth envelope extraction After differentiation, the dECG signal is passed through a nonlinear transformation to obtain positive peaks regardless of polarity of QRS complexes. The main objective of transformation is to use single-sided threshold mechanism and to enhance the QRS complexes [5]. In literature, the squaring transformation is widely used but it considerably diminishes the magnitude of the candidate Rpeaks of low-amplitude QRS complexes and wide QRS complexes [9]. Here, we study the performance of different nonlinear transformation techniques using the low-amplitude QRS complexes, wider QRS complexes, and noisy ECG signals. The absolute value, energy
120
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128 Normalized Original ECG dECG Signal
2
0
0 −1
−1
0.5
0.5 0 −0.5
−1 1
−1 1
0.5
0.5
1
1
0.5
0.5
1
0 1
0.5
0.5
0 1
0 1
0.5
0.5
Energy Envelope
Shannon Energy Envelope
0
−0.5
Absolute Envelope Entropy Envelope
1
1
0
1
2
3
4
5
6
time (sec)
7
8
9
10
(a)
0 0
1
2
3
4
5
time (sec)
6
7
8
9
10
(b)
Fig. 2. Illustrates the performance of different envelopes extracted for a differentiated ECG (dECG) signal. The Shannon entropy approach emphasizes the effect of low noise components and the energy (squarer) approach decreases the magnitude of R-wave candidates. The Shannon energy approach magnifies medium-amplitude values and thus exhibits the small difference between the successive peaks than the other envelopes.
value, Shannon entropy value, and Shannon energy value of the normalized dECG signal are computed using the following using Eqs. (3)–(6)[20] ˜ a(n) = |d[n]|,
(3)
e[n] = d˜ 2 [n],
(4)
˜ ˜ log(|d[n]|), se(n) = −|d[n]|
(5)
s[n] = −d˜ 2 [n] log(d˜ 2 [n]).
(6)
Then, the filtering is applied to obtain peaks corresponding to the QRS-complex portions and smooth out the spikes and noise bursts that is implemented using a rectangular impulse response, h(k) of length M. Here, the filtering operation is performed in both the forward and reverse directions, i.e., conv(s, h) → s → reverse the data → sr → conv(sr , h) → s → reverse the data → y. This zero-phase filtering provides sharp peaks around QRS complex regions and smooth out spurious spikes. The smoothness depends on the filter length L. Generally, the L should be approximately the same as the duration of possible wider QRS complex. The length of the filter is found empirically. For sampling rate of 360 samples/s, the filter length of 55 samples is found in this study. Fig. 2 illustrates the performance of Shannon energy, Shannon entropy, energy and absolute value envelopes of the normalized dECG signals. Experimental results show that the Shannon entropy approach stresses the effect of low noise components that results in the envelope with artifacts and more unwanted peaks. The energy (squarer) approach decreases the amplitude of the small R-wave candidates much more than that of high-amplitude ones. This approach results in the envelope with large high/low peak amplitude ratio. The Shannon entropy and the energy approaches increase the difficulty of the R-wave peak detection task. Therefore, we here introduce Shannon energy approach to obtain a positive signal. The Shannon energy envelogram (SEE) approach has the following advantages over conventional approaches: (i) it results in small deviations between the successive peaks; (ii) it reduces the
effects of low-value noise components; and (iii) it produces smooth sharp local maxima which clearly indicate the time instants of Rpeaks. Therefore, the Shannon energy envelope of a normalized ˜ is computed by using an Eq. differentiated ECG (dECG) signal, d[n], (6). The major advantages of SE approach show that it can lead to the much better R-peak detection performance in the presence of small and wider QRS complexes, and non-stationary noise. Experimental results, shown in Fig. 2, demonstrate that major local maxima in a smooth Shannon energy envelope, s[n], indicate approximate locations of the R-peaks in a ECG signal. Hence, the smooth Shannon energy envelope are processed further to detect R-peaks.
2.3. Hilbert transform-based peak-finding logic The detection of a R-wave peak is achieved by comparing the envelope of a ECG signal against a fixed/adaptive amplitudedependent and RR interval-dependent thresholds. Most R-peak detection methods use a similar approach to determine the threshold. The detection thresholds are adapted periodically based upon amplitudes, durations and RR-intervals of past detected R-peaks. In such a case, performance relies highly on the accurate estimation of initial parameters in the learning phase. Almost all methods use additional decision rules for the reduction of false-positive detections and introduce secondary thresholds to detect missed R-peaks. These heuristic rules may improve detections for regular rhythms but some rules may be in conflict with others. Furthermore, searchback mechanism with secondary threshold cannot be halted in case of irregular rhythms with varying QRS complexes and noise. Moreover, there are often lots of thresholds defined in heuristic rules. In this paper, we introduce a novel automatic peak-finding logic by exploiting the property of the Hilbert transform (HT) and using the moving average (MA) filter. The main objective of this paper is to demonstrate the use of the Hilbert-transform for reducing the complexity of the local maxima finding task. The Hilbert transform is widely used for analyzing the
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128
candidate R−peak
1.0
amplitude
0.75
a
2
r(t)=1/(1+t )
0.5
TP
TP
TP
TP
TP
2.5
3
TP
TP
0 0
Hilbert transform of the candidate R−wave
b
0.5 TP
1
1.5
2
3.5
1
4
TP
TP r
HT[r ]
n
0.25
0.5
FN
n
TP
TP
TP
R−peak FN
0
0
odd−symmtery function
−0.25
−0.5 0
zero−crossing point
c
−0.5
1
0.5
−0.15
0
0.15
0.3
instantaneous amplitude and frequency of the signal. The HT of a real signal x(t) is defined as ∞
−∞
x() d. t−
(7)
The Hilbert transform defined in the time domain is a convolution between 1/t and x(t). The Fourier transform (FT) of the xˆ (t) is given by
1
t
× x(t) = F
1 t
F[x(t)] = −jsgn(f )X(f ).
(8)
Then, the Hilbert transform of the signal x(t) can be computed as
ˆ )] where X(f ˆ )= xˆ (t) = IFT [X(f
jX(f ) −jX(f )
2
f<0 f>0
2.5
3
3.5
4 TP
TP after the removal of low−frequency drift of the odd−symmtery function as shown in plot (b) TP TP TP TP TP: True Positive
Fig. 3. Illustration of the maximum finding task. The maximum value of the envelope function r(t) corresponds to the zero-crossing point of the rˆ (t).
1.5
0
time (sec)
1 1 × x(t) = xˆ (t) = H[x(t)] = t
1 TP
TP
0.5
−0.3
ˆ )=F X(f
TP
0.5
H[r(t)]=t/(1+t2)
candidate R−wave model
1
121
(9)
where IFT denotes the inverse Fourier transform, and X(f) is the Fourier transform of the signal x(t). To demonstrate the maxima finding task using the Hilbert transform, the even function, r(t) = 1/(1 + t2 ), is considered as a R-wave envelope model. The Hilbert transform of the even function, r(t), is given by rˆ (t) = t/(1 + t 2 ). The graphical representation of the r(t) and rˆ (t) is shown in Fig. 3. It can be observed that the maximum value of the envelope function r(t) corresponds to the zero crossing point of the rˆ (t) which is referred as odd-symmetry function (OSF). In practice, the strength of peaks in the filtered ECG is high around the R-wave portions. The amplitudes of the peaks in the smoothed envelogram are smaller for the low-amplitude and wide QRS complexes. Therefore, effectiveness of the peak-finding logic is studied using different envelopes. Fig. 4(a) clearly shows that the positive zero-crossing (or negative-to-positive transition) points of the odd-symmetry function correspond to locations of the peaks in the envelogram, and the performance of the peak-finding logic is excellent. Fig. 4(b) indicates the failure instance of the detection logic due to the low-frequency drift in the odd-symmetry function. It can be observed that the zero-crossing points of the third and sixth peaks are shifted in positive and negative directions, respectively. The degree of shift in a zero-crossing point and its direction is directly related to the relative peak amplitude and spacing of the two maxima and the sign of the peak difference. In practice, lowfrequency (LF) drift may arise because of the large peak-amplitude variation and the baseline shift of the peaks. In such cases, the peakfinding logic may fail to detect small amplitude candidate R-peaks, and removal of low-frequency drift is most important. Therefore, moving average (MA) filter is used in this work. The low-frequency drift is effectively removed by subtracting the output of the MA filter from the original input. The result is shown in Fig. 4(c) for the
−0.5 0
0.5
1
1.5
2
FN: False Negative
2.5
3
3.5
time (sec)
4
Fig. 4. Effectiveness of the HT-based peak-finding logic for different envelopes: (a) normal ECG with small relative peak-amplitude (RPA) variation and RR = 0.55 s. (b) Abnormal ECG with large RPA variation and RR = 0.55 s. (c) Performance of the logic after the removal of LF drift shown in (b).
drifted odd-symmetry function in Fig. 4(b). It clearly shows that the method had perfect detections. The choice of the filter length is important for computing the low-frequency drift that mainly depends on the heart rate. For our sample rate of 360 samples/s, the MA filter length (L) is 900 samples (2.5 s). We noted that the performance of the peak-finding logic is better when the difference between two successive peak amplitudes is very small. But amplitudes of candidate R-peaks depend on temporal and spectral parameters of the QRS complex. However, the proposed Shannon energy-based preprocessor provides small deviations between the successive candidate R-peaks under time-varying QRS morphologies. The various signal transformations at different stages of the proposed method using the ECG segment taken from the record 205 of the MIT-BIH arrhythmia database are shown in Fig. 5. The output waveforms of the bandpass filter and first-order forward derivative operation are shown in Fig. 5(b) and (c), respectively. The Shannon energy envelogram of the normalized dECG and the output of the Hilbert transformation of the envelogram are presented in Fig. 5(d) and (e), respectively. We can observe that the zero-crossing points are drifted in negative direction due to the large amplitude difference between the two successive peaks. Here, the low-frequency waveform drift is eliminated by subtracting the output of the moving average (MA) filter from the input waveform shown in Fig. 5(e). The output of LF drift removal stage is shown in Fig. 5(f). Finally, the zero-crossings accompanied by negative to positive transition are detected and used as guides to locate candidate R-peaks in the Shannon energy envelogram. The output of positive zero-crossing point (ZCP) detector is shown in Fig. 5(g), which shows that the locations of the impulses correspond to the peaks of candidate R-wave. The low-amplitude R-peaks of the record 205 can be successfully detected only when the output of LF drift eliminator [Fig. 5(f)] is processed. Experiments clearly demonstrate that the Shannon energy approach and Hilbert-transform based peak-finding logic play a key role in the detection of R-peak. The proposed decision stage does not require any information about the previously detected R peaks. 2.4. True R-peak detection Experiments show that the locations of candidate R-peaks differ slightly from the time instants of true R-peaks in an original ECG signal. Therefore, a simple true R-peak locator is incorporated
122
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128
(a)
0.1 0 −0.1 1 0.5 0 −0.5
SEE, s[n] norm. d[n]
f[n]
x[n]
0.5 0 −0.5
(b)
(c)
6 4
(d)
z[n]
HT of s[n]
2 2 0 −2 −4
(e)
2 0 −2
(f)
ZCPs
1
(g)
Final, R−peaks
0 0.5
(h)
0
−0.5
1
2
3
4
5 time (sec)
6
7
8
9
10
Fig. 5. Proposed R-peak detector: (a) ECG signal, x[n], taken from a record 205. (b) Output of bandpass filter. (c) Output of differentiator. (d) Output of SEE estimator. (e) Output of Hilbert transformer. (f) Output of LF drift eliminator. (g) Output of positive ZCP finder. (h) Output of true R-peak locator.
that finds the correct time instants of the R-peaks in a ECG signal by searching the largest amplitude within ±25 samples of the identified location of the candidate R-peak in the previous step. Fig. 5(h) shows the original signal and the detected R-peaks using the proposed four-stage methodology.
3. Results and discussion The proposed R-peak detection method is evaluated using the MIT-BIH arrhythmia database. It contains 48 half-hour of twochannel ECG recordings sampled at 360 Hz with 11-bit resolution over a 10 mV range. The ECG records from this database include signals with acceptable quality, sharp and tall P and T waves, negative QRS complex, small QRS complex, wider QRS complex, muscle noise, baseline drift, sudden changes in QRS amplitudes, sudden changes in QRS morphology, multiform premature ventricular contractions, long pauses and irregular heart rhythms. In this study, we consider the entire ECG recordings since the proposed method does not require any learning phase. Episodes of ventricular flutter in ECG record 207 are excluded from the performance analysis for better comparison with the other detection methods [1,9]. The proposed algorithm was implemented on a 2.4-GHz Intel core 2 Quad CPU using MATLAB version 7.1, and was tested on the ECG signals taken from the first channel of the MIT-BIH arrhythmia database. In this study, the smoothing filter length (M) and the moving average filter length (L) of the detector are set as (M, L) = (55, 900) samples. The average processing time required for performing our method on each 30 min ECG data in the MIT-BIH database is approximately 2.24 s. From the detection results, we calculated three quantitative results: true-positive (TP) when a R-peak is correctly detected by the proposed algorithm, false-negative (FN) when a R-peak is missed, and false-positive (FP) when a noise spike is detected as R-peak. To evaluate the performance of the proposed detection
algorithm, the sensitivity (Se), the positive predictivity (+P), and the detection error rate (DER) can be computed by using the following equations, respectively Se =
TP × 100%, TP + FN
(10)
+P =
TP × 100%, TP + FP
(11)
DER =
FP + FN × 100%. TP
(12)
The overall performance of the method is measured in terms of the detection accuracy which is defined as Accuracy(Acc) = TP/(TP + FP + FN) × 100%.
(13)
The R-peak detection rates for the first-channel (each) of 48 ECG recordings of the MIT-BIH arrhythmia database are summarized in Table 1. The proposed method produces 79 false-negative (FN) beats and 140 false-positive (FP) beats for a total detection failure of 219 beats. But the individual detection accuracies of the ECG records vary from 98.99% to 100% depending on the characteristics of normal and pathological ECG signals, and different noises. In the MIT-BIH arrhythmia database, ECG records 104, 105, 108, 200, 203, 210, and 228 contain high-grade noise and artifact. Records 108, 111, 112, 116, 201, 203, 205, 208, 210, 217, 219, 222, and 228 include severe baseline drifts and abrupt changes. Records 201, 202, 203, 219 and 222 exhibits various irregular rhythmic patterns. Records 201, 219 and 232 include long pauses up to 6 s in duration. Records 108 and 222 contain tall sharp P waves. Record 113 has tall sharp T waves. For these ECG recordings, the number of false positive detections is more in all the algorithms. Records 200, 203 and 233 contain multiform ventricular arrhythmia, negative QRS polarity and sudden changes in QRS morphology. Record 208 has wider premature ventricular contractions (PVCs). Record 223 exhibits sudden changes in QRS amplitudes. Records 116 and
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128
123
Table 1 Performance evaluation of the proposed R-wave detection method using first channel of the MIT-BIH arrythmia database with the detection parameters such as smoothing filter length (M) and MA filter length (L)), (M, L) = (55, 900) samples. ECG record
Total (beats)
FN (beats)
FP (beats)
DER (%)
Se (%)
+P (%)
Accuracy (%)
100 101 102 103 104 105 106 107 108 109 111 112 113 114 115 116 117 118 119 121 122 123 124 200 201 202 203 205 207 208 209 210 212 213 214 215 217 219 220 221 222 223 228 230 231 232 233 234
2273 1865 2187 2084 2229 2572 2027 2137 1763 2532 2124 2539 1795 1879 1953 2412 1535 2278 1987 1863 2476 1518 1619 2601 1963 2136 2980 2656 1862 2955 3005 2650 2748 3251 2262 3363 2208 2154 2048 2427 2483 2605 2053 2256 1571 1780 3079 2753 Overall
0 2 0 0 0 8 0 0 4 0 0 0 0 0 1 16 0 0 0 0 0 0 0 0 0 0 11 0 0 8 0 6 9 0 2 0 1 0 0 0 0 1 6 0 2 0 2 0 79
0 4 0 0 14 18 2 0 12 0 0 0 3 0 3 8 0 3 0 2 0 0 0 6 1 7 5 0 0 5 0 3 0 0 3 0 2 2 0 0 0 0 7 2 9 18 0 1 140
0 0.322 0 0 0.628 1.011 0.099 0 0.908 0 0 0 0.167 0 0.205 0.995 0 0.132 0 0.107 0 0 0 0.231 0.051 0.328 0.537 0 0 0.44 0 0.339 0.328 0 0.221 0 0.136 0.093 0 0 0 0.038 0.633 0.088 0.700 1.011 0.065 0.036 0.205
100 99.89 100 100 100 99.69 100 100 99.77 100 100 100 100 100 99.95 99.34 100 100 100 100 100 100 100 100 100 100 99.63 100 100 99.73 100 99.77 99.67 100 99.91 100 99.95 100 100 100 100 99.96 99.71 100 99.87 100 99.94 100 99.93
100 99.79 100 100 99.38 99.30 99.90 100 99.32 100 100 100 99.83 100 99.85 99.66 100 99.87 100 99.89 100 100 100 99.77 99.94 99.67 99.83 100 100 99.83 100 99.89 100 100 99.87 100 99.91 99.91 100 100 100 100 99.66 99.91 99.43 99.00 100 99.96 99.86
100 99.68 100 100 99.38 98.99 99.90 100 99.10 100 100 100 99.83 100 99.80 99.01 100 99.87 100 99.89 100 100 100 99.77 99.94 99.67 99.46 100 100 99.56 100 99.66 99.67 100 99.78 100 99.86 99.91 100 100 100 99.96 99.37 99.91 99.30 99.00 99.94 99.96 99.79
Table 2 Comparison of the numbers of false-positives (FPs) and false-negatives (FNs) for specific records of the MIT-BIH arrythmia database. Rec. no.
104 105 106 108 113 116 121 200 203 208 209 210 221 222 223 228 232 233 Total
Number of false-positive (FP) detections
Number of false-negative (FN) detections
Ref. [8]
Ref. [17]
Ref. [14]
Ref. [16]
Our method
Ref. [8]
Ref. [17]
Ref. [14]
Ref. [16]
Our method
3 53 1 50 2 4 1 3 14 9 2 2 1 40 0 19 3 0 207
20 35 5 68 6 – 15 47 23 2 0 8 4 5 28 38 26 1 331
0 15 0 2 1 20 1 1 79 13 0 5 0 27 0 1 0 1 166
7 7 21 10 10 4 13 4 3 3 2 16 4 1 4 10 14 7 140
14 18 2 12 3 8 2 6 5 5 0 3 0 0 0 7 18 0 103
7 22 2 47 1 25 0 2 61 19 2 41 1 37 2 6 0 3 278
1 14 0 9 0 – 0 3 95 19 0 23 2 0 1 22 0 7 196
0 21 2 62 682 0 0 2 19 3 1 2 4 12 0 14 17 0 841
1 19 20 2 11 27 0 9 7 10 9 5 8 0 22 2 2 8 162
0 8 0 4 0 16 0 0 11 8 0 6 0 0 1 6 0 2 62
124
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128
0 −0.5
Detected Peaks output of HT, z[n] smooth SEE, s[n]
ECG, x[n]
1 0.5
0
5
10 (a)
15
20
25
0
5
10
(b)
15
20
25
5
10
(c)
15
20
25
5
10
15
20
25
0.8 0.6 0.4 0.2
1 0.5 0
−0.5 0 1 0.5 0
−0.5 0
time (sec) (d) Fig. 6. Performance of the proposed R-peak detector for the ECG signal with baseline drift and low-amplitude QRS complexes (Record 103). The method has a detection accuracy of 100%.
208 contain smaller QRS complexes than the others. For these ECG recordings, most of the algorithms had higher false-negative detections. However, the proposed algorithm achieves a significant improvement in the detection of R-peak under time-varying QRS complex morphology and different kinds of noise and artifacts. The effectiveness of the proposed method in terms of the number of false negatives and false positives is shown in Table 2. The wave-
forms of the different stages of the proposed method using the ECG segments taken from first-channel of the different recordings of the MIT/BIH database are shown Figs. 6–12. In each of these figures, waveform depicted in (a) is the original ECG signal, x[n]. The waveform depicted in (b) is the smooth Shannon energy envelogram ˜ (SEE) of the signal d[n]. The waveform (c) is the final output of the Hilbert transformation and low-frequency drift removal process.
0 −0.5
output of HT, z[n] smooth SEE, s[n]
ECG, x[n]
1 0.5
0
5
10
0
5
10
(a)
15
20
25
15
20
25
15
20
25
15
20
25
0.8 0.6 0.4 0.2
(b) 0.5 0
Detected Peaks
−0.5 −1 0
5
10
5
10
(c)
1 0.5 0 −0.5 0
time (sec) (d) Fig. 7. Detection performance for the ECG with continuously varying QRS complex morphology, sudden changes in beat-to-beat RR-interval, and tall T waves (Record 106).
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128
125
output of HT, z[n] smooth SEE, s[n]
ECG, x[n]
1 0.5 0 0
5
10
0
5
10
5
10
5
10
(a)
15
20
25
15
20
25
15
20
25
15
20
25
0.8 0.6 0.4 0.2
(b)
0.5 0
−0.5 −1 0
(c)
Detected Peaks
1 0.5 0
0
time (sec) (d) Fig. 8. Detection performance for the ECG signal with wide premature ventricular contractions (PVCs), and small QRS complexes (Record 208). The method successfully detects low-amplitude QRS complexes and wide PVCs.
The waveform depicted in (d) shows the time instants of detected R-peaks using the proposed method. The detection performance for the ECG signal with the high sharp P-waves, negative polarities, and more noises is summarized in Table 2. Most of the R-peak detection methods have poor detection performance for the noisy records 104, 105, and 108. The proposed method has a total detec-
tion failure of 56 beats (44 FP beats and 12 FN beats). The digital filter-based method [8] and the EMD-based method [17] produced a total detection failure of 182 beats (106 FP beats and 76 FN beats), and of 147 beats (123 FP and 24 FN beats), respectively. For the noisy records, the detection performance of the proposed method is better than the existing methods, except the 3M filtering method [16]
ECG, x[n]
1 0.5 0 −0.5
output of HT, z[n] smooth SEE, s[n]
0
5
10
(a)
15
20
25
5
10
(b)
15
20
25
5
10
(c)
15
20
25
5
10
15
20
25
0.8 0.6 0.4 0.2 0
0.5 0
Detected Peaks
−0.5 −1 0 1 0.5 0 −0.5 0
time (sec) (d) Fig. 9. Detection performance for the ECG with different QRS morphologies, small QRS complexes and artifacts (Record 223).
126
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128
Detected Peaks
output of HT, z[n] smooth SEE, s[n]
ECG, x[n]
1 0.5 0 −0.5 0
5
10
0
5
10
(a)
15
20
25
15
20
25
15
20
25
15
20
25
0.8 0.6 0.4 0.2
(b)
0.5 0 −0.5 −1 0
5
10
5
10
(c)
1 0.5 0 −0.5 0
time (sec) (d) Fig. 10. Detection performance for the ECG signal with paced beats and severe muscle noise (Record 104).
with a total detection failure of 46 beats (24 FP beats and 22 FN beats). The numerous long pauses up to 6 s in duration are mainly found in record 232 that yields more false positive detections in most of the methods. The detection performance of the method for the RR-interval greater than 2 s is shown in Fig. 11. The method
has a failed detection of 18 FP beats. Fig. 8 shows the detection performance for the record 208 which has wide PVCs, and small QRS complexes. For this record, most of the filtering based methods had highest FN. To detect the missed ECG beats, many methods use a set of decision rules with adaptive thresholds estimated based
0.5 0 −0.5
output of HT, z[n] smooth SEE, s[n]
ECG, x[n]
1
0
5
10
(a)
15
20
25
0
5
10
(b)
15
20
25
5
10
(c)
15
20
25
0.8 0.6 0.4 0.2
0.5 0
Detected Peaks
−0.5 −1 0 1
FP
0.5
FP
FP
0 −0.5 0
5
10
15
20
25
time (sec) (d) Fig. 11. Detection performance for the ECG with noise and numerous long pauses up to 6 s in duration (Record 232). The method has the highest false positives for the ECG segment with long RR-intervals greater than 2 s.
ECG, x[n]
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128 1
very small QRS complexes
0
drift
−1 0
output of HT, z[n] smooth SEE, s[n]
127
5
10
(a)
15
20
25
0
5
10
(b)
15
20
25
0
5
10
(c)
15
20
25
15
20
25
0.8 0.6 0.4 0.2
1 0.5 0
Detected Peaks
−0.5
1
the number of FNs is high
0.5 0
FPs
−0.5 −1 0
5
10
time (sec) (d) Fig. 12. Detection performance for the ECG with severe baseline drift and very low-amplitude QRS complexes (Record 116). The method has higher false-negative (FN) detections similar to the other methods. The overall detection accuracy is better than the methods in [8,17,14,16].
on the information (amplitude, RR-interval and duration) of the previous detected R-peaks. The method with secondary threshold produces several spurious peaks. To reduce the number of false detections, the refractory period of 200 ms and T-wave discriminator (200–360 ms) are used in most of the methods. These additional decision rules may yield the poorest results in the case of ECG signal with irregular heart rhythm and continuously varying QRS complex morphology. Furthermore, these methods require the learning phase. The performance comparison in Table 2 shows that the proposed method produces 103 FP beats and 62 FN beats, which are
lower than that of the other methods reported in [8,17,14], and [16]. Various experiments demonstrate that the proposed method with simple HT-based peak-finding logic provides better detection performance without using any amplitude threshold in the decision stage to determine location of the R-peaks in ECG signal. In this work, we can observe that the proper decision rule provides much higher detection performance. Finally, the overall performance of proposed method is compared with six R-peak detectors reported in the literature. Based on the results of Table 3, an average accuracy of 99.80%, a sensitiv-
Table 3 R-peak detection performance comparison with other methods. Ref.
[8]
[9] [1]
Methodology
Se (%)
+P (%)
Acc (%)
Refractory (200 ms) and T-wave removal 200–360 ms for T-wave removal Refractory (200 ms)
248
340
99.69
99.77
99.46
447
467
99.57
99.59
99.17
153
220
99.80
99.86
99.66
None
None
214
1333
99.78
99.80
98.59
None
None
204
213
99.81
99.80
99.62
0.5 × pt
refractory (300 ms)
467
244
99.77
99.56
99.33
None
None
140
79
99.93
99.88
99.80
Secondary threshold
Blanking
Bandpass filter, derivative squarer and moving window integrator Bandpass filter, derivative and squarer Quadratic spline wavelet
Threshold coefficient × predicted peak value
0.3 × pt
Based on root mean square (RMS) of segment Four thresholds based on RMS value of the WT at the corresponding scales Threshold based on the SNR computed between wavelet coefficients at 1st and 5th level Threshold based on the maximum of the transformed ECG waveform Four thresholds based on modulus maxima and average of past values Hilbert transform-based peak-finding logic (no amplitude thresholds)
0.5 × pt
Coiflet wavelet, squaring and moving averaging
[16]
Multiscale morphology filtering, differentiation and multi-frame accumulation Empirical mode decomposition and denoising Bandpass filter, derivative Shannon energy and Smoothing
Our method
FN (beats)
Primary threshold, pt
[14]
[17]
FP (beats)
Preprocessing stage
Searchback thresholds
128
M.Sabarimalai Manikandan, K.P. Soman / Biomedical Signal Processing and Control 7 (2012) 118–128
ity of 99.93%, and a positive predictivity of 99.86% are obtained against the first-channel of the ECG recordings of the MIT-BIH arrhythmia database. The proposed method achieved significantly better performance than the other detection methods [7–17]. Based on the detection results, we concluded that the proper design of preprocessing and decision stages can improve the accuracy of detection of R peaks in ECG recordings with negative QRS polarities, low-amplitude R peaks, and wide PVCs, sudden changes in QRS amplitudes, sharp P and T waves, sudden changes in QRS morphologies, and irregular heart rhythm. The proposed method does not require additional decision rules with sets of thresholds based on the running estimates of the signal peaks and noise peaks, the average RR interval and rate limits, a set of tactics for blanking and T-wave discrimination, and training phase. 4. Conclusion In this paper, a novel, effective, and four-stage methodology has been developed for the automated detection of R-peaks in an ECG signal. The proposed preprocessor is based on a bandpass filter, first-order forward derivative, amplitude normalization, Shannon energy estimation and zero-phase filtering with rectangular impulse response that provides a smooth envelogram of the ECG signal. The decision stage is based on Hilbert transform and moving average filter, which is a new and simple strategy to determine the location of the R-wave peak. Experiments showed that the SE-based preprocessor significantly increases the detection accuracy for ECG recordings with low-amplitude, and wide QRS complexes. Also, the Hilbert transform-based peak-finding technique simplifies the determination of locations of the Rpeaks. This approach does not require any amplitude threshold and prior knowledge of the past detected R-peaks. The standard MIT-BIH arrhythmia database (48 ECG records of 30 min each) is used to test the effectiveness of the proposed method whose detection performance was measured in terms of the number of false positives, true positives and false negatives for each record. The detection results obtained are presented, discussed and compared with the existing R-peak detection methods. The method achieves average detection accuracy of 99.80%, a sensitivity of 99.93%, and a positive predictivity of 99.86%. Despite all these various morphologies of the QRS complexes and different kinds of noise and artifacts contained in the ECG signals of the database, the proposed method achieves much higher detection rates than those produced by the other existing methods. The average time required for processing each sample is about 3.45 s.
Acknowledgments The authors would like to thank Professor Robert Allen, Editorin-Chief, and the anonymous referees for their valuable suggestions and comments. References [1] J.P. Martínez, R. Almeida, S. Olmos, A.P. Rocha, P. Laguna, A wavelet-based ECG delineator: evaluation on standard databases, IEEE Trans. Biomed. Eng. 51 (4) (2004) 570–581. [2] Y. Gahi, M. Lamrani, A. Zoglat, M. Guennoun, B. Kapralos, K. El-Khatib, Biometric Identification System Based on Electrocardiogram Data, New Technologies, Mobility and Security, Tangier, 2008, pp. 1–5. [3] M.S. Manikandan, S. Dandapat, Wavelet threshold based TDL and TDR algorithms for real-time ECG signal compression, Biomed. Signal Process. Control 03 (2008) 44–66. [4] B.U. Kohler, C. Hennig, R. Orglmeister, The principles of software QRS detection, IEEE Eng. Med. Biol. Mag. 21 (2002) 42–57. [5] O. Pahlm, L. Sörnmo, Software QRS detection in ambulatory monitoring—a review, Med. Biol. Eng. Comput. 22 (1984) 289–297. [6] Y.-C. Yeha, W.-J. Wanga, QRS complexes detection for ECG signal: the difference operation method, Comput. Methods Prog. Biomed. 91 (2008) 245–254. [7] J. Pan, W.J. Tompkins, A real time QRS detection algorithm, IEEE Trans. Biomed. Eng. 32 (3) (1985) 230–236. [8] P.S. Hamilton, W.J. Tompkins, Quantitative investigation of QRS detection rules using the MIT/BIH arrhythmia database, IEEE Trans. Biomed. Eng. 33 (1986) 1157–1165. [9] N.M. Arzeno, Z.-D. Deng, C.-S. Poon, Analysis of first-derivative based QRS detection algorithms, IEEE Trans. Biomed. Eng. 55 (2) (2008) 478–484. [10] S. Benitez, P.A. Gaydecki, A. Zaidi, A.P. Fitzpatrick, The use of the Hilbert transform in ECG signal analysis, Comput. Biol. Med. 31 (2001) 399–406. [11] C. Meyer, J.F. Gavela, M. Harris, Combining algorithms in automatic detection of QRS complexes in ECG signals, IEEE Trans. Inf. Technol. Biomed. 10 (3) (2006) 468–475. [12] L. Romero, P.S. Addison, N. Grubb, R-wave detection using continuous wavelet modulus maxima, IEEE Proc. Comp. Cardiol. 30 (2003) 565–568. [13] F. Abdelliche, A. Charef, R-peak detection using a complex fractional wavelet, in: International Conference on Electrical and Electronics Engineering, Bursa, 2009, pp. 267–270. [14] M. Elgendi, M. Jonkman, F. De Boer, R wave detection using Coiflets wavelets, in: IEEE 35th Annual Northeast Bioengineering Conference, Boston, MA, 2009, pp. 1–2. [15] Y.L. Chen, H.L. Duan, A QRS complex detection algorithm based on mathematical morphology and envelope, in: Proceedings of the 27th Annual International Conference of the IEEE EMBS, Shanghai, China, 2005, pp. 4654–4657. [16] F. Zhang, Y. Lian, QRS detection based on multi-scale mathematical morphology for wearable ECG devices in body area networks, IEEE Trans. Biomed. Circuits Syst. 3 (4) (2009) 220–228. [17] X. Hongyan, H. Minsong, A new QRS detection algorithm based on empirical mode decomposition, in: Proceedings of the 2nd International Conference on Bioinformatics and Biomedical Engineering, 2008, pp. 693–696. [18] K.V. Suárez, J.C. Silva, Y. Berthoumieu, P. Gomis, M. Najim, ECG beat detection using a geometrical matching approach, IEEE Trans. Biomed. Eng. 54 (4) (2007) 485–489. [19] B. Abibullaev, H.D. Seo, A New QRS detection method using wavelets and artificial neural networks, J. Med. Syst. (2010), doi:10.1007/s10916-009-9405-3. [20] H. Liang, S. Lukkarinen, I. Hartimo, Heart sound segmentation algorithm based on heart sound envelogram, IEEE Proc. Comp. Cardiol. 24 (1997) 105–108.