An Efficient Teager Energy Operator-Based Automated QRS Complex Detection

Database The efficiency and robustness of the proposed method has been tested on Fantasia Database (FTD), MIT-BIH Arrhythmia Database (MIT-AD), and MIT-BIH Normal Sinus Rhythm Database (MIT-NSD). Aim Because of the importance of QRS complex in the diagnosis of cardiovascular diseases, improvement in accuracy of its measurement has been set as a target. The present study provides an algorithm for automatic detection of QRS complex on the ECG signal, with the benefit of energy and reduced impact of noise on the ECG signal. Method The method is basically based on the Teager energy operator (TEO), which facilitates the detection of the baseline threshold and extracts QRS complex from the ECG signal. Results The testing of the undertaken method on the Fanatasia Database showed the following results: sensitivity (Se) = 99.971%, positive prediction (P+) = 99.973%, detection error rate (DER) = 0.056%, and accuracy (Acc) = 99.944%. On MIT-AD involvement, Se = 99.74%, P+ = 99.97%, DER = 0.291%, and Acc = 99.71%. On MIT-NSD involvement, Se = 99.878%, P+ = 99.989%, DER = 0.134%, and Acc = 99.867%. Conclusion Despite the closeness of the recorded peaks which inflicts a constraint in detection of the two consecutive QRS complexes, the proposed method, by applying 4 simple and quick steps, has effectively and reliably detected the QRS complexes which make it suitable for practical purposes and applications.


Introduction
Cardiovascular disease is the primary global cause of death. According to the World Health Organization, about 17.3 million people died of cardiovascular disease in 2008, which represented 30 percent of all global deaths. is number is predicted to grow to more than 23.6 million by 2030 [1,2]. Heart diseases like cardiovascular disease, sudden death, ischemic heart disease, and cardiac arrhythmias are all diagnosed by analyzing the heart's signal [3][4][5]. e electrocardiogram is a noninvasive method of recording signals of heart muscle contractions over a period of time. erefore, the accurate analysis of these signals will result in a more accurate diagnosis of cardiovascular diseases [6,7]. An ECG signal is a combination of QRS complex, P and T peaks, and sometimes includes U peak. e detection of the QRS complex also helps to detect and determine P and T peaks, QT interval, ST interval, and the respiratory rate, which are considered as the human's vital signs. erefore, the accurate recognition of QRS complex has a significant role in the accurate diagnosis of heart disease [8].
During the past decades, a variety of QRS complex detection methods have been developed [9] such as Pan-Tompkins method of R-wave detection [10], support vector machine [11], and the wavelet method, which is an analytical technique based on time-frequency chromatography. e wavelet transform is widely used in medical signal analysis such as EEG or ECG. However, this has a drawback because by applying a fixed scale, the signal characteristics are ignored [3,12,13]. Kalman filters use a dynamic model derived from a dynamic system to predict the hidden state in a nonlinear approach [14]. Artificial neural networks are an ideal self-correcting nonlinear process used in a wide range of tasks [15]. Shannon energy computes the average signal energy in a signal spectrum. In other words, it reduces the high intensity to balance out with the low intensity [16][17][18].
e Adaptive Double reshold Filter (ADTF) and Discrete Wavelet Transform (DWT) are used to reduce the noise in the ECG signal to improve the ECG signal filtering [19]. Hermit transformation, which is used as an alternative to the Fourier transformation, may by optimization, shows an improved performance [20]. Teager Energy Operator (TEO) mainly shows the frequency and instantaneous changes of the signal amplitude that is very sensitive to subtle changes. Although TEO was first proposed for modeling nonlinear speech signals, it was later widely applied in the audio signal processing. Using TEO can minimize the effects of P and T waves on QRS complex detection [21]. Remarkable research efforts have been developed to analyze the sensitive point of the ECG signal based on TEO [22,23]. e aim of this study is to propose a new approach based on an innovative viewpoint using TEO to detect QRS complex in the ECG signal. e recorded ECG signal may be affected by noise interference, such as power line interference, which must be eradicated for more accuracy. e Section 2 of the study consists of a series of preprocessing measures to minimize the noises before QRS complex detection on the ECG signal.
is includes low-pass filter which removes noises such as power line interference. Since P or T peaks may interfere with the TEO computation, the moving average technique is used to smoothen and envelope the spikes in the signal. Sensitivity, positive prediction, and accuracy of the proposed algorithm from Fantasia Database, MIT-AD, and MIT-NSD are evaluated in the Section 3 of this article. Finally, in Sections 4 and 5 of the study, a discussion and conclusions are presented.

Methodology
e details of the proposed method are illustrated in Figure 1. e QRS complex detection procedure involves four steps.
(i) Most of the time, the recorded ECG signal is afflicted by noises [24]. e noise frequencies generated by the power lines' interferences are in the range of 50 to 60 Hz. e noises generated by the muscle contractions and the electrodes placed on the body skin are in the range of 38 to 48 Hz. ese greatly impede on the ECG signals. However, a notch filter is very effective in removing these noises. e maximum density of the QRS complex is between 5 to 20 Hz [17,25]. erefore, the IIR Butterworth digital filter is the best compromise for phase response and signal attenuation. It has no ripple in the band-pass and is more efficient than the FIR filter [26,27]. To reduce the noises from the electrical (device) components in order to make a peak clearer for detection, a Butterworth low-pass digital filter, with order 4 and cutoff frequency of 15 Hz, was used.
(ii) TEO has various applications, especially in AM and FM signal processing such as speech signals. TEO can be driven from a second-order differential equation [28]. e total energy of oscillation (i.e., the sum of kinetic and potential energies) can be obtained from the following equation: where m is the mass of the oscillating body and k is the spring constant. Using the formula in (1), a periodic harmonic formula can be obtained: where ϕ is the phase shift, Ω is the oscillation frequency, A is the oscillation amplitude, and x(t) denotes the position of the oscillating body with respect to time. Using (1) and (2), the essential harmonic energy to generate signals can be calculated: e following is a simplified form of TEO: Substituting nT for t we will get the following equation: where Ψ c [x(t)] is the energy operator for contin- and [x ″ (t)] are the first and second derivatives of x(t), respectively, T is the sample period, and n is the sample size [28,29]. e dynamicity of the heart beats creates an intermittent and nonlinear pattern for TEO. Since TEO itself is a nonlinear operator, it nonlinearly captivates the intermittent characteristics. (iii) After computing TEO, in some signals, spikes of energies are observable and are attributed to P and T peaks in QRS complex. Although not wide in range, they hamper the accurate detection of the QRS complex. To resolve the situation, these spikes should be converted into energy envelopes. ere are several methods for this such as Hilbert transform [6] or averaging method [30]. In the present study, moving average the following equation is used: Here h defines a rectangle with L length, j is a constant and is equal to 1, and TEO defines Teager energy from previous steps. To increase the small amplitude, square root is used: Here MA is the moving average obtained from the previous step.

Journal of Healthcare Engineering
To decrease the baseline signal's value below zero, the following formula is used [16]: where σ is the standard deviation and μ is defined as signal average. (iv) e process of peak detection includes the following step: where baseline (0) is the threshold level for peak detection and R peaks are found in an ECG signal by searching the maximum peak within ±50 samples (length of window � min (RR interval)) of the recognized location of the candidate R peak in the previous step (Equation (9)).

Results
Under the supervision of the National Research Center, the PhysioBank database was developed by the National Institute of Health in order to do a clinical diagnosis and conduct research on complex cardiovascular physiologic signals [31]. e proposed method was tested on three different ECG databases [32] including Fantasia Database (FTD), MIT-BIH Arrhythmia Database (MIT-AD), and MIT-BIH Normal Sinus Rhythm Database (MIT-NSD). e suggested peak detection method based on TEO has been implemented with MATLAB R2016a on a minimum laptop with a 4 GB of memory and Intel core i3-4000M 2.4 GHz CPU on Windows 10. is algorithm takes less than 0.026 second. e following formulae were used to determine the performance, sensitivity, error rate detection, positive prediction, and the accuracy of the proposed method: Positive predictivity rate (+P) � TP TP + FP × 100%, TP is the number of R peaks, FN is the number of missed R peaks, and FP is the false positive prediction of R peak due to the existing noise with dispositioned true R peak.

MIT-BIH Arrhythmia Database.
MIT-AD contains slightly over 30 minutes of recordings in 48 records. e sampling frequency was set to 360 Hz with 11-bit ADC resolution. e subjects who were chosen for this study were 22 women aged 23 to 89 years and 25 men aged 32 to 89 years [31,33]. Table 1 depicts the details of detected QRS complex in channel 1.
e results showed that sensitivity was at 99.74% with a 0.391% (detection) error and 99.97% positive prediction with an accuracy of 99.71%. Table 2 compares the proposed algorithm in this study with those of other studies. All the stages and the process of QRS detections are illustrated in Figures 2-4. e MIT-AD is available on [36].
In Figures 2 and 3, (a) reveals wandering signals. (b) shows that after calculating Teager energy, the amplitudes of the signals are very low and close to zero. erefore, small values with low energy are reduced to zero, and the wandering signals (drift) are canceled.

Fantasia Database.
Fantasia Database (FTD) contains 40 cases in both groups: the young group aged 21 to 34 years (f1y01 . . . f2y10 and f2y01 . . . f2y10) and the elderly group aged 68 to 85 years (f2o01 . . . f2o10 and f2y01 . . . f2y10), with an average of 5 men and 5 women in each group. e members of each group underwent 120 minutes of continuous supine resting with complete care. e sampling frequency was set at 250 Hz, with a 16-and 12-bit resolutions for ADC. e records included 2 or 3 channels, such as respiration, ECG signal, and blood pressure [31,37]. Fantasia Database is available on [38]. e QRS complex detection details for the channel 2 in Fantasia Database are presented in Table 3. Here too, the results showed 99.971% sensitivity with 0.056% detection error, and 99.973% positive prediction with an accuracy of 99.944%. Table 4 shows the comparison of the proposed method with the other studies. Figures 5 and 6 illustrate another example of detection: QRS Complex in the Fantasia Database with both elderly and young subjects. As shown in this figure, the proposed method can remove drift noise and detect correct location beat.

MIT-BIH Normal Sinus Rhythm
Database. MIT-NSD contains 18 long-term two-channel ECG recordings. is database includes 5 men, aged 26 to 45 and 13 women, aged 20 to 50. Frequency sampling equals to 128 Hz with 12-bit ADC resolution [31]. e details of QRS complex detection Low-pass filter ECG signal Teager energy Moving average Step 1: preparation signal Step 2: teager energy and moving average Step 3: assessment high peak Step 4: peak detection Decrease base line Sqrt Figure 1: e diagram block shows 4 steps of QRS complex detection.
Journal of Healthcare Engineering   Figure 2: Recognition of R peaks in 108 records. e Y-axis represents amplitude, and X-axis represents the samples.    Table 5.
e obtained values showed that sensitivity was equal to 99.878%, with an error equal to 0.134, positive prediction was equal to 99.989%, and accuracy was equal to 99.867%. Table 6 includes a comparison of the proposed algorithm with the other studies. Figure 7 illustrates the QRS detection in record with Gaussian white noise. As shown in the figure, the proposed method removed Gaussian white noise, but T peak was detected as a beat. MIT-NSD Database is available on [39].

Discussion
e aim of the present research is to use a novel algorithm based on the Teager energy operator in ECG signal to detect QRS complex. e main findings of the study indicated the high reliability and accuracy of this method in QRS complex detection. In spite of applying zero-phase digital filter to maintain QRS complex location, the zero-phase filter is anticausal, and the results showed that the present method had faced a little lag which was less than 0.026 second. Only a detection shift of less than 0.05 second is acceptable [40].
In testing the present method on MIT-AD, some records such as 203 and 210 are main sources of error. e error rate is higher than 1%, which is equal to 0.291. Record 203 has a great number of QRS complexes with multiform ventricular arrhythmia. e TEO phase revealed that the amplitudes are very low and close to zero. Due to this fact, the present method indicated quite a weak performance about records : 203, 19090, and 19830. Records 230, 114, 113, 107

Conclusion
e present study detects QRS complex based on Teager energy, which was tested on four databases. It is a novel algorithm with an acceptable accuracy for ECG baseline prediction. e obtained results from testing the presented method on the Fantasia Database involved: sensitivity (Se) � 99.971%, positive prediction (+P) � 99.973%, detection error rate (DER) � 0.056%, and accuracy (Acc) � 99.944%.     Figure 6: Signal processing steps of the proposed R-peak detector using the case f1y06m. (a) e recognition phases by applying a low-pass filtering, (b) the Teager energy, (c) decreased baseline after moving average and sqrt, and (d) the detection phases. e Y-axis represents amplitude, and X-axis represents the samples.   On MIT-AD involvement, Se � 99.74%, +P � 99.97%, DER � 0.291%, and Acc � 99.71%. On MIT-NSD involvement, Se � 99.878%, +P � 99.989%, DER � 0.134%, and Acc � 99.867%. e provided results indicate that the presented method is reliable to detect QRS complex, and because the relationships are simple, the proposed method has a better performance than other sophisticated techniques such as neural networks. e results show that the proposed method is simple, effective, accurate, and suitable for practical application. To avoid the lag from zero-phase filter, a low-pass filter and a moving average were used, but still, the signal faced a shift that was about 0.026 s.

Data Availability
e data used to support the findings of this study are available in [36,38,39].

Conflicts of Interest
e authors declare that they have no conflicts of interest.