Next Article in Journal
The Study on the Cultivable Microbiome of the Aquatic Fern Azolla Filiculoides L. as New Source of Beneficial Microorganisms
Next Article in Special Issue
Reconstruction of PC Display from Common-Mode Noise Emitting on Electrical Power Line
Previous Article in Journal
Reflection Enhancement and Giant Lateral Shift in Defective Photonic Crystals with Graphene
Previous Article in Special Issue
Particle Swarm Optimization and Cuckoo Search-Based Approaches for Quadrotor Control and Trajectory Tracking
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Novel Wavelet-Based Algorithm for Detection of QRS Complex

1
Department of Electrical Engineering, National Chin-Yi University of Technology, Taichung 411, Taiwan
2
Heart Center, Cheng Hsin General Hospital, Taipei 112, Taiwan
3
Faculty of Medicine, School of Medicine, National Yang Ming University, Taipei 112, Taiwan
*
Author to whom correspondence should be addressed.
Appl. Sci. 2019, 9(10), 2142; https://doi.org/10.3390/app9102142
Submission received: 22 April 2019 / Revised: 16 May 2019 / Accepted: 23 May 2019 / Published: 26 May 2019
(This article belongs to the Special Issue Applied Sciences Based on and Related to Computer and Control)

Abstract

:
Accurate QRS detection is an important first step for almost all automatic electrocardiogram (ECG) analyzing systems. However, QRS detection is difficult, not only because of the wide variety of ECG waveforms but also because of the interferences caused by various types of noise. This study proposes an improved QRS complex detection algorithm based on a four-level biorthogonal spline wavelet transform. A noise evaluation method is proposed to quantify the noise amount and to select a lower-noise wavelet detail signal instead of removing high-frequency components in the preprocessing stage. The QRS peaks can be detected by the extremum pairs in the selected wavelet detail signal and the proposed decision rules. The results show the high accuracy of the proposed algorithm, which achieves a 0.25% detection error rate, 99.84% sensitivity, and 99.92% positive prediction value, evaluated using the MIT-BIT arrhythmia database. The proposed algorithm improves the accuracy of QRS detection in comparison with several wavelet-based and non-wavelet-based approaches.

1. Introduction

The signal processing and analysis of the electrocardiogram (ECG) is an important and noninvasive tool for identifying abnormal heart function. The QRS complex associated with the ventricular contractions is the most significant signal within an ECG cycle. The accurate detection of QRS is a crucial issue for an automatic ECG analysis system. Though a typical ECG waveform consists of P, Q, R, S, and T waves, the measured ECG may have different waveforms due to abnormal rhythms, and its waveform is also easily contaminated by several noise sources, such as 50 or 60 Hz power line noises, muscle contractions, baseline drift, and motion artifacts. A wide variety of ECG waveforms make it difficult to detect QRS accurately.
Previous studies have proposed numerous QRS detection methods, which can be divided into two stages: The ECG signal preprocessing and QRS peak decision. The purpose of the ECG signal preprocessing is to remove the low-frequency baseline drift and high-frequency noise. Many previous studies have designed linear or non-linear filters to remove additive noise and interferences, such as moving averaging filters [1], low-pass filters [2], bandpass filters [2,3,4,5], non-linear filters [6], quadratic filters [7], and Savitzky–Golay (SG) smoothing filters [8]. The methods for noise removal based on the wavelet transform have also appeared in the previous works by removing part of the approximation and detail wavelet coefficients to filter out high frequency noise and baseline drift effects, respectively [9,10,11,12,13,14]. Other studies have proposed noise removal methods based on mathematical morphology [15] and artificial neural networks [16].
The QRS peak decision is to find the position of the most prominent peak within a QRS complex. The real time detection of QRS peaks proposed by Christov [1] is based on a comparison of the absolute values of the summed differentiated ECG signals and the adaptive threshold. The threshold combines three parameters: An adaptive slew-rate value, a second value which rises when high-frequency noise occurs, and a third one intended to avoid missing low amplitude beats. Manikandana and Soman [3] developed an R-peak detector based on the Shannon energy envelope (SEE) estimator. Their method is better at detecting R-peaks in the case of wider and small QRS complexes, negative QRS polarities, and sudden changes in QRS amplitudes. The approach proposed by Karimipour and Homaeinezhad [11] used the first-order derivative of the ECG signal and combined adaptive threshold. The detection and delineation of P- and T-waves were achieved by a correlation analysis conducted between signals and their templates. Castells-Rufas and Carrabina [6] designed a simple real-time QRS detector using the MaMeMi (Maximum Mean Minimum) filter, which can detect the QRS signal in a simple way with minimal computational cost and resource needs using a non-linear filter. The MaMeMi filter is a high-pass non-linear filter which can effectively remove the baseline drift and also reduce the effect of the T wave. Phukpattaranont [7] developed a QRS detection algorithm based on the quadratic filter which can enhance the QRS-to-noise ratio and then allow us to use a single fixed threshold to detect the QRS. Farashi [13] proposed a method based on the analysis of multiresolution time-dependent entropy. It calculates the entropy of the ECG signal at different temporal resolutions and can improve the accuracy for the detection of various QRS morphologies. The decision rule proposed by Sharma and Sunkaria [8] is based on the root-mean-square of the signal. Their techniques include a novel approach for isoelectric line detection and a kurtosis-based false positive correction method. Yazdani and Vesin [17] proposed an adaptive mathematical morphology scheme for extracting QRS complexes and fiducial points. An adaptive structuring element in mathematical morphology operators is updated after the detection of each heartbeat for a more robust and precise detection. Chen and Chuang [5] developed an R-peak recognition method for wearable single-lead ECG devices. An ECG signal transformation was proposed to enhance QRS segments and restrain P and T waves. The QRS fiducial point is determined based on the detected crests and troughs of the transformed signal, and the R point can be recognized based on four QRS waveform templates.
Moreover, several studies have proposed wavelet-based methods for the detection of QRS peaks. Merah et al. [12] proposed an R-peaks detection method based on a stationary wavelet transform (SWT). Their algorithm used the information of local maxima, minima, and zero crossings of the fourth level detail coefficients to identify the significant points for detection and delineation of the QRS complexes, as well as the detection and identification of the QRS individual wave peaks. Berwal et al. [14] introduced a QRS complex detector based on a biorthogonal spline wavelet transform for wearable healthcare devices. The wavelet detail coefficients of the third and fourth levels are multiplied using the Booth multiplier, and a soft threshold method is applied to get the QRS peaks by the QRS peak detector block. The method proposed by Zidelmal et al. [18] used the product of the wavelet detail coefficients of the fourth and fifth levels to localize QRS complexes after a preliminary investigation of QRS spectral parameters. Bouaziz et al. [19] developed a method based on the power spectrum of the combination of the wavelet detail coefficients at the fourth and fifth levels. A moving window with specific width (160 ms) is used to investigate the positions of the maximum amplitude points in each window location, defining the QRS complex positions.
All of the above-mentioned techniques have demonstrated their superiority in the detection of QRS peaks. However, if we consider the requirements of hardware complexity and detection accuracy together, wavelet-based approaches can play a trade-off role [14,20]. Providing a noise-free ECG signal is important for the QRS peak decision. However, noise is usually broadband and overlaps with the QRS complex. It is not easy to accurately separate the noise from the ECG signal without destroying the QRS waveform. The pre-filtering out of the high-frequency components not only reduces the noise level but also causes a reduction in the amplitudes of the QRS peaks and thus reduces their the detection accuracy. This study therefore proposes a novel wavelet-based algorithm for the detection of QRS complex peaks. A four-level biorthogonal spline wavelet transform is introduced for the decomposition of ECG signals. The wavelet detail signals of the second, third, and fourth levels are employed in the proposed QRS peak detection algorithm. A noise evaluation method is proposed to quantify the amount of noise and to select a lower-noise signal between the third and fourth wavelet detail signals for detection of QRS peaks instead of pre-filtering out the high-frequency noise in the preprocessing stage.
The rest of this paper is organized as follows. Section 2 describes the ECG recordings obtained from the MIT-BIH arrhythmia database. Section 3 presents the proposed wavelet-based algorithm for detection of the QRS complex peaks. Results and discussion are given in Section 4. Finally, Section 5 concludes this study.

2. ECG Recordings

All of the ECG data used in this study were obtained from the MIT-BIH arrhythmia database [21], which contains common and life-threatening arrhythmic heartbeats. This database contains 48 recordings of two-channel ambulatory ECG recordings with a length of 30 min, a sampling frequency of 360 Hz, and 11-bit resolution over a 10 mV range. In most recordings, the upper lead is a modified limb lead II (MLII), and the lower lead is usually a modified lead V1 (occasionally V2 or V5, and in one instance V4). Each recording was independently annotated by two or more cardiologists. There are a total of 109,488 beats included in this study that were annotated as one of 15 possible heartbeat classes.

3. Methodology

Figure 1 is a block diagram of the proposed wavelet-based algorithm for the detection of the QRS complex. The purpose of the signal preprocessing is to segment the ECG recording and remove the baseline drift. The proposed wavelet-based algorithm includes signal preprocessing, a four-level dyadic wavelet transform, a search of candidate extreme points, a determination of candidate extremum pairs, an evaluation of noise, a calculation of candidate QRS peak positions, and a determination of QRS Peaks. The details are described in the following sections.

3.1. Signal Preprocessing

Each ECG recording was segmented by a sliding window of 4096 samples. Figure 2 illustrates the segmentation of the ECG recording. There is an overlap of 150 samples between two adjacent windows. The design of the 150-sample overlap is for those incomplete QRS complexes located at the end of the 4096-sample segments, which would be misidentified as Not QRS peaks. They can be completely included in the beginning of the next 4096-sample segment because of the overlap of 150 samples. Two median filters were then applied to remove the low-frequency baseline drift [22]. Each ECG segment was first filtered by a median filter with a width of 200 ms (i.e., 72 samples at a sampling rate of 360 Hz) to remove the QRS and P waves; each segment was then filtered by a median filter with a width of 600 ms to remove the T waves. Hence, the baseline drift signal can be extracted by the output of the second median filter, and the baseline drift eliminated ECG recording can be obtained by subtracting the estimated baseline drift from the original ECG signal. Figure 3 shows the illustration of removing the low-frequency baseline drift, where the original ECG is the input signal, M1 and M2 are the outputs of the first and second median filters, respectively, and the filtered ECG is the baseline drift eliminated ECG. It is shown that most of the baseline drift can be removed. The high frequency components of the QRS wave were not pre-filtered out in the preprocessing stage.

3.2. Four-Level Dyadic Wavelet Transform

The dyadic wavelet transform was applied in this study to decompose ECG signals into different frequency bands for detection of QRS peaks. The dyadic wavelet transform for a continuous signal x(t) is defined as follows:
W x ( u , 2 j ) = + x ( t ) 1 2 j ψ ( t u 2 j ) d t
where u and 2 j denote the translation and dyadic scaling parameters, respectively. The selected prototype wavelet ψ ( t ) is a biorthogonal spline which has been applied to ECG signals in a previous study [14]. Biorthogonal wavelets built with splines are especially attractive because of their short support and regularity [23]. The corresponding low-pass filter H ( z ) and high-pass filter G ( z ) of the biorthogonal spline wavelet are given as follows [14]:
H ( z ) = ( 1 + 3 z 1 + 3 z 2 + z 3 ) / 4
G ( z ) = ( 1 3 z 1 + 3 z 2 + z 3 ) / 4
which have the following impulse responses:
h ( n ) = 1 4 + 3 4 δ ( n 1 ) + 3 4 δ ( n 2 ) + 1 4 δ ( n 3 )
g ( n ) = 1 4 + 3 4 δ ( n 1 ) + 3 4 δ ( n 2 ) + 1 4 δ ( n 3 )
The four-level dyadic wavelet transform in this study was implemented by the Mallat algorithm [24], as shown in Figure 4, which uses a two-channel filter bank to decompose ECG signals by the low-pass filter H ( z ) and high-pass filter G ( z ) . a1, a2, a3, and a4 denote the low-frequency approximation signals of the first, second, third, and fourth levels, respectively, and d1, d2, d3, and d4 are the high-frequency detail signals of different levels. Figure 5 demonstrates several common QRS waves and their high-frequency detail signals d1, d2, d3, and d4, where N, V, L, and Q denote normal beat, ventricular premature contraction beat (VPC), left bundle branch block beat, and unclassifiable beat, respectively. Figure 6 further plots the extreme detail signals, including only the extreme values of the wavelet detail signals, named d1’, d2’, d3’, and d4’ according to d1, d2, d3, and d4 in Figure 5, respectively. It can be observed that the rising and falling segments of a QRS peak produce a negative and a positive extreme point, respectively, indicated by arrows. The pair of a negative and a positive extreme point is defined as an extremum pair in the study. The sharper the QRS peak, the larger the extreme value produced. Hence, we can detect the QRS peak by finding the largest extremum pair in the wavelet detail signals. The frequency ranges of the wavelet detail signals for d1, d2, d3, and d4 are from 90 Hz to 180 Hz, from 45 Hz to 90 Hz, from 22.5 Hz to 45Hz, and from 11.25 Hz to 22.5 Hz, respectively. Usually, the frequency range of the QRS complex wave is from 10 to 45 Hz [14]. Hence, the detection of QRS peaks in this study is mainly based on the extreme detail signals of the third or fourth level, d3’ or d4’, according to the evaluation of noise amount. The d2’ helps in identifying P- or T-peaks.

3.3. Search of Candidate Extreme Points

Based on the wavelet detail signals, d2, d3, and d4, the following steps are developed for searching the candidate extreme points.
Step 1: Find the extreme detail signals, d2’, d3’, and d4’, consisting of all the positive or negative extreme points which have sudden changes in slope in d2, d3, and d4, respectively.
Step 2: Divide the extreme detail signals with a length of 4096 samples into four subsections with lengths of 1024 samples and then calculate the positive and negative thresholds, T H + and T H , respectively, as follows.
T H + = 1 4 × ( M M a x , 1 + M M a x , 2 + M M a x , 3 + M M a x , 4 ) 4
T H = 1 4 × ( M M i n , 1 + M M i n , 2 + M M i n , 3 + M M i n , 4 ) 4
where M M a x , i and M M i n ,   i , i = 1 ,   2 ,   3 ,   4 , denote the largest values of the positive extreme points and the smallest values of the negative extreme points for the four subsections. Each subsection is about 2.84 s at a sampling rate of 360 Hz and, hence, can at least include one QRS peak if the heartrate is greater than 21 bps. Before the detection of QRS peaks, it is easy to find the largest and smallest values of the extreme points produced by the QRS peaks in each subsection. The thresholds are defined by one fourth of the average values of four extreme values. The use of four extreme values is to avoid the thresholds being dominated by an extreme value that is too large or too small.
Step 3: Search the candidate extreme points with values larger than the positive threshold, T H + , or smaller than the negative threshold, T H . A too-large positive or a too-small negative threshold may lose the extreme points produced by the true QRS peaks with smaller amplitudes. On the contrary, a too-small positive or a too-large negative threshold may include the extreme points produced by the noise peaks. The proposed T H + and T H are a compromise of the two.

3.4. Determination of Candidate Extremum Pairs

Figure 7 illustrates an extremum pair that is produced by a QRS peak in d3’. It includes a positive and a negative extreme point. Let the coordinates of the first and second extreme points, M1 and M2, be ( x 1 ,   y 1 ) and ( x 2 ,   y 2 ) , respectively. A candidate extremum pair corresponding to a possible QRS peak should meet the following conditions.
Condition 1: An extremum pair consists of a positive extreme point followed by a negative extreme point or a negative one followed by a positive one. This condition makes an extremum pair represent a positive or negative peak in the QRS wave.
Condition 2: The positive and negative extreme values, y 1 and y 2 , of a candidate extremum pair are larger and smaller than the positive and negative thresholds defined in Equations (6) and (7), respectively. This condition makes a candidate extremum pair represent a peak with a large enough amplitude in the QRS wave.
Condition 3: The distance between the first and second extreme points of a candidate extremum pair, x 2 x 1 , is less than 45 samples. This condition makes a candidate extremum pair represent a sharp enough peak in the QRS wave. This distance ranges from about 5 to 20 samples for narrower R waves produced by normal, paced, atrial premature beats, etc., and ranges from about 21 to 44 samples for wider R waves mostly produced by ventricular premature contraction beats.
According to the above three conditions, we can determine the candidate extremum pairs in d2’, d3’, and d4’.

3.5. Evaluation of Noise Amount

The detection of QRS peaks in this study is based on the candidate extremum pairs in d3’ or d4’ to find the positions of the corresponding candidate QRS peaks in the original ECG signal and to further identify the true QRS peaks. The selection of d3’ or d4’ is based on their noise amount. A noise evaluation method is proposed to quantify the amount of noise in d3’ and d4’. We remove the extreme points which are greater than or smaller than 1.6 times the positive or negative thresholds in d3’ and d4’. These removed extreme points represent the components possibly contributed by the QRS peaks, not by the noise. The remaining extreme points are applied to evaluate the amount of noise, which is defined as the sum of the square values of the remaining extreme points. If the noise amount in d3’ is smaller than that in d4’, the detection of QRS peaks is based on d3’; otherwise it is based on d4’.

3.6. Calculation of the Positions of the Candidate QRS Peaks in the Time-Domain

According to the candidate extremum pairs in d3’ or d4’, we define the following equation to calculate the positions of the corresponding candidate QRS peaks in the original ECG signal:
x p = x 1 | y 2 | | y 1 | + | y 2 | + x 2 | y 1 | | y 1 | + | y 2 | β
where β denotes the time delay produced by the filtering of the wavelet filter banks. The values of β in d3’ and d4’ are 9 and 12 samples, respectively. If | y 1 | = | y 2 | , x p is located in the middle of x 1 and x 2 , then subtract β . If | y 1 | > | y 2 | . If x p is closer to x 2 , then subtract β . If | y 1 | < | y 2 | , x p is closer to x 1 , then subtract β .

3.7. Identification of QRS Peaks

Because it is possible that multiple candidate QRS peaks present within the same QRS complex and the candidate QRS peaks also include sharp P- and T-peaks, we propose the following decision rules to identify the most prominent QRS peak. The distance thresholds of 130 and 100 samples to define the following Cases 1, 2, and 3 are determined by pre-analyzing the relationships between the positions of all candidate QRS peaks and true QRS peaks annotated by the MIT-BIH arrhythmia database.
Case 1: The distance between the current candidate QRS peak and the previous QRS peak is greater than 130 samples. In this case, it is considered that the current candidate QRS peak is far enough from the previous QRS peak and, hence, is identified as a new QRS peak. This identified QRS peak may also be replaced by the next candidate QRS peak, according to the following Cases, 2.3 and 3.
Case 2: The distance between the current candidate QRS peak and the previous QRS peak is greater than 100 samples and less than 130 samples. In this case, it is considered that the current candidate QRS peak may be a new peak or a sharp T-peak.
Case 2.1: The current candidate QRS peak and the previous QRS peak both have a candidate extremum pair in the higher frequency d2’. In this case, the current candidate QRS peak is identified as a new QRS peak.
Case 2.2: The current candidate QRS peak does not have a candidate extremum pair in the higher frequency d2’, but the previous QRS peak has one. In this case, the current candidate QRS peak is considered as a lower frequency T peak, not a QRS peak.
Case 2.3: The current candidate QRS peak has a candidate extremum pair in the higher frequency d2’, but the previous QRS peak does not have one. In this case, the current candidate QRS peak is identified as a new QRS peak and the previous QRS peak is identified as a lower frequency P peak, not a QRS peak.
Case 3: The distance between the current candidate QRS peak and the previous QRS peak is less than 100 samples. In this case, it is considered that the two peaks are located in the same QRS wave and only a sharper peak remains. A sharpness parameter α of a peak based on the corresponding extremum pair is defined as follows:
α = | y 1 y 2 | x 2 x 1
The larger the extreme values, or the shorter the distance between the first and second extremum points, the larger the sharpness parameter α. If the sharpness of the current candidate QRS peak is larger than that of the previous QRS peak, we remove the previous QRS peak and identify the current candidate QRS peak as a new QRS peak. Otherwise, we remove the current candidate QRS peak and reserve the previous QRS peak.

4. Results and Discussion

4.1. Illustrations of the Identifications of QRS Peaks

The detection of QRS peaks is based on a lower-noise wavelet detail signal between d3’ and d4’ according to the evaluation of the amount of noise. Figure 8a,b demonstrate the QRS detection results for a high-noise ECG signal from recording 104 using d3’ and d4’, respectively. The top figures in Figure 8a,b are the same ECG signal. The red circles denote the detected QRS peaks. FP denotes a false positive peak. The bottom figures in Figure 8a,b are d3’ and d4’. The candidate extremum pairs marked as a red circle followed by a green one are determined using the conditions defined in Section 3.4. Two red solid lines indicate the positive and negative thresholds defined in Equations (6) and (7) to search for candidate extreme points. Two red dashed lines indicate the positive and negative thresholds of 1.6 times. The extreme points between two red dashed lines are applied to evaluate the amount of noise. It is obvious that the noise amount of d3’ is larger than that of d4’ for this noisy ECG signal. If the detection of QRS peaks is based on d3’, several peaks are misidentified as QRS peaks, as shown in the top figure of Figure 8a. If the detection of QRS peaks is based on d4’, all QRS peaks are identified accurately, as shown in the top figure of Figure 8b. Hence, the lower-noise d4’ is selected in the detection of QRS peaks for noisy ECG signals.
Figure 9, Figure 10 and Figure 11 illustrate the identifications of QRS peaks for Cases 1, 2, and 3 defined in Section 3.7. Figure 9 illustrates the identifications of QRS peaks for Case 1. The top and bottom figures plot the ECG signal and d3’, respectively. The detected QRS peaks are marked as red circles in the ECG signal, and the candidate extremum pairs are marked as a red circle followed by a green one in d3’. The candidate extremum pairs in d3’ are used to calculate the positions of the candidate QRS peaks using Equation (8) in Section 3.6. All of their corresponding candidate QRS peaks are from Case 1 in Section 3.7 and are identified as QRS peaks because all the distances between the two successive candidate QRS peaks are about 280 samples, which are greater than the defined 130 samples.
Figure 10 demonstrates the identifications of QRS peaks for Case 2.1 and shows the waveforms of the ECG signal (top), d3’ (middle), and d2’ (bottom). The positions of the candidate QRS peaks are calculated by the candidate extremum pairs in d3’, and d2’ is applied to provide assistance with the identification of the P- or T-peaks. There are three candidate extremum pairs marked as pairs 1, 2, and 3 in d3’ and d2’, and their corresponding candidate QRS peaks are P1, P2, and P3 in the ECG signal. All of the candidate QRS peaks are identified as QRS peaks and marked as red circles in the ECG signal. In addition to P2 and P3, the identifications of other QRS peaks are Case 1 in Section 3.7 because the distances between two successive QRS peaks are greater than 130 samples. The previous QRS peaks of P2 and P3 are P1 and P2, respectively. Because P2, P3, and their previous QRS peaks have candidate extremum pairs in d2’, P2 and P3 are identified as QRS peaks according to Case 2.1 in Section 3.7.
Figure 11 shows the identifications of QRS peaks for Case 2.2 and Case 3. The candidate extremum pairs in d3’ are used to calculate the positions of the candidate QRS peaks. P1, marked as a red circle, is identified as a QRS peak. P2 and P3, marked as black squares, are identified as not a QRS peak. There are three candidate extremum pairs marked as pairs 1, 2, and 3 in d3’, and only one candidate extremum pair marked as pair 1 in d2’ for the first QRS complex. The identification of P2 is Case 3 in Section 3.7 because the distance between P1 and P2 is only 31 samples and is less than 100 samples. Based on the evaluation of the sharpness of P1 and P2 using Equation (9), P2 is identified as not a QRS peak because the sharpness parameter of P1 is larger than that of P2. The identification of P3 is Case 2.2 in Section 3.7 because the distance between P1 and P3 is 126 samples, is greater than 100 samples, and is less than 130 samples. It is obvious that the current candidate QRS peak, P3, has no extremum pair in the higher frequency d2’, but the previous QRS peak, P1, has one. Hence, P3 is identified as not a QRS peak. It is considered as a T-peak.

4.2. Performance Evaluation of the Proposed QRS Peak Detection System and Comparison with the Previous Studies

The MIT-BIH arrhythmia database containing 48 ECG recordings was used to evaluate the performance of the proposed QRS peak detection system in order to compare with some previous specific studies which used the same database. An identified QRS peak is recorded as a true peak if it is located within 100 ms (i.e., 36 samples at sampling rate of 360 Hz) of the annotation time [12]. The commonly used performance parameters for the QRS peak detection system are defined as follows:
Sensitivity (Se):
Se ( % ) = TP TP + FN × 100 %
Positive prediction value (+P):
+ P ( % ) = TP TP + FP × 100 %
Detection error rate (DER):
DER ( % ) = FP + FN Total   No .   of   QRS   Beats × 100 %
where TP is the number of true positive peaks (QRS peaks detected as QRS peaks), FN is the number of false negative peaks (QRS peaks detected as Not QRS peaks), and FP is the number of false positive peaks (Not QRS peaks detected as QRS peaks).
Table 1 lists the summary performance of the proposed QRS detection algorithm using the first channel of the MIT-BIH arrhythmia database. Most of the QRS peaks can be accurately detected by the proposed algorithm even if the ECG signals include severe baseline drifts, abrupt changes, high-frequency noise, low-amplitude QRS complexes, sharp P and T waves, or wide ventricular premature contractions. There are a total of 271 detection failures including 180 false negative beats and 91 false positive beats. The highest number of detection failures is 46 failures for recording 203, followed by 31 failures for recording 105, 23 failures for recording 108, 21 failures for recording 228, and 20 failures for recording 116. The individual sensitivity, positive prediction value, and detection error rate range from 98.89% to 100%, from 98.96% to 100%, and from 0% to 1.54%, respectively. The total sensitivity, positive prediction value, and detection error rate are 99.84%, 99.92%, and 0.25%.
Table 2 shows the performance comparison of the proposed QRS peak detection system with the previous studies. In addition to Berwal et al. [14] only providing the results of one-minute signal per ECG recording, other studies have the results of complete 30-minute signal per ECG recording. Though the FN and FP of Berwal et al. [14] have only 22 and 26, respectively, its DER of 1.49% is the highest among the studies in Table 2. Comparing the proposed algorithm with wavelet-based methods using 30-minute ECG signals, the minimum FN is 140 for Bouaziz et al. [19], followed by 178 for Merah et al. [12] and 180 for the proposed algorithm, and the proposed method has the minimum FP of 91 and FP+FN of 271. The proposed algorithm has the best DER of 0.25% and +P of 99.92% among the wavelet-based methods in Table 2. The Se of the proposed method is 99.84%, which is slightly lower than 99.87% of Bouaziz et al. [14]. The results show that the proposed method improves the QRS detection accuracy of the wavelet-based methods.
Most of the previous studies removed the high-frequency noise to increase the signal-to-noise ratio and reduce the interference of noise. However, the pre-filtering out of the high-frequency components would not only reduce the noise level, but also cause a reduction in the amplitudes of the QRS peaks and a decrease in the detection accuracy of the QRS peaks. Instead of removing the high-frequency components in the preprocessing stage, this study selects a lower-noise wavelet detail signal according to the results of the noise amount evaluation to reduce the interference of noise. For low-noise ECG signals, the higher-frequency d3’ is usually selected for the detection of QRS peaks because the higher frequency wavelet detail signal has smaller energy to the lower frequency signal. Furthermore, d3’ has higher detection accuracy than d4’ for low-noise signals. If ECG signals suffer interference from a large amount of high-frequency noise, usually the higher frequency d3’ would be contaminated by noise more than the lower frequency d4’. The detection of QRS peaks based on the lower-noise d4’ can reduce the noise interference and improve the detection accuracy of QRS peaks for high-noise ECG signals.
Comparing the proposed algorithm with non-wavelet-based methods using 30-minute ECG signals, the minimum FN was 79 in Manikandan and Soman [3], followed by 137 in Yazdani and Vesin [17], and 180 in the proposed method. The minimum FP is 91 in the proposed method, followed by 108 in Yazdani and Vesin [17], and 140 in Manikandan and Soman [3]. The DER of the proposed method is 0.25%, which is slightly higher than the 0.20% of Manikandan and Soman [3] and the 0.22% of Yazdani and Vesin [17]. The Se of the proposed method is 99.84%, which is slightly lower than the 99.93% of Manikandan and Soman [3] and the 99.87% of Yazdani and Vesin [17]. The maximum +P is 99.92% in the proposed method, followed by 99.90% in Yazdani and Vesin [17]. The results show that the proposed algorithm also improves the detection accuracy of QRS peaks in comparison with the non-wavelet-based methods.

4.3. Limitations of the Proposed Algorithm

The limitations of the proposed QRS peak detection algorithm caused 271 detection failures of QRS peaks, which can be classified into several types. Figure 12 illustrates the detection failure caused by sudden high-frequency noise. The red circles indicate the QRS peaks that were correctly identified, and the red arrow followed with FP:18569 indicates a false positive beat at sample 18569. Because the sudden high-frequency noise cannot be detected by the proposed noise evaluation method, the QRS peak detection was still based on the higher-frequency d3’, and, hence, this sudden large-amplitude noise peak in Figure 12 is misidentified as a QRS peak. A total of 41 detection failures were caused by the sudden high-frequency noise. Figure 13 demonstrates the detection failure caused by the greatly reduced amplitude of the QRS peak compared to the adjacent QRS peaks. The black arrow followed by V:295133 indicates the peak of a VPC beat at sample 295133, which is misidentified as a false negative beat. Because the amplitude of this VPC beat is greatly reduced in comparison with those of other QRS complexes, the peak of the VPC beat was misidentified as not being a QRS peak. Greatly decreased amplitudes of QRS peaks caused a total of 62 detection failures.
Figure 14 shows the detection failures caused by large-amplitude artifacts. It is obvious that the four peaks of large-amplitude artifacts are very similar to QRS peaks and are misidentified as QRS peaks. A total of 26 detection failures were caused by large-amplitude artifacts. Figure 15 illustrates the detection failure caused by a distance of less than 100 samples between two successive QRS peaks, which caused a total of 15 detection failures. The VPC beat marked by V:267025 was misidentified as not being a QRS peak because the distance between it and the previous QRS peak was less than 100 samples. Figure 16 demonstrates the detection failures caused by a P-peak sharper than the QRS peak. The FP:141706 denotes a false positive beat at sample 141706, and the N:141768 represents a normal beat at sample 141768, which is misidentified as a false negative beat. When a P- or T-peak is sharper than a QRS peak, it causes two detection failures. One is the P- or T-peak misidentified as a QRS peak, and the other is the QRS peak misidentified as not being a QRS peak. A total of 36 detection failures were caused by the P- or T-peak being sharper than the QRS peak. Figure 17 and Figure 18 illustrate the detection failures caused by the inconsistent annotation of the MIT-BIH arrhythmia database. Not QRS peaks that were annotated as QRS peaks caused a total of 57 detection failures. It is obvious that the peaks indicated as N in Figure 17 are not QRS peaks but are annotated as peaks of the normal QRS complexes. QRS peaks that were annotated as Not QRS peaks caused a total of 10 detection failures, as illustrated in Figure 18. The peak indicated as FP should be a QRS peak, but the corresponding annotation was lost. The remaining 24 detection failures were caused by other types. The limitations of the proposed algorithm for these types of detection failures of QRS peaks should be addressed in future work.

5. Conclusions

This study proposes a QRS detection algorithm based on a four-level biorthogonal spline wavelet transform. A noise evaluation approach was developed for selecting a lower-noise wavelet detail signal to reduce the noise interference instead of pre-filtering out the high-frequency noise in the signal preprocessing. If the noise amount in d3’ is lower than that in d4’, the detection of QRS peaks is based on d3’; otherwise, it is based on d4’. The identification of QRS peaks was based on the extremum pairs in the selected wavelet detail signals and the proposed decision rules. The proposed algorithm was evaluated by the MIT-BIH arrhythmia database. It presents a high accuracy to detect QRS peaks. The results show a 0.25% detection error rate, 99.84% sensitivity, and 99.92% positive prediction value. The performance of the proposed algorithm is better than that of several wavelet-based methods and non-wavelet-based algorithms.

Author Contributions

C.-C.L. and H.-Y.C. provided the research ideas. C.-C.L., H.-Y.C., and Y.-H.H. designed the algorithms, performed the experiments, and analyzed the experimental data. C.-C.L. and C.-Y.Y. wrote the paper. All authors reviewed and approved the final manuscript.

Funding

This research was funded by National Chin-Yi University of Technology, Taiwan, Republic of China, grant numbers NCUT 18-R-CE-020 and NCUT 18-T-CE-010.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Christov, I.I. Real time electrocardiogram QRS detection using combined adaptive threshold. Biomed. Eng. Online 2004, 3, 1–9. [Google Scholar] [CrossRef]
  2. Pan, J.; Tompkins, W.J. A real-time QRS detection algorithm. IEEE Trans. Biomed. Eng. 1985, 32, 230–236. [Google Scholar] [CrossRef] [PubMed]
  3. Manikandan, M.S.; Soman, K.P. A novel method for detecting R-peaks in electrocardiogram (ECG) signal. Biomed. Signal Process. Control 2012, 7, 118–128. [Google Scholar] [CrossRef]
  4. Slimane, Z.E.H.; Nait-Ali, A. QRS complex detection using empirical mode decomposition. Digit. Signal Process. 2010, 20, 1221–1228. [Google Scholar] [CrossRef]
  5. Chen, C.L.; Chuang, C.T. A QRS detection and R point recognition method for wearable single-lead ECG devices. Sensors 2017, 17, 1969. [Google Scholar] [CrossRef]
  6. Castells-Rufas, D.; Carrabina, J. Simple real-time QRS detector with the MaMeMi filter. Biomed. Signal Process. Control 2015, 21, 137–145. [Google Scholar] [CrossRef] [Green Version]
  7. Phukpattaranont, P. QRS detection algorithm based on the quadratic filter. Expert Syst. Appl. 2015, 42, 4867–4877. [Google Scholar] [CrossRef]
  8. Sharma, L.D.; Sunkaria, R.K. A robust QRS detection using novel pre-processing techniques and kurtosis based enhanced efficiency. Measurement 2016, 87, 194–204. [Google Scholar] [CrossRef]
  9. Choi, S.; Adnane, M.; Lee, G.J.; Jang, H.; Jiang, Z.; Park, H.K. Development of ECG beat segmentation method by combining lowpass filter and irregular RR interval checkup strategy. Expert Syst. Appl. 2010, 37, 5208–5218. [Google Scholar] [CrossRef]
  10. Abibullaev, B.; Seo, H.D. A new QRS detection method using wavelets and artificial neural networks. J. Med. Syst. 2011, 35, 683–691. [Google Scholar] [CrossRef]
  11. Karimipour, A.; Homaeinezhad, M.R. Real-time electrocardiogram P-QRS-T detection–delineation algorithm based on quality-supported analysis of characteristic templates. Comput. Biol. Med. 2014, 52, 153–165. [Google Scholar] [CrossRef]
  12. Merah, M.; Abdelmalik, T.A.; Larbi, B.H. R-peaks detection based on stationary wavelet transform. Comput. Methods Progr. Biomed. 2015, 121, 149–160. [Google Scholar] [CrossRef]
  13. Farashi, S. A multiresolution time-dependent entropy method for QRS complex detection. Biomed. Signal Process. Control 2016, 24, 63–71. [Google Scholar] [CrossRef]
  14. Berwal, D.; Kumar, A.; Kumar, Y. Design of high performance QRS complex detector for wearable healthcare devices using biorthogonal spline wavelet transform. ISA Trans. 2018, 81, 222–230. [Google Scholar] [CrossRef]
  15. Zhang, F.; Lian, Y. QRS detection based on morphological filter and energy envelope for applications in body sensor networks. J. Signal Process. Syst. 2011, 64, 187–194. [Google Scholar]
  16. Arbateni, K.; Bennia, A. Sigmoidal radial basis function ANN for QRS complex detection. Neurocomputing 2014, 145, 438–450. [Google Scholar] [CrossRef]
  17. Yazdani, S.; Vesin, J.M. Extraction of QRS fiducial points from the ECG using adaptive mathematical morphology. Digit. Signal Process. 2016, 56, 100–109. [Google Scholar] [CrossRef] [Green Version]
  18. Zidelmal, Z.; Amirou, A.; Adnane, M.; Belouchrani, A. QRS detection based on wavelet coefficients. Comput. Methods Progr. Biomed. 2012, 107, 490–496. [Google Scholar] [CrossRef]
  19. Bouaziz, F.; Boutana, D.; Benidir, M. Multiresolution wavelet-based QRS complex detection algorithm suited to several abnormal morphologies. IET Signal Process. 2014, 8, 774–782. [Google Scholar] [CrossRef]
  20. Kohler, B.U.; Hennig, C.; Orglmeister, R. The principles of software QRS detection. IEEE Eng. Med. Biol. Mag. 2002, 21, 42–57. [Google Scholar] [CrossRef]
  21. Goldberger, A.L.; Amaral, L.A.N.; Glass, L.; Hausdorff, J.M.; Ivanov, P.C.; Mark, R.G.; Mietus, J.E.; Moody, G.B.; Peng, C.K.; Stanley, H.E. PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals. Circulation 2000, 101, e215–e220. [Google Scholar] [CrossRef] [PubMed]
  22. de Chazal, P.; O’Dwyer, M.; Reilly, R.B. Automatic classification of heartbeats using ECG morphology and heartbeat interval features. IEEE Trans. Biomed. Eng. 2004, 51, 1196–1206. [Google Scholar] [CrossRef] [PubMed]
  23. Unser, M. Ten good reasons for using spline wavelets. In Proceedings of the SPIE Conference on Mathematical Imaging: Wavelet Applications in Signal and Image Processing V, San Diego, CA, USA, 6–9 August 1997; Volume 3169, pp. 422–431. [Google Scholar]
  24. Mallat, S.G. A theory for multiresolution signal decomposition: The wavelet representation. IEEE Trans. Pattern Anal. Mach. Intell. 1989, 11, 674–693. [Google Scholar] [CrossRef]
Figure 1. Block diagram of the proposed wavelet-based algorithm for detection of the QRS complex.
Figure 1. Block diagram of the proposed wavelet-based algorithm for detection of the QRS complex.
Applsci 09 02142 g001
Figure 2. Illustration of segmentation of the electrocardiogram (ECG) recording.
Figure 2. Illustration of segmentation of the electrocardiogram (ECG) recording.
Applsci 09 02142 g002
Figure 3. Illustration of removing the low-frequency baseline drift.
Figure 3. Illustration of removing the low-frequency baseline drift.
Applsci 09 02142 g003
Figure 4. A four-level dyadic wavelet transform of ECG signals using a two-channel filter bank.
Figure 4. A four-level dyadic wavelet transform of ECG signals using a two-channel filter bank.
Applsci 09 02142 g004
Figure 5. Illustrations of common QRS complexes and their high-frequency detail signals, d1, d2, d3, and d4. N: Normal beat; V: Premature ventricular contraction beat; L: Left bundle branch block beat; Q: Unclassifiable beat.
Figure 5. Illustrations of common QRS complexes and their high-frequency detail signals, d1, d2, d3, and d4. N: Normal beat; V: Premature ventricular contraction beat; L: Left bundle branch block beat; Q: Unclassifiable beat.
Applsci 09 02142 g005
Figure 6. Illustrations of the extreme detail signals including only the extreme points of the detail signals, named d1’, d2’, d3’, and d4’ according to d1, d2, d3, and d4, respectively, in Figure 5.
Figure 6. Illustrations of the extreme detail signals including only the extreme points of the detail signals, named d1’, d2’, d3’, and d4’ according to d1, d2, d3, and d4, respectively, in Figure 5.
Applsci 09 02142 g006
Figure 7. Illustration of an extremum pair in d3’.
Figure 7. Illustration of an extremum pair in d3’.
Applsci 09 02142 g007
Figure 8. Illustration of the QRS detection results for a noisy ECG signal using (a) d3’ and (b) d4’.
Figure 8. Illustration of the QRS detection results for a noisy ECG signal using (a) d3’ and (b) d4’.
Applsci 09 02142 g008
Figure 9. Illustration of the identifications of QRS peaks for Case 1.
Figure 9. Illustration of the identifications of QRS peaks for Case 1.
Applsci 09 02142 g009
Figure 10. Illustration of the identifications of QRS peaks for Case 2.1.
Figure 10. Illustration of the identifications of QRS peaks for Case 2.1.
Applsci 09 02142 g010
Figure 11. Illustration of the identifications of QRS peaks for Case 2.2 and Case 3.
Figure 11. Illustration of the identifications of QRS peaks for Case 2.2 and Case 3.
Applsci 09 02142 g011
Figure 12. Illustration of the detection failure caused by sudden high-frequency noises.
Figure 12. Illustration of the detection failure caused by sudden high-frequency noises.
Applsci 09 02142 g012
Figure 13. Illustration of the detection failures caused by greatly reduced amplitudes of QRS peaks compared to the adjacent QRS peaks.
Figure 13. Illustration of the detection failures caused by greatly reduced amplitudes of QRS peaks compared to the adjacent QRS peaks.
Applsci 09 02142 g013
Figure 14. Illustration of the detection failures caused by large-amplitude artifacts.
Figure 14. Illustration of the detection failures caused by large-amplitude artifacts.
Applsci 09 02142 g014
Figure 15. Illustration of the detection failure caused by the distance shorter than 100 samples between two successive QRS peaks.
Figure 15. Illustration of the detection failure caused by the distance shorter than 100 samples between two successive QRS peaks.
Applsci 09 02142 g015
Figure 16. Illustration of the detection failures caused by the P-peak being sharper than the QRS peak.
Figure 16. Illustration of the detection failures caused by the P-peak being sharper than the QRS peak.
Applsci 09 02142 g016
Figure 17. Illustration of the detection failures caused by Not QRS peaks being annotated as QRS peaks by the MIT-BIH Arrhythmia Database.
Figure 17. Illustration of the detection failures caused by Not QRS peaks being annotated as QRS peaks by the MIT-BIH Arrhythmia Database.
Applsci 09 02142 g017
Figure 18. Illustration of the detection failures caused by QRS peaks but annotated as Not QRS peaks by the MIT-BIH Arrhythmia Database.
Figure 18. Illustration of the detection failures caused by QRS peaks but annotated as Not QRS peaks by the MIT-BIH Arrhythmia Database.
Applsci 09 02142 g018
Table 1. Summary performance of the proposed QRS peak detection system using the first channel of the MIT-BIH arrhythmia database.
Table 1. Summary performance of the proposed QRS peak detection system using the first channel of the MIT-BIH arrhythmia database.
No.Total BeatsTPFNFPFP+FNSe (%)+P (%)DER (%)
100227322730001001000
101186518650001001000
102218721870001001000
103208420840001001000
1042229222811299.9699.960.09
105257225684273199.8498.961.21
1062027202250599.751000.25
1072137213610199.951000.05
1081763175013102399.2699.431.3
109253225320001001000
1112124212310199.951000.05
112253925390001001000
1131789178906610099.670.34
1141879187181999.5799.950.48
115195319530001001000
116241223922002099.171000.83
117153515350001001000
118227822780001001000
119198719870001001000
1211863186210199.951000.05
122247624760001001000
123151815180001001000
124161916190001001000
2002601259652799.8199.920.27
2011963196126899.999.690.41
2022136213330399.861000.14
2032980294733134698.8999.561.54
2052656265060699.771000.23
207186018421811999.0399.951.02
208295529391621899.4699.930.61
2093005300320299.931000.07
21026502642841299.799.850.45
212274827480001001000
213325132510001001000
2142262225931499.8799.960.18
2153363336210199.971000.03
21722082201731099.6899.860.45
219215421540001001000
220204820480001001000
2212427242520299.921000.08
2222483248121399.9299.960.12
2232605260230399.881000.12
228205320401382199.3799.611.02
2302256225601110099.960.04
231157115710001001000
2321780178004410099.780.22
2333079307720299.941000.06
234275327530001001000
Total109,488109,3081809127199.8499.920.25
Table 2. Performance comparison of the proposed QRS peak detection system with the previous studies.
Table 2. Performance comparison of the proposed QRS peak detection system with the previous studies.
MethodsTPFNFPFP+FNDER%Se%+P%
Wavelet-Based Methods
Proposed109,308180912710.2599.8499.92
Zidelmal et al., 2012 [18]109,1013931935860.5499.6499.82
Bouaziz et al., 2014 [19]109,3541402323720.3499.8799.79
Merah et al., 2015 [12]109,3161781263040.2899.8499.88
Berwal et al., 2018 [14]31862226481.4999.3199.19
Non-Wavelet-Based Methods
Christov, 2004 [1]109,6152402394790.4499.7899.78
Manikandan and Soman, 2012 [3]109,417791402190.2099.9399.87
Karimipour and Homaeinezhad, 2014 [11]115,9451923085000.4399.8199.70
Castells-Rufas and Carrabina, 2015 [6]108,8806143539670.8899.4399.67
Phukpattaranont, 2015 [7]109,2812022104120.3899.8299.81
Farashi, 2016 [13]109,6922731634360.4099.7599.85
Sharma and Sunkaria, 2016 [8]108,9795094289370.9399.5099.56
Yazdani and Vesin, 2016 [17]109,3571371082450.2299.8799.90
Chen and Chuang, 2017, [5]109,2501932033960.3699.8299.81

Share and Cite

MDPI and ACS Style

Lin, C.-C.; Chang, H.-Y.; Huang, Y.-H.; Yeh, C.-Y. A Novel Wavelet-Based Algorithm for Detection of QRS Complex. Appl. Sci. 2019, 9, 2142. https://doi.org/10.3390/app9102142

AMA Style

Lin C-C, Chang H-Y, Huang Y-H, Yeh C-Y. A Novel Wavelet-Based Algorithm for Detection of QRS Complex. Applied Sciences. 2019; 9(10):2142. https://doi.org/10.3390/app9102142

Chicago/Turabian Style

Lin, Chun-Cheng, Hung-Yu Chang, Yan-Hua Huang, and Cheng-Yu Yeh. 2019. "A Novel Wavelet-Based Algorithm for Detection of QRS Complex" Applied Sciences 9, no. 10: 2142. https://doi.org/10.3390/app9102142

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop