Literature DB >> 31527502

Low Resource Complexity R-peak Detection Based on Triangle Template Matching and Moving Average Filter.

Tam Nguyen1, Xiaoli Qin2, Anh Dinh3, Francis Bui4.   

Abstract

A novel R-peak detection algorithm suitable for wearable electrocardiogram (ECG) devices is proposed with four objectives: robustness to noise, low latency processing, low resource complexity, and automatic tuning of parameters. The approach is a two-pronged algorithm comprising (1) triangle template matching to accentuate the slope information of the R-peaks and (2) a single moving average filter to define a dynamic threshold for peak detection. The proposed algorithm was validated on eight ECG public databases. The obtained results not only presented good accuracy, but also low resource complexity, all of which show great potential for detection R-peaks in ECG signals collected from wearable devices.

Entities:  

Keywords:  R-peak detection; electrocardiogram (ECG); low resource complexity; moving average filter; triangle template matching

Year:  2019        PMID: 31527502      PMCID: PMC6767021          DOI: 10.3390/s19183997

Source DB:  PubMed          Journal:  Sensors (Basel)        ISSN: 1424-8220            Impact factor:   3.576


1. Introduction

Electrocardiogram (ECG) signal is commonly used to diagnose heart disease. There are various studies and applications in this field. For example, in the work by the authors of [1], a method based on polygonal approximation was proposed to detect fiducial point of ECG QRS complex. This method has higher accuracy than other signal compression techniques, but requires more energy consumption. In the work by the authors of [2], the authors developed a single chip based wearable wireless ECG monitoring system. However, they did not implement further post-signal processing analysis. The automatic detection of R-peaks is considered a classic ECG signal processing problem and has been extensively investigated. Recently, there were several notable studies [3,4,5,6,7,8,9,10]. In the work by the authors of [3], the combination of wavelet transform, derivatives, Hilbert transform, and adaptive thresholding was proposed. This method can provide a high detection accuracy. Although this algorithm does not need to learn from previously detected R-peaks, it is complex and only validated on the MIT-BIH arrhythmia database, QT database and noise stress database. Two R-peak detection algorithms were proposed based on envelopment and K-mean clustering technique in the work by the authors of [4]. The first algorithm exhibits high level detection accuracy and is free of parameters, but can only be used off-line. A domino error effect can occur if the training process is not sufficient. In addition, most of these algorithms are only suitable for normal heartbeats. In the work by the authors of [5], the second-order Volterra filter and averaging filter were used to estimate the ECG envelope. One single threshold was used to define the interested block containing R-peaks. Only the MIT-BIH arrhythmia database was tested in this study. In addition, the computational complexity of this algorithm is high. Recently researchers focused on developing efficient detection algorithms suitable for wearable ECG devices. In the work by the authors of [6], one algorithm was proposed to detect R-peaks of real ECG signals measured by a proposed prototype, but only few public ECG signal databases were evaluated. In the work by the authors of [7], a simple real-time R-peak detector with low computational cost was proposed. Similar to many previous works, the authors of [7] customized input parameters of the algorithm for optimal performance on the MIT-BIH arrhythmia database [8], which may not be amenable to other databases. Moreover, it is not robust to noise. According to the comprehensive review by the authors of [9], Elgendi’s algorithm [10] was recently evaluated as the best algorithm to detect R-peaks in portable devices due to robustness to noise, parameter choice, and numerical efficiency. The Elgendi’s algorithm is based on a Butterworth band-pass filter, squaring, and two moving average filters. The optimal frequency band of the band-pass filter is 8 Hz to 20 Hz. After filtering, the signal is squared point by point to enhance large values and boost high-frequency components. Next, two moving average filters are used to generate blocks of interest that potentially contain R-peaks. The blocks of interest are found by comparing the differences between the outputs of two moving average filters in which the longer window is used to create a threshold. To increase the detection accuracy in a low signal-to-noise ratio ECG signal, the statistical mean of the input signal is used to generate an offset in the threshold. Finally, the location of the maximum of absolute values within each block of interest is considered as the R-peak. Although Elgendi’s algorithm is computationally efficient, it needs a global ECG record to calculate the threshold. This results in a latency dependent on the input signal length. One well-known real-time R-peak detection algorithm was proposed by Pan-Tompkins [11]. This classical algorithm can process and display the detection result for every sample after a learning period. However, the complexity of the Pan-Tompkins algorithm is high and the detection accuracy is moderate compared with Elgendi’s algorithm. For example, as described in the work by the authors of [10], the algorithm of the authors of [11] performed much worse than the algorithm of the authors of [10] on databases IAFDB and INCARTDB. In the work by the authors of [12,13], a triangle shape matching filter was developed using three samples of each side to distinguish R-peaks from T waves and P waves. The basis of this idea is the fact that the slope of R-peak is sharper than slopes of T wave and P wave. To detect R-peak, the vertex angle of the triangle shape is also used. Since the angles of the triangle are not uniform in polarity and magnitude, this method is also not robust to noise. Furthermore, in the works by the authors of [14,15], the triangle shape matching was applied to estimate the location of the QRS complex to design the low-pass filter for electromyogram (EMG) removal. In these studies, the triangle shape matching filter was not used directly for accurate R-peaks detection, but the template shows a great potential to estimate a block which contains QRS complex. In addition, the advantage of triangle shape matching is simple and can be processed sample-by-sample. In our work, the proposed algorithm is developed by combining triangle template matching [12,13,14,15] and moving average filter [10,16] for R-peaks detection, in order to address some shortcomings as mentioned above. Although triangle template matching can provide the location of the windows containing the QRS complex on a sample-by-sample basis, the moving average filter gives information on the R amplitude, which can be used for defining the dynamic threshold to detect R-peaks with high robustness to noise. The proposed work was evaluated with four objectives: robustness to noise, low latency processing, low resource complexity, and automatic tuning of parameters on eight public databases. Compared to other R-peak detection algorithms, the obtained results demonstrate that the method herein proposed exhibits improved performances with respect to all four objectives.

2. Materials and Methods

2.1. Training Data Set

The proposed R-peak detection algorithm was trained on the MIT-BIH arrhythmia database [8]. For each record of the database, independent cardiologists annotated all peaks. In this work, all non-beat annotations defined by Physionet are ignored. With this assumption, there are 109,494 annotated beats in this database. This number is consistent with the results of other studies [17,18,19,20,21,22,23,24,25]. To be consistent with other studies of R-peaks detection, quantitative comparisons in terms of sensitivity (S), positive predictivity (P), and detection error (DER), as defined in Equations (1)–(3), are studied. The true positive (TP) is defined as the number of QRS complexes detected as QRS complexes. False negative (FN) is the number of QRS complexes which have not been detected, and false positive (FP) is the number of non-QRS complexes detected as QRS complexes. The sensitivity represents the percentage of true beats that are correctly detected, whereas the percentage of detected true beats is presented by the positive predictivity. For the TP and FN calculations, the beat-by-beat comparison standard of the Association for the Advancement of Medical Instrumentation (AAMI) [26] is used.

2.2. Testing Data Set

Seven public databases were used for evaluating the proposed method: the Noise Stress Test database [27], the meta-data set QT Database [28], The Long-Term ST Database [29], the T-Wave Alternans Challenge Database [30], the MIT-BIH Supraventricular Arrhythmia Database [31], the MIT-BIH Normal Sinus Rhythm Database [32], and the MIT-BIH Atrial Fibrillation Database [33]. The sampling rate varied across the different databases; hence, a resampling procedure was applied with a common sampling rate of 360 Hz.

3. The Proposed R-Peak Detection Algorithm

The diagram of the proposed algorithm is shown in Figure 1. The method consists of six steps: high-pass filter, template matching, low-pass filter, threshold calculation, threshold comparison, and R-peak search. The high-pass filter can reduce the interference of baseline wander and T-wave. Template matching is achieved by the multiplication of the slopes of two adjacent segments of a sample. This step will enhance the R-peak height and also boost the amplitude of high frequency signals. As the template matching is a nonlinear operator that often generates high frequency noise, a low-pass filter is applied to remove such noise in the third step. In the next step, an averaging filter is designed to create a dynamic threshold. In the fifth step, candidate blocks of R-peak are established. Finally, the peak locations will be sought in candidate blocks.
Figure 1

The proposed algorithm structure, consisting of six steps.

Figure 2 shows the signals in time domain for each step in the proposed algorithm. Details of each module are described as follows.
Figure 2

Signals at different steps in the algorithm.

3.1. High-Pass Filter

The purpose of the high-pass filter is to eliminate the baseline wander caused by respiration, muscle contraction, and electrode impedance changes related to perspiration or movement. In addition, it can also reduce the T-waves in ECG signals. The analysis in the work by the authors of [11] shows that the power of P and T waves and motion artifacts concentrates in frequencies lower than 5 Hz. Therefore, a cut-off frequency higher than 5 Hz is typically selected. In this work, a simple high-pass filter based on a moving average [10,16] is designed. The filter used has the following form. where N defines the observation window length. The output of this filter can be written as The transfer function of the high-pass filter is expressed as In this filter, the cut-off frequency is specified by N. For a particular database or hardware device in which the sampling rate is known, the value of N can be determined by using the Algorithm 1 for window length selection. Since a low group delay is desirable, the first value of the window length (N) that satisfies the condition at line 10 in the Algorithm 1 is selected. For example, is selected to meet a cut-off frequency of 5 Hz for a signal with a sampling rate of 360Hz. To detect the negative QRS complex in ECG signal, the output of the filter is defined as

3.2. Triangle Template Matching

The goal of the triangle template matching is to rectify the differentiated ECG signals to amplify QRS complexes regardless of their polarity in the original input. Similar QRS detection techniques based on matched filters were studied in [34,35,36,37,38,39,40,41,42]. A QRS complex is created when the ventricles depolarize prior to their contraction [3]. In addition, the QRS complex has the largest amplitude and a sharp upward slope of any ECG signal. To accentuate the QRS complex, triangle template matching is defined as The output of Equation (9) determines the degree of matching between the triangular shapes of the ECG signal and the template. We assume that the shape of the QRS complex is nearly symmetric. To get a suitable R-peak enhancement for subsequent processing, the length of the window for the triangle template matching should be commensurate to the QRS complex width. Typically, the width of a QRS complex ranges from 80 ms to 120 ms. Accordingly, to achieve robustness, e.g., handling abnormal heart beats with large HRV, a 40 ms duration is chosen for the template window. With a particular sampling rate, the value of s in Equation (9) can be determined. For example, with a 360 Hz sampling rate, is typically selected. We retain the positive values of in Equation (9). High frequency noise (such as EMG) does not have a similar template to the QRS complex, so its response to the proposed matched filters should be smaller than that for the QRS complex. In other words, template matching also functions as a form of selective filter.

3.3. Low-Pass Filter

Ideally, the output of the triangle template matching should be locally maximized at R-peaks. Hence, the indices of the peaks of can be considered as potential R-peaks. However, also exhibits many noisy peaks. The reason is that the template matching is a nonlinear operator that may generate additional high frequency components. To reduce such noisy peaks, a subsequent low-pass filter is applied. In this work, a low-pass filter takes the form of The low-pass filter can also be written as So that the corresponding transfer function is expressed as The purpose of this low-pass filter is to retain the authentic potential R-peaks in . In the work by the authors of [43], the authors observed that the band-pass filter with a center frequency of 17 Hz is optimal for detecting QRS complexes. Thus, we assumed the frequency of the possible R-peaks in is between 5 and 35 Hz. In our case, with a sampling rate of 360 Hz and a cut-off frequency of 35 Hz, is typically selected.

3.4. Threshold Calculation

The idea of threshold calculation is inspired by the Elgendi’s algorithm [10]. In this work, the signal in Equation (10) plays a similar role to emphasize locations of QRS complexes. The candidate blocks containing R-peaks are generated by comparing the with a dynamic threshold : where and are defined coefficients, is an averaging filter constructed as The threshold in Equation (13) is similar to the first dynamic threshold value in Elgendi’s algorithm. It is used to find the QRS in one heartbeat. Therefore, the window length of the averaging filter in Equation (14) should approximate the duration of a heartbeat, which is of 360 samples (for a sampling frequency of 360 Hz). However, in practice, the heartbeat duration varies. The result of a brute force exhaustive optimizer to find the optimum, M, using the training data set is presented in Figure 3. It can be seen from Figure 3 that when M equals to 150, the lowest error rate was achieved.
Figure 3

Influence of window length of the dynamic threshold on the overall error rate based on brute force optimization with fixed and .

To enable a rapid R-peak search in candidate blocks, the interested block width should be small. Therefore, the coefficient is inserted into Equation (13). When is small, the width of the interested block is big. However the scale of does not have significant effects on the final performance. The experimental results show that its value can vary between 2 to 4 in many databases. In our work, we fix . The coefficient is also added in Equation (13) to reduce the number of false positive detection. There is a trade-off in the choice of in which larger values are more suitable for R-peak detection in noisy ECG signals. Meanwhile, a reasonable value must be maintained to detect a R-peak with small amplitude. Experiments show that could be one-fourth of the statistical mean of the output of the low-pass filter. The drawback of this calculation is that this method does not guarantee low latency. To address this issue, we proposed an iterative Equation (15) to get a dynamic threshold in low latency. In our work, the statistical mean of for the “training database” is used for parameters initialization. For this database, this value is ~824, thus . Finally, the threshold is calculated as

3.5. R-Peak Search

The actual R-peaks will be at the blocks of interest, where is higher than the threshold . The index of the maximum point of the search window is considered as the index of an R-peak. The experiment shows that the possible maximum width of the search window is half of the normal QRS complex width. As the value of can also be large at Q or S peaks, there are multiple detected points within one QRS complex as illustrated in Figure 4. With the reasonable assumption that the maximum heart rate is ~206 bpm [44], the distance between two continuous R-peaks cannot be smaller than 272 ms, so an error correction step is applied whenever two detected R-peaks are too close to each other. The detected R-peak of larger amplitude is retained, while the other one is eliminated. The pseudocode of the proposed R-peak search method is shown in Algorithm 2.
Figure 4

Multiple detected points in one QRS complex.

3.6. Computational Cost

The proposed algorithm was implemented in a desktop. The processing time of the algorithm is small compared with the input length duration. The comparison details will be presented in the processing time section. For readers potentially seeking to implement the algorithm on hardware devices, such as with FPGA technology, the computational resource costs are shown in Table 1. For comparison, the estimated computational resource costs of Elgendi’s algorithm and a recent novel template matching technique [41] are presented in Table 2 and Table 3.
Table 1

Computational resource cost of each step in the proposed algorithm.

StepEq.No.RegisterAdderMultiplierComparator
High pass filter6141
Triangle Match Filter9121
Low pass filter11121
Threshold Calculation13131
Threshold Cmp, R-peak search 1
Total 41141
Table 2

Computational resource cost of each step in Elgendi’s algorithm.

StepEq.No.RegisterAdderMultiplierComparator
Band pass filter 178
Squaring1 1
Averaging filter2&3262
Interested block4 2 1
Threshold 3 2
R-peak detection 1
Total 615114
Table 3

Computational resource cost of each step in Hu’s algorithm [41].

StepEq.No.RegisterAdderMultiplierComparator
Local normalization11 12
Straight line fitting2 6232
Angle calculation423
R-peak detection 12 2
Total 467334
Generally, the proposed algorithm exhibits lower computational resource cost than the recent matching technique and moving averaging filtering methods when counting the number of registers, adders, multipliers, or comparators used. This is because the triangle template matching and proposed iterative dynamic thresholding methods are applied. The QRS complexes are well rectified after using the triangle template matching, and the iterative dynamic threshold calculation is independent of the the window length. In contrast, Elgendi’s algorithm implemented averaging filtering twice and the calculation cost depends on the window length. Normally, the more operations of averaging filtering are taken, the higher computation resource cost will be.

3.7. Latency Cost

To initialize the proposed algorithm, input data is first buffered with 0.833 s (300 samples) to calculate the threshold in Equation (13). Then, the processed data is calculated sample-by-sample. In addition, the complexity of the algorithm is very small. Therefore, the total latency cost of the proposed method can be estimated as 0.833 s.

4. Results and Discussion

4.1. Selected Algorithms for Evaluating the Proposed Work

In this work, the performance of the proposed algorithm on many published databases is evaluated and compared against other two state-of-art methods: the Pan-Tompkins [11] and the Elgendi’s algorithm [10]. The Pan-Tompkins method represents the most well-known classical real-time R-peak detector, whereas the second algorithm was recently evaluated as the best algorithm to detect R-peaks in portable devices. It is noted that not all authors of previous studies presented complete details on how comparisons of annotated beats with their detected beats were performed. In this work, the standard of AAMI [26] is applied. The use of this standard is consistent with the work by the authors of [25].

4.2. Evaluating on the MIT-BIH Arrhythmia Database

Table 4 presents the performance of the proposed algorithm with its default parameters against all records. The average DER value is 0.49%. The proposed algorithm performs well on most records and their maximum DER is below 1.6%, except on three records, 207, 203, and 210. The error of the record 207 occurs due to the significant false positive errors during the flutter episodes. Physionet has considered record 207 as an extremely difficult record. According to the latest version of the annotations published in June 2010 by Physionet, there are 1860 beat annotations. In our work, only five beats were not detected. There are 472 ventricular flutter peaks in this record and the ventricular flutter peaks are considered as non-beat annotations. The proposed algorithm detects a number of ventricular flutter peaks in this record. That is why there are significant false positive errors. However, some previous works, such as the work by the authors of [10], excluded episodes of ventricular flutter beats in their ground truth.
Table 4

Performance Evaluation of the proposed algorithm for the MIT-BIH Arrhythmia Database.

RecordTotalTPFNFPS(%)P(%)DER(%)
1002273227300100.00100.000.00
101186518641499.9599.790.27
102218721861099.95100.000.05
1032084208400100.00100.000.00
1042229222721399.9199.420.67
1052572256392299.6599.151.21
1062027202703100.0099.850.15
107213721361099.95100.000.05
10817631750131499.2699.211.53
109253225302199.9299.960.12
111212421231199.9599.950.09
1122539253901100.0099.960.04
1131795179500100.00100.000.00
114187918754599.7999.730.48
1151953195300100.00100.000.00
1162412239616299.3499.920.75
1171535153500100.00100.000.00
1182278227801100.0099.730.48
1191987198701100.0099.950.05
121186318612199.8999.950.16
122247624751199.9699.960.08
1231518151800100.00100.000.00
1241619161902100.0099.980.12
200260126001699.9699.770.27
201196319549099.54100.000.46
202213621342099.91100.000.09
20329802924562898.1298.122.82
205265626506099.77100.000.23
20718621857517299.7391.519.52
2082955294411299.6399.630.44
2093005300500100.00100.000.00
2102651258170197.3699.962.68
2122748274800100.00100.000.00
2133251325100100.00100.000.00
214226322612199.9199.960.13
215336533632099.94100.000.06
2172208220800100.00100.000.00
2192158215401100.0099.950.05
2202048204800100.00100.000.00
2212427242701100.0099.960.04
222248324803299.8899.920.20
2232605260501100.0099.960.04
2282056205421999.9099.081.02
2302256225600100.00100.000.00
2311571157100100.0098.991.02
2321780178005100.0099.720.28
2333079307900100.00100.000.00
2342753275300100.00100.000.00
Total10949410927022431499.8099.710.49
In record 210, the average heartbeat is about 240 samples. The corresponding optimal value of parameter M in Equation (14) should be 120. Since the default M value of 150 was used, the obtained performance was suboptimal. In record 203, sudden amplitude changes of some beat pulses led to misdetection in our work.

4.3. Evaluating with Other Public Data

For further evaluation, performance comparisons between the proposed method and the other two selected well-known methods for different databases were evaluated on seven public databases. The results are shown in Table 5. It can be seen from Table 5 that the proposed algorithm performs better in terms of DER. This indicates that the proposed algorithm also can work well with different typical clinical ECG signals.
Table 5

Performance comparison between the proposed method and other state-of-art methods.(*) The results from our implementation and beat-by-beat comparison using AAMI standard [26].

DatabaseMethodYearTotal BeatsS(%)P(%)DER(%)
MITDB This work 10949499.8099.710.49
Elgendi’s algorithm (*)201310949499.8999.480.63
Elgendi’s algorithm [10] 10998599.7899.87N/A
Pan-Tompkins’s algorithm [11]198610949499.2099.081.72
NSTDB [27]This work 2559097.1295.037.95
Elgendi’s algorithm (*)20132559098.8089.5412.73
Elgendi’s algorithm [10] 2637095.3990.25N/A
Pan-Tompkins’s algorithm [11]19862559099.0687.9514.51
QTDB [28]This work 8535399.9499.780.29
Elgendi’s algorithm (*)20138535399.7699.420.82
Elgendi’s algorithm [10] 11120199.9999.67N/A
Pan-Tompkins’s algorithm [11]19868535399.6098.352.07
LSTDB [29]This work 7618199.9299.700.98
Elgendi’s algorithm (*)20137618199.4299.701.27
Pan-Tompkins’s algorithm [11]19867618191.7898.953.3
TWADB [30]This work 1900399.0199.141.10
Xiao Hu’s algorithm [41]2014796811001000
Elgendi’s algorithm (*)20131900397.2199.541.31
Elgendi’s algorithm [10] 1900398.8899.12N/A
Pan-Tompkins’s algorithm [11]19861900388.3294.0418.23
SVDB [31]This work 18249999.9099.80.6
Elgendi’s algorithm (*)201318249999.8599.700.8
Elgendi’s algorithm [10] 18474499.9699.80N/A
Pan-Tompkins’s algorithm [11]198618249999.8699.560.57
NSRDB [32]This work 183092100.0099.960.5
Elgendi’s algorithm (*)201318309299.8299.600.7
Elgendi’s algorithm [10] 18309299.9999.96N/A
Pan-Tompkins’s algorithm [11]198618309299.9199.970.60
LAFDB [33]This work 670599.5996.118.5
Elgendi’s algorithm (*)2013670599.4993.119.6
Elgendi’s algorithm [10] 761899.5994.11N/A
Pan-Tompkins’s algorithm [11]1986670564.2199.0114.56

4.4. Evaluating the Robustness to Noise of R-peak Detection Algorithms

In the MIT-BIH arrhythmia database, there are many records, such as 121, 202, 200, 217, 105, and 108, that are strongly affected by noise including baseline wander and muscle noise. These records were used to evaluate the robustness to noise in some previous works [5,25]. Table 6 shows comparisons of the DER values of the proposed method with the other nine studies. The biggest DER value in each column is in bold. It can be seen from Table 6 that the DER value of the proposed algorithm is comparable with previous works in the same records, which are contaminated heavily by noise.
Table 6

Comparisons of the DER from the proposed method with other studies for ECG records 121, 200, 202, 217, 105, and 108.

MethodsYearRecord
121202200217105108
This work 0.160.090.350.091.211.53
Quadratic filtering [5]20150.000.000.190.271.594.08
Wavelet transform [25]20140.100.090.300.230.81 8.4
Elgendi’s algorithm [10]20130.110.190.230.18 1.87 1.59
Linear filtering [45]20130.110.090.150.091.250.57
S-transform [46]20100.160.090.230.231.242.44
Artificial neural network [39]20140.160.330.31 0.64 0.230.51
Mathematical morphology [47]2009 0.70 0.37 0.500.231.010.68
Adaptive Mathematical morphology [48]20160.110.090.190.451.441.13
Four QRS waveform templates [49]20170.110.19 0.73 0.141.612.4

4.5. Comparing Performance Between the Proposed and Elgendi’s Algorithms in Some Specific Signals

4.5.1. Record 109 of the MIT-BIH Arrhythmia Database

Elgendi’s algorithm took a band-pass filter to concentrate QRS complexes with the cut-off band of 8–20 Hz. With this filter, the baseline wander and high frequencies are almost removed. However, previous studies showed that the power of QRS complex is concentrated in the band of 5 Hz–35 Hz. Thus, a small cut-off band can lead to the distortion of the sharpness of the R-peak. Consequently, some locations of R-peaks detected by Elgendi’s algorithm are not correct. It should be noted that this type of error is not reflected directly in those quantitative metrics due to the false detection is very close to the ground truth. Figure 5a shows the detected R-peaks of the proposed work and Elgendi’s algorithm for the signal of record 109 from sample number 200 to 2000.
Figure 5

Results of the proposed algorithm and Elgendi’s algorithm on record 109 and 113.

4.5.2. Record 113 of the MIT-BIH Arrhythmia Database

Record 113 does not have much noise, but P-peaks in this record have high amplitudes. These P-peaks result in outputs of the first moving average filter in Elgendi’s algorithm that may be bigger than the first threshold. Moreover, widths of these P-peaks are also larger, which means the second threshold of Elgendi’s algorithm does not help eliminate the false “block of interest”. The error rate of Elgendi’s method on record 113 is 5.52%, and most peaks are false positive detected. As the slope of the P-peaks is always smaller than the slope of the R-peak, the triangle template matching of our proposed method can amplify the difference between R-peak and P-peak. In addition, the “error correction” step also provides an advantage in canceling “wrong detected R-peaks”. Figure 5b shows the detected R-peaks by the two methods for the samples 2000 to 4000 from record 113.

4.6. Processing Time

In Table 2, the total computational resource cost of the proposed algorithm was presented. In this section, we compared the processing time of each method. The chosen methods were implemented in MATLAB version 2015b on a desktop of CPU 3.2 GHz, 8 GB RAM. Table 7 shows the comparison results on average computational time over 10 trials in processing the MIT-BIH arrhythmia database.
Table 7

Comparison of processing time for NSRDB of Elgendi’s Algorithm and the proposed work running on MATLAB.

MethodsError Rate (%)Processing Time(Second)
Pan-Tompkin’s algorithm1.72101.54
Elgendi’s algorithm0.6940.99
Proposed algorithm0.497.62
As data shown in Table 7, the proposed method runs faster than the two state-of-art algorithms even with a better accuracy for a huge potential in real-time applications.

4.7. Parameters Setting

There are only six parameters in our work and their value can be tweaked according to different databases. The window size of the high-pass filter, parameter in Equation (4); triangle template matching, parameter s in Equation (9); and low-pass filter parameter in Equation (10) can be determined automatically when a sampling rate is known. The size of the moving average filter parameter in Equation (15) used to define the threshold depends on the heart rate, and it is hard to be predicted. Our approach is to estimate it by using a normal heart rate. The coefficient in Equation (13) is fixed to 2.5. In fact, the value of this parameter does not strongly affect final performance. The coefficient in Equation (13) depends on the amplitude of the R-peak, and it is also difficult to predict its value in an efficient way. The proposed method takes one-fourth of the statistic mean of the outputs from low-pass filter. In addition, we took the default value trained from the MIT-BIH database and tested on other seven databases, results showed that the default value is applicable for many databases with good performance.

5. Conclusions

The proposed method is based on a triangle template matching and moving average filter and aimed to tackle common challenges in the detection of R-peaks in ECG signals. The results show that the proposed algorithm performs better compared to previous works in trading off four objectives: robustness to noise, low latency processing, low resource complexity, and automatic tuning of parameters. The previously published algorithms are mostly computationally complicated and require impractical assumptions, e.g., they typically need global statistical knowledge of the entire input signal. In contrast, the proposed algorithm not only exhibits low complexity, but also, even with default parameters, it is already highly competitive against the classical Pan-Tompkins’ and the well-praised Elgendi’s algorithm for many publicly available ECG databases. In addition, for additional performance gains, including optimization in a new or customized application scenario, the parameter tuning process is also straightforward, at the expense of a modest increase in latency complexity. Altogether, these desirable characteristics reinforce the practical feasibility of the proposed method for wearable mobile applications. One disadvantage of the proposed work is that the value of M in Equation (15) is fixed. This value should be updated with the real heart rate to have the best performance. One possible alternative solution is to have a learning phase to estimate the real heart rate. However, noisy ECG signals often result in a poor estimation of the real heart rate during the learning phase. Given this challenge, the learning phase should be long enough to overcome it, but at the expense of an increase in latency.
  22 in total

1.  PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals.

Authors:  A L Goldberger; L A Amaral; L Glass; J M Hausdorff; P C Ivanov; R G Mark; J E Mietus; G B Moody; C K Peng; H E Stanley
Journal:  Circulation       Date:  2000-06-13       Impact factor: 29.690

2.  The impact of the MIT-BIH arrhythmia database.

Authors:  G B Moody; R G Mark
Journal:  IEEE Eng Med Biol Mag       Date:  2001 May-Jun

3.  QRS detection based on wavelet coefficients.

Authors:  Zahia Zidelmal; Ahmed Amirou; Mourad Adnane; Adel Belouchrani
Journal:  Comput Methods Programs Biomed       Date:  2012-01-31       Impact factor: 5.428

4.  Smart ECG Monitoring Patch with Built-in R-Peak Detection for Long-Term HRV Analysis.

Authors:  W K Lee; H Yoon; K S Park
Journal:  Ann Biomed Eng       Date:  2015-11-11       Impact factor: 3.934

5.  A real-time microprocessor QRS detector system with a 1-ms timing accuracy for the measurement of ambulatory HRV.

Authors:  A Ruha; S Sallinen; S Nissilä
Journal:  IEEE Trans Biomed Eng       Date:  1997-03       Impact factor: 4.538

6.  Envelopment filter and K-means for the detection of QRS waveforms in electrocardiogram.

Authors:  Manuel Merino; Isabel María Gómez; Alberto J Molina
Journal:  Med Eng Phys       Date:  2015-04-23       Impact factor: 2.242

7.  Real-time electrocardiogram P-QRS-T detection-delineation algorithm based on quality-supported analysis of characteristic templates.

Authors:  Atiyeh Karimipour; Mohammad Reza Homaeinezhad
Journal:  Comput Biol Med       Date:  2014-07-11       Impact factor: 4.589

8.  The PhysioNet / Computers in Cardiology Challenge 2008: T-Wave Alternans.

Authors:  Gb Moody
Journal:  Comput Cardiol       Date:  2008

9.  A telesurveillance system with automatic electrocardiogram interpretation based on support vector machine and rule-based processing.

Authors:  Te-Wei Ho; Chen-Wei Huang; Ching-Miao Lin; Feipei Lai; Jian-Jiun Ding; Yi-Lwun Ho; Chi-Sheng Hung
Journal:  JMIR Med Inform       Date:  2015-05-07

10.  A QRS Detection and R Point Recognition Method for Wearable Single-Lead ECG Devices.

Authors:  Chieh-Li Chen; Chun-Te Chuang
Journal:  Sensors (Basel)       Date:  2017-08-26       Impact factor: 3.576

View more

北京卡尤迪生物科技股份有限公司 © 2022-2023.