Wen-po Yao, Wen-li Yao, Min Wu, Tie-bing Liu
1. Nanjing General Hospital of Nanjing Military Command, Nanjing 210002, Jiangsu Province, China; 2.China University of Mining and Technology, Xuzhou 221116, Jiangsu Province, China
ICEHTMC 2015 特別供稿專欄
R Wave Extraction Based on the Maximum First Derivative plus the Maximum Value of the Double Search
Wen-po Yao1, Wen-li Yao2, Min Wu1, Tie-bing Liu1
1. Nanjing General Hospital of Nanjing Military Command, Nanjing 210002, Jiangsu Province, China; 2.China University of Mining and Technology, Xuzhou 221116, Jiangsu Province, China
編者按:2015年10月21日,《中國醫(yī)療設(shè)備》雜志社獨家承辦了“第一屆國際臨床工程與醫(yī)療技術(shù)管理大會”(ICEHTMC 2015),大會主席由美國FDA醫(yī)療設(shè)備顧問委員會主席、美國臨床醫(yī)學(xué)工程學(xué)會首任主席Yadin David先生和解放軍總醫(yī)院醫(yī)務(wù)部副主任、中國醫(yī)師協(xié)會臨床工程師分會會長周丹共同擔(dān)任。來自14個國家的臨床醫(yī)學(xué)工程學(xué)會的主席、23個國家的60多位醫(yī)學(xué)工程的領(lǐng)軍人物、世界衛(wèi)生組織醫(yī)療器械委員會的協(xié)調(diào)員及國內(nèi)580多位醫(yī)工專家與會交流,共同搭建世界臨床醫(yī)學(xué)工程的學(xué)術(shù)平臺。大會共征集了62篇臨床醫(yī)學(xué)工程領(lǐng)域的優(yōu)秀論文,主要包括醫(yī)療技術(shù)創(chuàng)新、醫(yī)療技術(shù)管理、醫(yī)療設(shè)備維修模式、標桿管理、醫(yī)療設(shè)備監(jiān)管及風(fēng)險管理方法、醫(yī)療設(shè)備評估和采購方法、醫(yī)療技術(shù)人員的職業(yè)化發(fā)展、醫(yī)療技術(shù)評估等8個主題。本刊自2016年第1期起開始刊登大會征集的優(yōu)秀稿件(每期1~2篇),分享醫(yī)學(xué)工程領(lǐng)域的最新動態(tài),以供同行參考。
R-wave detection is the main approach for heart rate variability analysis and clinical application based on R-R interval. The maximum f rst derivative plus the maximum value of the double search algorithm is applied on electrocardiogram (ECG) of MIH-BIT Arrhythmia Database to extract R wave. Through the study of algorithm's characteristics and R-wave detection method, data segmentation method is modified to improve the detection accuracy. After segmentation modification, average accuracy rate of 6 sets of short ECG data increase from 82.51% to 93.70%, and the average accuracy rate of 11 groups long-range data is 96.61%. Test results prove that the algorithm and segmentation method can accurately locate R wave and have good effectiveness and versatility, but may exist some undetected problems due to algorithm implementation.
heart rate variability; R-wave detection; f rst derivative
Heart rate variability (HRV) reflects subtle changes between the instantaneous heartbeats, containing important information about the cardiovascular system[1]. HRV, mainly represented by R-R interval currently, is influenced by many factors, such as blood pressure, body temperature and mental state. The accuracy of R-wave detection is a prerequisite for HRV analysis, so the R-wave detection plays an important part in clinical application and research of HRV.
R-wave detection method has developed from the early analog hardware circuits to digital technology and intelligent processing ways[2]. Currently, studies of electrocardiogram (ECG) waveform feature extraction and detection focus on time domain analysis, mathematical morphology, wavelet transform and several related directions[3-5]. Some solutions to ECG feature extraction are proved to be effective, such as f lter method, wavelet transform, empirical mode decomposition (EMD), mathematical morphology, and neural network method[6]. However, these solutions have some problems in QRS wave detection, such as high algorithm complexity, low accuracy, and poor real-time features. Hardware-based QRS wave detection methods have the advantage of speediness and simpleness in structure[7], but they are lack of flexibility in processing abnormal signal. In this contribution, the maximum f rst derivative and the maximum derivative method is applied to R wave detection for its novelty and advantages in detection accuracy.
After the introduction of HRV characteristics and itsclinical application, the latest method is used to extract R wave from ECG of the MIT-BIH Arrhythmia Database. And by adjusting the grouping way, the algorithm is optimized having better detection results.
Heart rate variability contains small fluctuations of the instantaneous heart rate, or the minor fluctuations of the R-R interval. HRV is an effective reflection of cardiac factors, providing powerful means of observing the interplay between the parasympathetic and sympathetic nervous systems[8]. HRV contains information about the heart's ability to adapt to the environment and the state of the autonomic nervous system (ANS). Compared to other physiological parameters, HRV has the characteristics of sensitivity and specif city as an effective operational indicator of cardiac autonomic nervous system[9]. Clinical applications and researches have proved that the noninvasive method is simple, quantitative, sensitive and has characteristic of repeatability.
In ECG analysis, QRS wave detection is important to medical diagnosis and scientific research, among which R wave has the largest part of ECG energy, and it is the key to the formation of HRV. R-R interval is the main generating method of HRV which has important significance for patients' early diagnosis, monitoring and treatment of some cardiovascular diseases.
3.1 Algorithm introduction
R wave detection is critical for HRV analysis. Related studies have shown that the maximum f rst derivative and the maximum derivative method can accurately locate R wave, and further determine the Q and S wave through searching around ECG wave groups. The algorithm can accurately get the position and amplitude of QRS wave whether abnormalities exist or not, providing the basis for ECG study.
3.2 Algorithm steps
Get the first derivative: Derivative to analog signals is difference to digital data. In order to reduce computation amount, the ECG data difference is computed by the previous value minus the after ones. According to the theoretical experience of ECG processing, descending branch of R wavegenerally has the largest absolute number.
Search forward for the maximum absolute number of f rst derivative: Firstly, set an initial small value which cannot be achieved according to experience. Searching range is 3 to 5 cardiac cycles from the starting point. Search result generally locates in the decline branch of R wave, assuming as Dmax.
Search for the local maximum of the first derivative: Setting a threshold such as DLmax=0.85Dmax, search forward for partial derivative values and stop when the condition is met. The search range is determined by the experience, generally no more than two cardiac cycles. In order to make the searching process f exible, condition is modif ed from '=' to '≥'. The point meeting the condition is def ned as PD1.
Determination of R peak position and amplitude: According to the searching strategy, PD1 generally locate in the decline branch of R wave, so the R wave should be searched backwards for the maximum point. The point PR1 meeting the condition is R wave def ned as ECS (PR1).
Search for P, Q, S, T wave: Search backward for the minimum point from, Q wave point meeting the condition will be marke d as PQ1; P wave, denoted as PP1, is the maximum point behind PQ1; S and T waves will be found through the similar method to searching Q, P wave, and they are denoted as PS1 and PT1 respectively.
MIT-BIH Arrhythmia Database[10,11]applied in this contribution contains 48 half-hour excerpts of two-channel ambulatory ECG recordings, obtained from 47 subjects studied by the BIH Arrhythmia Laboratory between 1975 and 1979. Twenty-three recordings were selected at random from 4000 24-h ambulatory ECG recordings, and the remaining recordings were chosen from patients suffering clinically significant arrhythmias. Sampling frequency is 360 Hz. About half (25 of 48 complete records, and reference annotation files for all 48 records) of this database has been freely available in PhysioBank website.
In R wave extraction test, 10 s segments of the whole ECG serial are applied to differential process. The differential data are split into 12 segments, each containing 300 data, for the subsequent signal processing. Through repeated tests and verification, Dmaxvalue is proved to be effective to be half of the maximum of the f rst derivative absolute value. Searching backwards for about 8 points from PD1, including PD1 itself, R wave will be found when a point's amplitude is the maximum. Q wave is the minimum point when search backwards for about15 points from R wave point, not including the point of PR1. We will get S wave point PS1 searching forwards the minimum point for a distance of about 10 points. Take No.100 dat as an example, QRS wave groups' detection results are shown separately in Figures 1 and 2 when the original ECG segments exclude and include outliers.
Figure 1 QRS wave group detection of electrocardiogram excluding outliers.
Figure 2 QRS wave group detection of electrocardiogram including outliers.
Four lines in Figure 1 and Figure 2 from left to right corresponds to PQ1, PR1, PD1 and PS1. As can be seen from the first two figures, the maximum first derivative plus the maximum value of the double search method can accurately locate QRS waves whether abnormal points exist or not, providing a foundation for further R wave detection and HRV analysis.
To further verify the validity and versatility of the algorithm, 6 sets of ECG data in MIT-BIH Arrhythmia Database containing atria premature abnormal points are applied to R wave detection tests. The 6 sets of ECG data and test results are shown in Table 1.
Table 1 R wave detection results of 6 sets of electrocardiogram with containing atria premature abnormal points
R wave detection accuracy is generally low, the average accuracy rate is 82.51% and the rate of No.209 is even as low as 68.75%. R wave detection results of 6 sets of data are not all right for the following reasons.
In some data segments there is not R wave between S and Q wave causing detection of wrong R wave, and the other reason is that searching range of R wave is not big enough. Through the analysis of test results and detecting process of algorithm, we f nd that each set of data has at least one R wave missed because of data segment method. Data preprocessing method in this contribution is based on segment units, causing analysis out of range when dealing with the last segment of the differential signal. So each last ECG waveform will not be processed.
With the above drawbacks, the accuracy of R wave detection is severely affected. To improve R-wave detection accuracy, we modify the algorithm's application by changing data segmenting method. The modified processing method is still based on segment while change the starting and ending points. Start of next segment is modif ed based on the position of S wave PS1, which is overlapping process method. In the test to MIT-BIH Arrhythmia Database, starting point of the next segment is the point search forward 50 points from PS1. In addition, increase the R wave searching range forwards a distance of 15 points to improve detection accuracy. Detection results are presented in Table 2 and detection accuracy rates of the two segmentation methods are compared in Figure 3.
Table 2 R wave detection results of modified segment method
As can be observed from Table 2, the modified segment method achieved good detection results. Accuracy rates of No.100, No.114 and No.200 are all 100%, rates of No.209 and No.223 improve from 78.57% and 68.75% to 87.50% and 92.85% respectively. To No.101 ECG data, detection results do not achieve any improvement for the following reasons. The reason for false detection is that there is no R wave in the rising range of S wave, but there is maximum point meeting the conditions. As for the missed R wave, there are two R waves in searching range but only the maximum one is selected resulting the smaller one missed. Test results of Table 2 are signif cantly better than the ones in Table 1, indicating that the modifiedsegment method is more preferable.
To further verify the practicability of the modified data segments overlapping method, 30 min long-range ECG are applied to the analysis and test results are given in Table 3.
Figure 3 Detection accuracy rates of the two segmentation methods.
Table 3 R wave detection results of long-range electrocardiogram
Test results in Table 3 indicate that, for the long-range ECG signal, the improved method also achieves good detection results. The average accuracy rate of 11 test groups is 96.61%, among which test on No.103 ECG data show that all of R waves are accurately detected. Conclusion will be drawn according to the overall test results that the maximum first derivative plus the maximum value of the double search can applied to R wave detection and the modif ed data segment overlapping method is feasible.
HRV analysis as an indirect measurement of cardiac regulatory function, has been widely used in clinical diagnosis and research because of its simple, non-invasive, quantitative and repeatable characteristics. Based on the analysis of the maximum f rst derivative plus the maximum value of the double search algorithm and R-wave detection tests, we modify the data segmentation method to improve the detection accuracy.
In the analysis of 6 sets of R-wave detection and 11 groups of long-range ECG experiments, the modified method show advantages in detection accuracy, but does not have ideal results when there are abnormal points. The two detection methods both cannot correctly identify the R waves when No.220 ECG contains atrial premature abnormal points. In No.220 ECG fragment there are 8 abnormal outliers, detection accuracy rates are both 62.5%, indicating that the modif ed segmenting method does not have any improvement in detection accuracy. The algorithm can also locate Q and S waves, but searching range should be adjusted accordingly due to differences between the ECG signal. In addition, through analysis of multiple sets of test results, we f nd that the majority of false detection occurs behind the existence of outliers. So relevant HRV determination methods and the applications in clinical diagnose still need to be improved and explored.
Experimental results show that the maximum first derivative of plus double the maximum search algorithm can accurately detect the R-wave, when the division during the data segment should be divided using overlapping methods, but in some special case may have undetected problems. The overlapping method improves the original algorithm in the accuracy of R wave detection, but when the ECG contains premature atrial outliers, the improved method does not play signif cant roles. Test results show that the algorithm still miss some R wave, so to further improve the accuracy of R wave detection will be the next research direction.
This work was supported by the National Natural Science Foundation of China (Nos. 61271082, 61201029, 81201161).
[REFERENCES]
[1] Kleiger RE,Stein PK,Bigger JT.Heart rate variability:measurement and clinical utility.Ann Noninvasive Electrocardi ol,2005,10(1):88-101.
[2] Nagin VA,Selishchev SV.Implementation of algorithms for identification of QRS-complexes in real-time ECG systems. Biomed Eng,2001,35(6):304-309.
[3] PanJ,TompkinsWJ.A real-time QRS detection algorithm.IEEE T Bio-med Eng,1985,32(3):230-236.
[4] Trahanias PE.An approach to QRS complex detection using mathematical morphology.IEEE T Bio-med Eng,1993,40(2):201-207.
[5] Zheng C,Tai C.Detection of ECG characteristic points using wavelet transforms.IEEE T Bio-med Eng,1995,42(1):20-28.
[6] Khiari B,Ben Braiek E,Jemni M.R-wave detection using EMD and bionic wavelet transform.Electrical Engineering and Software Applications (ICEESA).International Conference onIEEE,2013:1-5.
[7] Cvikl M,Jager F,Zemva A.Hardware implementation of a modified delay-coordinate mapping-based QRS complex detection algorithm.Eurasip J Adv Sig Pr,2007,(1):104.
[8] Rajendra AU.Heart rate variability:a review.Med Biol Eng Comput,2006,44(12):1031-1051.
[9] Saul JP.Beat-to-beat variations of heart rate ref ect modulation of cardiac autonomic outf ow. News Physiol Sci,1990,5(2):32-37.
[10] MIT-BIH Arrhythmia Database.Cited 2015-07-17.Available from: URL:http://physionet.org/physiobank/database/mitdb/
[11] Moody GB,Mark RG.The impact of the MIT-BIH arrhythmia database.IEEE Eng Med Biol,2001,20(3):45-50.
R540.4+1 [Document code] A
10.3969/j.issn.1674-1633.2016.10.001
1674-1633(2016)10-0001-04
Conf ict-of-interest statement: No potential conf icts of interest.
Wen-po Yao, Nanjing General Hospital of Nanjing Military Command, 305 Zhongshan East Road, Xuanwu District, Nanjing 210002, Jiangsu Province, China. njbull@163.com