# A Novel Wavelet-Based Algorithm for Detection of QRS Complex
## 4 Results and Discussion  
### 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. Figures 9-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 8: Illustration of the QRS detection results for a noisy ECG signal using (**a**) d3′ and (**b**) d4′. 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.