QT-interval prolongation is an important parameter for heart arrhythmia diagnosis. It is the time interval from QRS-onset to the T-end of electrocardiogram (ECG). Manual measurement of QT-interval, especially for 12-leads ECG, is time-consuming. Hence, an automatic QT-interval measurement is necessary. A new method for automatic QT-interval measurement is presented in this paper, which mainly consists of three parts, including QRS-complex detection, determination of QRS-onset, and T-end determination. The QRS-complex detection is based on the modified Pan-Tompkins algorithm. The T-end is defined based on Region of Interest (ROI) maximum limit. We compare and test our proposed QT-interval measurement method with reference measurement in term of correlation coefficient and range of 95% LoA. The correlation coefficient and the range of 95% LoA are 0.575 and 0.290, respectively. The proposed method is successfully implemented in ECG monitoring system using smartphone with high performance. The accuracy, positive predictive, and sensitivity of the QRS-complex detection in the system are 99.70%, 99.78%, and 99.92%, respectively. The range of 95% LoA for the comparison between manual and the system’s QT-interval measurement is 0.216. The results show that the proposed method is dependable on the measure of the QT-interval and outperforms the other methods in term of correlation coefficient and range of 95% LoA.
Electrocardiogram (ECG) can represent the electrical activity of human’s heart. It is commonly used for non-invasive tests and diagnosis of cardiovascular disease. Each cardiac cycle in ECG is characterized by waveform known as P-wave, Q-wave, R-wave, S-wave, and T-wave [ 1 ]. Combination of Q, R, and S-wave is often referred to QRS-complex.
QT-interval is a reflection of the ventricle’s action potential duration. It represents the time of ventricle to experience depolarization and repolarization [ 2 , 3 ]. On the ECG, the duration of QT-interval is defined as the period between the start of the QRS-complex (QRS-onset) and the end of the T-wave (T-end). The prolongation of QT-interval is an independent risk factor for stroke, sudden death, and all-cause of mortality [ 4 ]. It often happens with Torsade de Pointes (TdP) [ 5 , 6 ]. These facts indicate that the information of QT-interval is very important.
QT-interval could be measured manually or automatically. The drawback of manual QT-interval measurement, especially for 12-leads ECG, is time-consuming. Solution of the drawback is provided by utilizing the automatic approach. Different methods have been proposed and developed to measure QT-interval [ 7 - 11 ]. The most challenging things in the measurement of QT-interval are the detection and determination of T-end [ 11 ].
Smartphone has had important roles in current medical practice. Patients and clinician discussion, medical education, and disease diagnosis can be done via smartphone [ 12 - 15 ]. Smartphone with wireless ECG sensor has potential to be used in medical assessments, such as continuous assessment of heart functions that can be easily integrated in everyday life [ 16 ]. Electrocardiogram monitoring system and feature detection on portable device (such as smartphone) have been studied [ 14 , 17 - 21 ]. In the monitoring system, the ECG’s waves, complexes, and intervals can be detected automatically. Wu et al. developed an ECG monitoring system that is flexible with small size, which can be integrated in t-shirts [ 21 ]. This device uses a bio-potential Analog Front End (AFE) chip to sample good quality ECG data.
This article proposes a new method to determine the end of the T-wave and calculates the interval of QT in electrocardiogram. This method is based on the region of interest (ROI), which is the part of ECG presented in time interval and formed by taking a number of ECG samples located before and after the location of a desired point. The proposed method is examined using clinical data from the QT database of physionet [ 22 ]. Furthermore, the proposed QT-interval measurement is compared with manual QT-interval measurement from Physionet QT database.
We implement the proposed method in our electrocardiogram monitoring system using Android smartphone. We directly sample ECG data and measure QT-interval from patients. Then, the measured QT-interval from Android application is compared to our manual measurement. Therefore, the contribution of this article is providing a QT-interval measurement method in Android smartphone.
Material and Methods
We collect 105 ECG records from Physionet QT database [ 23 ]. The records are used for testing our proposed algorithm. The Physionet QT database provides annotation, which indicates the start, peak, and end of the P-wave and QRS-complex; the peak and end of T-wave and some of the annotations provide an indication of peak and end of U-wave. All records are sampled by sampling rate 250 samples/s or 4 ms in sampling interval. The records consist of 2 rows signal and 22,500 columns samples with duration of 15 minutes. We resample the records with sampling rate 200 samples/s to match our proposed method.
Various algorithms for QRS-complex detection have been studied [ 24 - 26 ]. One of them is algorithm developed by Pan and Tompkins [ 27 ]. We determine QRS-complex using modified Pan-Tompkins algorithm, as shown in Figure 1(a). The processes of QRS-complex detection are described as follows:
Detrending ECG - In order to remove the baseline drift, the ECG is fitted in a low order polynomial, and the polynomial value is used for detrending the ECG.
Band-pass Filtering - ECG has various noises, which can be reduced by signal filtering processes in this ECG [ 28 , 29 ]. In this study, ECG’s noises are removed by band-pass filter. This filter can reduce the influence of muscle noise and power-line interference. Where the detrended signal is dn, the output of low-pass filter, Dn, is
And the output of high-pass filter, Hn, as follows,
n is the n-th sample. The high-pass and low-pass filters have cutoff frequency 5 Hz and 11 Hz [ 30 ], respectively.
Derivative Process -The output of band-pass filtering process is passed to derivative process and to suppress low frequency ECG wave components. The derivative process, Dn, is described as,
Squaring - The output of derivative process is squared to make all data point positive and strengthens the dominant peak. This process is described as follows:
Moving Average Filter (MAF) - MAF is an operation for averaging N points of input values to produce each point in the output [ 31 ]. The purpose of the MAF process is to remove multiple peaks in one area of the QRS-complex. MAF is described as follows:
Where Sn is squaring process’ output, Mn is the output of MAF, and N is the number of samples in the moving window of MAF.
Threshold - The threshold value, T, is obtained by equation (6) and (7).
Where M is the output of moving average filter, is mean of m, and α is constant where 0<α≤1. To find ROI for determining QRS-onset, QRS-complex, and T-end, the value of moving window output signal is converted into 0 or 1, where,
Furthermore, the maximum limit Δ and minimum limit δ of ROI can be obtained from the following equation:
The ROI determination is shown in Figure 2(a).
QRS-complex detection – the QRS-complex’s peak of the ECG can be detected by finding the maximum value of the ECG in ROI as described in Figure 2(a). Because of the determination of QRS-complex based on this maximum value of ECG, inverted ECG must be reversed to get a correct QRS-complex.
If we draw a straight line from QRS-onset to band-pass filtered ECG, the QRS-onset point will connect to the minimum value of band-pass filtered ECG. Therefore, we define the QRS-onset as minimum value of band-pass filtered ECG between δ and detected QRS-complex (as shown algorithm in Figure 1(b)).
T-end Determination based on Maximum ROI Limit (MROIL)
We propose T-end determination based on MROIL (T-end1). Firstly, the QRS-complex and P-wave in ECG signal are removed. Then, the output signal is passed through processes as described in Figure 3. ROI on the T-end determination is shown in Figure 2(b). T-end is defined as Δ’s position in the ROI.
T-end Determination Using Additional-Line
Additional-line from T-peak to a point beyond the expected inflection point of T-end is drawn to determine the end of T-wave (T-end2). The maximum distance of point on additional-line to point of ECG signal is defined as T-end [ 32 ]. This T-end determination is shown on Figure 4(a) and the algorithm is described in Figure 5. We make additional line from T-peak (xT,yT) to 100 ms after T-peak (xnp,ynp). For sampling rate 200 samples/s, the number of point (np) is 20. The point on additional line is defined as follows:
And the distance (l) of the additional line to point of ECG signal (xe,ye) is as following:
T-end Determination Using Derivative of ECG Signal
T-end determination using derivative of ECG signal (T-end3) is based on algorithm described in [ 23 ] with some modifications. In the first step, we derive ECG signal with derivative process as represented in section 2. Then, we determine the minimum limit (θ) and maximum limit (Θ) of T-peak and T-end searching area. The maximum value (Dmax), minimum value (Dmin) of derivative signal between θ and Θ, and mins are calculated to determine the morphology of T-wave. Furthermore, this T-end determination is shown on Figure 4(b) and the algorithm is described in Figure 6.
We use QT-interval measurement from the Physionet QT database to calculate our proposed QT-interval measurement. The reference of QT-interval measurement is obtained from annotation (.q1c) in the database hereinafter referred as QTM. We use T-end positions, which is based on T-end1, T-end2, T-end3, and T-end position from the annotation (T-endM) [ 22 ]. QT1, QT2, and QT3 are QT-interval measurement, which are based on T-end1, T-end2, T-end3, respectively. We use the same QRS-onset point to measure QT1, QT2, and QT3.
ECG Monitoring System
We implement the proposed method on Android application and our electrocardiogram monitoring system. We directly sample ECG data and measure QT-interval from 10 patients. The patient’s ECG is obtained from ECG module. Sampled ECG data is processed in microcontroller and sent to Android smartphone via Bluetooth Low Energy. Furthermore, ECG data is displayed and can be saved on Android smartphone. In general, the ECG monitoring system and the electrode configuration are shown in Figure 7.
Calculation of the System’s Performance
The performance of the QRS-complex detection is evaluated using accuracy (Acc), positive predictive (+P), and sensitivity (Se), which are determined by the number of true positive (TP), false negative (FN), false positive (FP), and total beat in one record (TB), as follows:
The performance of the QT-interval measurement is evaluated using Bland-Altman plots. The horizontal axis of Bland-Altman plot shows the mean value of two compared measurement (e.g. QTM and QT1), and the vertical axis shows the difference of these two compared measurements. Both axes are in second. The middle horizontal line in the plot shows bias. Bias is the mean of two compared measurements’ difference; the outer lines are the bias ±1.96 of two compared measurements’ standard deviation (SD).
Figure 8(a) shows raw ECG detrended (d), the output of low-pass filter process (L), high-pass filter process (H), derivative process (D), squaring process (S), moving average filter process (M), and thresholding process (T). The T-end determination process is shown in Figure 8(b).
In the T-end determination, the width of the window, N, in the moving average filter is very important. N should be approximately the same as T-wave’s width. Figure 9(a) shows the output of moving average filter with various value of N. As shown in Figure 9(a), the output of MAF has two peaks when N=10, which is too wide and merge with U-wave when N=40. Therefore, we test N between 20 and 30. Figure 9(b) shows T-end position with N’s value between 20 and 30. From Figure 9(b), we choose N=20. Hereafter, ROI is determined from threshold process.
Although we choose N so that there are no two peaks in one T-wave area, the variety of T-wave’s form causes MAF’s output in some ECGs, which has more than one peak in one T-wave area. It produces multiple Δ as shown in Figure 9(c). To prevent false definition of T-end, one best Δ must be selected. We choose Δ with the furthest position from detected R-peak (ri). But, if this Δ position is more than ri+125 points, we choose another Δ with closer position to ri. If there is no Δ in one RR-interval, as shown in Figure 9(d). α is updated with α=α-0.01. This process is looped until one Δ is found or maximum iteration is reached. T-end is defined as the middle point of two RR-interval if maximum iteration is reached before finding one.
Performance of proposed QT-interval measurement
QT1, QT2, and QT3 are compared and summarized with QTM in Bland-Altman plots. Figure 10( a, b and c) show the Bland-Altman plot of QT1, QT2, and QT3 is compared to the QTM, respectively. Based on these Bland-Altman plots, correlation coefficient (corrcoef) and range of 95% Limit of Agreement (LoA) are calculated. Table 1 shows the corrcoef and 95% LoA’s range of all measurements. It shows that the correlation coefficient of QT1 is outperforms QT2, and QT3. The 95% LoA’s range of QT1 is the lowest indicating QT1 is in better agreement with the QTM than the others.
|B: Bias, R: Range of 95% LoA, SD: Standard Deviation|
Performance of ECG Monitoring System
Figure 11 shows the Android application’s user interface when is receiving and displaying ECG. QT-interval measurement, which includes QRS-complex, QRS-onset, and T-end determination, is done in Android application. In addition to QT-interval measurement, the Android application is designed to calculate heart rate and save the ECG data into record.
Table 2 shows the accuracy (Acc), sensitivity (Se), and positive predictive (+P) of QRS-complex detection algorithm in the Android application. The corrcoef and range of 95% LoA (as shown in Table 1 that is denoted as Android) are obtained from plotting QT-interval measurement using Android application and our manual QT-interval measurement in the Bland-Altman plot.
|TB: Total beat in one record, TP: True positive, FP: False positive, FN: False negative, Acc: Accuracy, +P: Positive predictive, SE: Sensitivity|
This paper proposes an automatic QT-interval measurement based on ROI, which is a temporal window for analyzing the part or point in the ECG. For QT-interval measurement, we use and compare three algorithms to determine T-end. They are T-end1, T-end2, and T-end3. Furthermore, we calculate QT-interval using these T-end, which are denoted as QT1, QT2, and QT3.
The difficulty of the determination of T-end2 is the T-wave’s peak, which must be identified first to determine the T-end, so the algorithm must be able to recognize and identify abnormalities of T-wave. The presence of arrhythmia makes the difficulty arise, because it causes the T-end not to be in the expected position. The flattened T-wave and T-wave with small amplitude also make the detection of T-end difficult. The algorithm of T-end3 determination can detect four different forms of T-wave; they are normal T-wave, inverted T-wave, only downward or only upward T-wave [ 23 ].
ROI is generated using moving average filter, demarcating the searching areas of QRS-complex and T-end. In other studies, region of interest is called block of interest [ 33 - 35 ]. Block of interest is used for detection of QRS-complex [ 33 ], T-wave [ 35 ], and systolic waves in photoplethysmograms [ 34 ]. Elgendi et al. use moving average to emphasize T-wave area [ 35 ].
Corrcoef, bias, and standard deviation for the QT1, QT2, and QT3 compared to QTM are calculated. The corrcoef is used for examining the direction and strength of two compared variables’ relationship. The corrcoef’s range is from -1 to 1. The strength of two compared variables’ relationship is measured from the absolute value of this correlation coefficient. If correlation coefficient gets closer to the value of 1, the relationship between two measurement will be stronger. The corrcoef of QT1 compared to QTM is the highest among the others. Therefore, QT1 has the closest correlation to QTM. The analysis of Bland-Altman is an appropriate way to perform comparison between two measurement methods and determine whether the proposed or new method is able to be agreed on [ 36 ]. The bias and standard deviation are obtained from the Bland-Altman plot. They are used for calculating range of 95% LoA. Range of 95% LoA is different from Bias + 1.96 SD and Bias - 1.96 SD. The smaller range between these two limits leads into the better agreement [ 37 ].
A new automatic QT-interval measurement method for ECG monitoring system using smartphone is presented in this article. The performance of the method is compared to other methods and summarized in Bland-Altman plots. The proposed method provides higher performance in which the range of 95% LoA lower than the other methods. It shows, which the method reliably calculates the QT-interval and has better agreement compared to the other measurement methods. The proposed method also has higher corrcoef, showing the higher relationship strength to the manual measurement. The proposed method is successfully implemented in ECG monitoring system using Android smartphone.
Conflict of Interest
- Shaikh MU, Ahmad SA, Adnan WA. Investigation of Data Encryption Algorithm for Secured Transmission of Electrocardiograph (ECG) Signal. IEEE-EMBS Conference on Biomedical Engineering and Sciences (IECBES). IEEE: Sarawak, Malaysia, Malaysia; 2018. DOI
- Nuryani SL, Nguyen HT. Electrocardiographic T-wave peak-to-end interval for hypoglycaemia detection. Conf Proc IEEE Eng Med Biol Soc. 2010; 2010:618-21. DOI
- Ashtiyani M, Navaei Lavasani S, Asgharzadeh Alvar A, Deevband MR. Heart Rate Variability Classification using Support Vector Machine and Genetic Algorithm. J Biomed Phys Eng. 2018; 8(4):423-34. Publisher Full Text | PubMed
- Anderson HN, Bos JM, Haugaa KH, Morlan BW, Tarrell RF, Caraballo PJ, Ackerman MJ. Prevalence and outcome of high-risk QT prolongation recorded in the emergency department from an institution-wide QT alert system. The Journal of Emergency Medicine. 2018; 54(1):8-15. DOI
- Niemeijer MN, Van Den Berg ME, Eijgelsheim M, Rijnbeek PR, Stricker BH. Pharmacogenetics of drug-induced QT interval prolongation: an update. Drug Safety. 2015; 38(10):855-67. DOI
- Funck-Brentano C, Ouologuem N, Duparc S, Felices M, Sirima SB, Sagara I, Soulama I, Ouédraogo JB, Beavogui AH, Borghini-Fuhrer I, Khan Y. Evaluation of the effects on the QT-interval of 4 artemisinin-based combination therapies with a correction-free and heart rate-free method. Scientific Reports. 2019; 9(1):1-8. DOI
- Zong W, Saeed M, Heldt T. A QT interval detection algorithm based on ECG curve length transform. 2006 Computers in Cardiology. IEEE: Valencia, Spain; 2006.
- Wu CY, Chiu HW. A semi-automatic QT interval measurement based on digital filters. 2006 Computers in Cardiology. IEEE: Valencia, Spain; 2006.
- Chudacek V, Huptych M, Novak D, Lhotska L. Automatic QT interval measurement using rule-based gradient method. 2006 Computers in Cardiology. IEEE: Valencia, Spain; 2006.
- Kasamaki Y, Ozawa Y, Ohta M, Sezai A, Yamaki T, Kaneko M, Watanabe I, Hirayama A, Nakayama T. Automated versus manual measurement of the QT interval and corrected QT interval. Annals of Noninvasive Electrocardiology. 2011; 16(2):156-64. DOI
- Panicker GK, Karnad DR, Natekar M, Kothari S, Narula D, Lokhandwala Y. Intra-and interreader variability in QT interval measurement by tangent and threshold methods in a central electrocardiogram laboratory. Journal of Electrocardiology. 2009; 42(4):348-52. DOI
- Oresko JJ, Jin Z, Cheng J, Huang S, Sun Y, Duschl H, Cheng AC. A wearable smartphone-based platform for real-time cardiovascular disease detection via electrocardiogram processing. IEEE. 2010; 14(3):734-40. DOI
- Al-Mardini M, Aloul F, Sagahyroon A, Al-Husseini L. Classifying obstructive sleep apnea using smartphones. Journal of Biomedical Informatics. 2014; 52:251-9. DOI
- Kakria P, Tripathi NK, Kitipawang P. A real-time health monitoring system for remote cardiac patients using smartphone and wearable sensors. International Journal of Telemedicine and Applications. 2015; 2015:1-11. DOI
- Hu J, Cui X, Gong Y, Xu X, Gao B, Wen T, Lu TJ, Xu F. Portable microfluidic and smartphone-based devices for monitoring of cardiovascular diseases at the point of care. Biotechnology Advances. 2016; 34(3):305-20. DOI
- Elgendi M, Eskofier B, Dokos S, Abbott D. Revisiting QRS detection methodologies for portable, wearable, battery-operated, and wireless ECG systems. PloS One. 2014; 9(1):e84018. Publisher Full Text | DOI | PubMed
- Smaoui G, Young A, Abid M. Single scale CWT algorithm for ECG beat detection for a portable monitoring system. Journal of Medical and Biological Engineering. 2017; 37(1):132-9. DOI
- Liu SH, Wang JJ, Su CH, Tan TH. Development of a patch-type electrocardiographic monitor for real time heartbeat detection and heart rate variability analysis. Journal of Medical and Biological Engineering. 2018; 38(3):411-23. DOI
- Brucal SG, Guemo JR, Montante SJ, Ng CA, Wong DJ. A Development of a Low-Cost 12-Lead Electrocardiogram Monitoring Device Using Android-based Smartphone. 7th Global Conference on Consumer Electronics (GCCE). IEEE: Nara, Japan; 2018. DOI
- Lin CC, Liou YS, Zhou Z, Wu S. Intelligent Exercise Guidance System Based on Smart Clothing. Journal of Medical and Biological Engineering. 2019; 39(5):702-12. DOI
- Wu T, Redouté JM, Yuce M. A Wearable, Low-Power, Real-Time ECG Monitor for Smart T-shirt and IoT Healthcare Applications. Springer International Publishing; 2019. DOI
- Goldberger AL, Amaral LA, Glass L, Hausdorff JM, Ivanov PC, Mark RG, Mietus JE, Moody GB, Peng CK, Stanley HE. PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation. 2000; 101(23):e215-20. DOI
- Laguna P, Thakor NV, Caminal P, Jane R, Yoon HR, de Luna AB, Marti V, Guindo J. New algorithm for QT interval analysis in 24-hour Holter ECG: performance and applications. Medical and Biological Engineering and Computing. 1990; 28(1):67-73. DOI
- Pambudi Utomo T, Nuryani N. QRS peak detection for heart rate monitoring on Android smartphone. Journal of Physics Conference Series. 2017; 909(1): 012006. DOI
- Sharma T, Sharma KK. QRS complex detection in ECG signals using locally adaptive weighted total variation denoising. Computers in Biology and Medicine. 2017; 87:187-99. DOI
- Varanini M, Tartarisco G, Balocchi R, Macerata A, Pioggia G, Billeci L. A new method for QRS complex detection in multichannel ECG: Application to self-monitoring of fetal health. Computers in Biology and Medicine. 2017; 85:125-34. DOI
- Pan J, Tompkins WJ. A real-time QRS detection algorithm. IEEE Transactions on Biomedical Engineering. 1985; BME-32(3):230-6. DOI
- Belchandan AK, Deshmukh K, Kumar J. Removal of Noises in ECG Signal by using Digital FIR-IIR Filter in VHDL. Digit Signal Process. 2016; 8(5):135-9.
- Vishnubhotla R. Pre-processing of ECG signal for ambulatory use. NIU Eng Rev J. 2009; 1(2):7-11.
- Pan J, Tompkins WJ. A real-time QRS detection algorithm. IEEE Transactions on Biomedical Engineering. 1985; 32(3):230-6. DOI
- Miljković N, Popović N, Djordjević O, Konstantinović L, Šekara TB. ECG artifact cancellation in surface EMG signals by fractional order calculus application. Computer Methods and Programs in Biomedicine. 2017; 140:259-64. DOI
- Zhou SH, Helfenbein ED, Lindauer JM, Gregg RE, Feild DQ. Philips QT interval measurement algorithms for diagnostic, ambulatory, and patient monitoring ECG applications. Annals of Noninvasive Electrocardiology. 2009; 14(1):S3-8. DOI
- Elgendi M. Fast QRS detection with an optimized knowledge-based method: Evaluation on 11 standard ECG databases. PloS One. 2013; 8(9):e73557. Publisher Full Text | DOI | PubMed
- Elgendi M, Norton I, Brearley M, Abbott D, Schuurmans D. Systolic peak detection in acceleration photoplethysmograms measured from emergency responders in tropical conditions. PLoS One. 2013; 8(10):e76585. DOI
- Elgendi M, Eskofier B, Abbott D. Fast T wave detection calibrated by clinical knowledge with annotation of P and T waves. Sensors. 2015; 15(7):17693-714. Publisher Full Text | DOI | PubMed
- Doğan NÖ. Bland-Altman analysis: A paradigm to understand correlation and agreement. Turkish Journal of Emergency Medicine. 2018; 18(4):139-41. DOI
- Myles PS, Cui JI. Using the Bland–Altman method to measure agreement with repeated measures. BJA. 2007; 99(3):309-11. DOI