Study on Real-time Monitoring Technique for Cardiac Arrhythmia ...

2 downloads 774 Views 529KB Size Report
analyzes ECG signals using arrhythmia monitoring software on a smartphone, provides ..... The IP address, port number, and the current time are shown by the ...
Journal of Medical and Biological Engineering, 33(4): 394-399

394

Study on Real-time Monitoring Technique for Cardiac Arrhythmia Based on Smartphone Jian Weng

Xing-Ming Guo*

Li-Shan Chen

Xiao-Rong Ding

Zhi-Hui Yuan

Ming Lei

College of Bioengineering, Chongqing University, Key Laboratory of Biorheological Science and Technology, Ministry of Education, Chongqing 400044, China Received 3 Sep 2012; Accepted 12 Nov 2012; doi: 10.5405/jmbe.1278

Abstract Electrocardiography (ECG) monitoring is an important method for cardiac disease detection and prevention. With the development of telemedicine, ECG real-time monitoring becomes more convenient. The rise and popularization of smartphone provide a new technical means for ECG monitoring. This paper focuses on the development of software for an ECG monitoring system on a smartphone platform. The system includes a client and a center. The client is developed on smartphone. Its main function is process and diagnose ECG signal. A wavelet method is used to detect the QRS-complex and diagnostic criteria are formulated to diagnose 14 kinds of arrhythmia disease. The tele-monitoring center is developed on a PC with LabVIEW, which receives ECG signal and diagnosis from smartphone by GPRS. Results show that the system can monitor ECG and diagnose arrhythmia by calculating the heart rate in real time. The proposed system is reliable and gives good real-time performance. Keywords: Smartphone, Tele-monitoring, Arrhythmia, Intelligent diagnoses

1. Introduction Cardiovascular disease is a major cause of death. Electrocardiography (ECG) monitoring is a useful method for the detection and prevention of cardiovascular disease. ECG reflects the electrical activity of the heart. Heart disease can be detected and diagnosed by analyzing the characteristic values of ECG signals. Arrhythmia is an extremely common cardiac abnormality [1]. Analyses of the QRS complex and its durations and RR intervals can be used to diagnose some kinds of arrhythmia symptoms. Telemedicine combines computer science, communication technology, and medicine. Many portable monitoring systems are designed for biomedical-signal monitoring [2]. Telemedicine ECG monitoring systems based on wireless communication are widely researched. In many studies, ECG signals are transferred by telemedicine system via telephone network [3]. Winkler et al. evaluated the feasibility of a wireless telemonitoring system to transmit ECG, blood pressure, body weight and self-assessment via a mobile phone network [4]. Yu and Liu evaluated practical value of wireless real-time ECG monitoring system in people test [5]. Elena et al. developed a * Corresponding author: Xing-Ming Guo Tel: +86-23-65112676; Fax: +86-23-65102507 E-mail: [email protected]

GPRS/GSM-based remote ECG monitoring system [6]. Other groups have also researched telemedicine systems based on GPRS [7-9]. 3G- technology-based telemedicine systems have been developed [10]. Zhou et al. implemented a time domain algorithm for ECG analysis on smartphone [11]. Wen et al. proposed an ECG telemonitoring system based on mobile phone, which transmits abnormal heartbeats in real time by using MMS on GPRS [12]. Most previous studies focused on the signal transmission between smartphones and servers, ignoring the applications on smartphones, especially those for preliminary diagnosis and transmission, display, and alarm for diagnosis. Smartphones are a suitable candidate for tele-monitoring. Smartphones usually have a large screen and wireless internet connectivity, making them suitable for home use monitoring [13]. This paper develops a software system that automatically analyzes ECG signals using arrhythmia monitoring software on a smartphone, provides preliminary diagnosis of heart rhythm, detects abnormal ECG signals in real time, and transmits ECG signals and diagnosis results to a remote monitoring center for follow-up processing. The proposed system provides a simple solution for home monitoring.

395

J. Med. Biol. Eng., Vol. 33 No. 4 2013

2. Materials and methods 2.1 System design Generally, telemedicine systems include three parts: client nodes, a communication network, and a remote monitoring center. A system structure diagram is shown in Fig. 1. The users are the specific population who need a medical service. The client is designed for signal collection, analysis, and transmission. In this system, the client includes signal acquisition nodes and center processing nodes. The signal acquisition node is a wearable sensor that is used to gather user ECG signals. A smartphone functions as the center processing node to receive ECG signals, conduct analysis, and give preliminary diagnosis results. The diagnosis results and physiological data are transmitted to the server of the remote monitoring center. Wireless communication is adopted between the central processing nodes and signal acquisition nodes.

A block diagram of the software client is shown in Fig. 2. The core is the control and processing model, which controls the ECG data transmission by the GPRS module and the display by the real-time display module. It also controls the wavelet processing module, parameter extraction module, and arrhythmia module to process, identify, and diagnose ECG data. The diagnosis is displayed by the real-time display module and sent to the remote monitoring medical center by the GPRS module. 2.2 ECG processing Figure 3 shows a flow chart of the algorithm on the smartphone. ECG signal

Mexican-hat wavelet

Locate R peaks database

monitoring platform

display module

alarm module

diagnosis module

processing module

bluetooth communication

conditioning circuits

wearable sensors

measurement node

GPRS

rr, Rri and W

smart-phone data

remote medical monitoring center central data processing node center

Figure 1. Block diagram of wearable wireless telemedicine system.

The remote monitoring center terminal is usually located in a medical center, and is mainly used to manage all user information. It allows doctors to monitor, diagnose, and analyze diseases in real time. The communication network of a wireless telemedicine system consists of a mobile communication network and the Internet. In this system, the client communication module runs in center processing nodes, which mainly use GPRS/GSM to access the Internet and the monitoring center. In order to guarantee the security and integrity of data transmission, point- to-point communication with the TCP protocol is used. ECG data

control and processing module

diagnosis

parameter extraction module arrhythmia detection module

GPRS module alarm signal

wavelet processing module

Diagnose AF, arrest, VPB, APB, R on T and missing beat Y

abnormal

client

Real-time display module

Slope-based method to locate Q onset and S offset

remote medical monitoring center

Figure 2. Block diagram of software client.

N HR

Diagnose Tachycardia and Bradycardia

abnormal

Y

Alarm

N Show results

Figure 3. Flow chart of algorithm on smartphone. Rri: RR interval; rr: average of four normal RR intervals; W: duration of QRS complex; HR: heart rate; AF: atrial fibrillation; APB: atrial premature beat; VPB: ventricular premature beat.

2.2.1 Wavelet transform for ECG processing Generally, ECG signals are rhythmic, which provide a macro record of the depolarization and repolarization process of heart cells [14]. There are 12 leads in a standard ECG, namely six chest leads (V1 to V6) and six limb leads (I, II, III, aVR, aVL, and aVF). Here, the single-lead system consists of three kinds of standard limb lead for the detection and diagnosis of the QRS complex. Wavelet analysis was first proposed by Mallat in 1988 [15]. The wavelet transform is a time-frequency analysis

Arrhythmia Monitoring Technique Based on Smartphone

method, which can express the local characteristics of a signal in both the time and frequency domains. It is suitable for detecting anomalies in a normal signal, allowing useful information to be extracted from the signal. Wavelet analysis is very suitable for the time-frequency analysis of non-stationary signals. Therefore, it is widely used in the biomedical engineering area with good results [16]. The wavelet transform includes the continuous wavelet transform (CWT), the discrete wavelet transform (DWT), and the fast wavelet transform (FWT). The CWT is fit for signal analysis, whereas the DWT is used for signal coding. The former is used for ECG signal analysis in this paper. The CWT is defined as: 1 |a|

W f (a, b) 





f (t ) * (



t b )dt a

(1)

where a is the scale factor with conditions that a∈R and a ≠ 0, b is the time factor, and ψ is the mother wavelet. ψa,b(t) is defined as: t b  a,b (t )    a  a  1

(2)

f (t )



1

 (

a

0 -2 0

2

4

6

8

10

12

14

10

12

14

8

10

12

14

8

10

12

14

8

10

12

14

8

10

12

14

8

10

12

14

8

10

12

14

Mexican-hat

W f (a, b)  f (t ), a ,b (t )   

AD203,5000 points 2

10

The CWT can be calculated as:



selection. The first 5000 points data of AD203 in the MIT/BIH arrhythmia database were used for testing wavelets in terms of noise elimination, baseline drift elimination, and characteristic value extraction. The results are given in Fig. 4. As shown in the figure, AD203 has a lot of noise with a baseline drift. However, all 7 wavelets were able to extract useful characteristic values from the signal and remove noise and the baseline drift. According to the performance of these wavelets, the Mexican-hat wavelet transform was chosen in this paper to locate the QRS complex due to its superior characteristic extraction. The same data were then tested using the Mexicanhat wavelet transform at scales of 1 to 9 and the maximal inhibition of noise was achieved at scale 4 to 6. With increasing scale, the negative R peaks gradually weakened, which become different to identify. And the signal began to lose some amplitude information. The Mexican-hat wavelet transform at scale 4 was thus chosen to process the ECG signals. amplitude

396

 

0 -10 0

f (t ), a.b (t )dt

t b )dt a

(a  0, f  L2 ( R))

(3)

2

4

6

8

Daubechies 5 0 -5 0

2

4

6

Let f(t)=f (k⊿t), t∈(k,k+1). Then: Haar

W f ( a, b) 

 k



 k

a

k 1

f (t ) a

1 2

k k 1

f (k ) a

1 2



 f (k )  k

t b    dt  a 

1 2

k

5 0 -5 0

t b    dt  a  t b    dt   a 

k 1 

(4)



k

t b     dt   a  



The above equation can be performed using fast convolution, which can be accomplished in the time or frequency domain. The proposed wavelet transform program is developed from Eq. (1) to (4). The steps of the wavelet transform are:

2

4

6 Meyer

5 0 -5 0

2

4

6 Morlet

5 0 -5 0

2

4

6

Guassian 10 0

(1) Read signal s. (2) Convolve s with filter Lo_D to obtain the approximation coefficient cA1, and then convolve s with filter Ho_D to obtain the detail coefficient cD1. (3) Split the approximation coefficient cA1 in two parts using the same scheme, replacing s by cA1, producing cA2 and cD2, and so on, until cAj + 1 and cDj + 1 are obtained. (4) The wavelet decomposition of the signal s analyzed at level j has the following structure: [cAj, cDj, ..., cD1]. The choice of the optimal wavelet basis is very important in wavelet analysis. The selection of the wavelet basis is determined by the error between the results achieved from the signal processing using wavelet analysis and theoretical results. In this paper, 7 kinds of wavelets are tested for wavelet basis

-10 0

2

4

6 Symlets

5 0 -5 0

2

4

6 t/s

Figure 4. Comparison of various wavelets.

2.2.2 QRS complex location The QRS complex was detected with the dynamic threshold method because the characteristic value changes a lot in ECG. In order to ensure the processing is real-time, minimum data is used once. To detect the RR interval and RR interval variations, each test cycle included at least 3 R waves.

J. Med. Biol. Eng., Vol. 33. No. 4 2013

The lower limit of the normal heart rate of ordinary people is generally 60, so the test cycle was set to 3 seconds. The average value of 100 minimum values of the 3-second signal is defined as ‘min_aver’, and the average value of 8 maximum absolute values is defined as ‘max_aver’. The threshold s is defined as: s  30%(max_ aver  min_ aver )

(5)

With ceaseless revising of threshold, the method can accurately locate the R peaks. The Q-wave onset and S-wave offset are detected using a slope-based method. From the detected R peak, the search proceeds backward within a predefined boundary to locate the minimal point. From this minimal point, the method keeps searching backward to locate the maximal point. This maximal point corresponds to the Q-wave onset in the raw signal. The S-wave offset can be searched forward from the R peak using the same method. Figure 5 shows the results of QRS complex location. amplitude/mv

1

0

-1 0

0.5

1

1.5

2

2.5

3

0.5

1

1.5 t/s

2

2.5

3

1

0

-1 0

397

Missing beat: RR > 1.5 rr; Atrial premature beat: RR < 0.75 rr and W ≤ 120 ms or RRi + RRi + 1 < 2 rr; VPB: RR < 0.75 rr and W > 120 ms and RRi + RRi + 1 ≥ 2 rr; Interpolated VPB: RRi < 0.67 rr and W > 120 ms and 0.9 rr ≤ RRi + RRi + 1 ≤ 1.1 rr; VPB in pairs: Two consecutive VPBs; Paroxysmal ventricular tachycardia: Three or more consecutive VPBs; Ventricular bigeminy: Two or more consecutive alternating normal and VPBs; Ventricular trigeminy: Two or more consecutive alternating normal, normal, and VPBs; R on T: 0.2 s < RRi < 0.33 rr 2.2.4 Center terminal The arrhythmia monitoring center, a monitoring platform, is built based on LabVIEW. Its functions include receiving ECG data and diagnosis, display and alarm. The arrhythmia monitoring center communicates with the smartphone platform via the GPRS network. A TCP connection is used, where the monitoring center and the smartphone are acted as the client and the server, respectively. In the diagnosis, a premature beat includes atrial premature beat, VPB, and interpolated VPB, VPB in pairs, paroxysmal ventricular tachycardia, ventricular bigeminy, and ventricular trigeminy. The user interface, shown in Fig. 6, includes the ECG waveform display, alarm, information display, and network settings.

Figure 5. Test results of QRS complex location.

2.2.3 Diagnosis of some arrhythmia symptoms After the location of the R peak, Q-wave onset, and S-wave offset, RR intervals, RR interval variations, and QRS duration can be calculated for the diagnostic criteria definition. In this paper, symptoms of 14 kinds of arrhythmia were diagnosed. A premature beat, common in arrhythmia, includes the atrial premature beat, ventricular premature beat (VPB), interpolated VPB, VPB in pairs, paroxysmal ventricular tachycardia, ventricular bigeminy, ventricular trigeminy, and R on T. Atrial fibrillation is also very common and may lead to death. The heart rate is closely associated with the occurrence of cardiovascular disease. Tachycardia and bradycardia are risk factors of cardiovascular disease. Arrest and missing beats are very dangerous symptoms, which have a high mortality. After combining the characteristics of ECG waves using the above symptoms and clinical experience, the diagnostic criteria were defined with reference to related material [14]. RRdif denotes the interval difference. The diagnostic criteria are: Atrial fibrillation: RR > 1.5 s; Arrhythmia: RRdif > 0.12 s; Tachycardia: HR > 100; Bradycardia: HR < 60; Arrest: RR > 3 s;

Figure 6. Screenshot of server user interface.

The network communication module is used to establish a connection between the client and server by monitoring port 8888. A connection will be established and data transmission will begin after the client sends out an application. If the data received by the network communication module is ECG data, it is sent to the ECG waveform display module for processing and displaying. If the data is diagnosis information, it is sent to the alarm module for analysis and display. The alarm module includes some alarm lamps and an alarm record. The alarm lamp will be lit correspondingly when diagnosis information is received. The IP address, port number, and the current time are shown by the information display module. The IP address and port number are set by the user. The port number is used to

Arrhythmia Monitoring Technique Based on Smartphone

398

identify the monitor port when the network communication is established. The IP address is the local address. 2.3 Experiments In order to test the effectiveness and reliability of the proposed software system, the detection rate and diagnosis rate of QRS waves of ECG data from the MIT/BIH database on a smartphone were detected and analyzed. The algorithm of R wave detection was developed from Eq. (1) to (5) using Matlab (MathWorks, Natick, MA). A program for algorithm testing was developed on the same platform. ECG data used in this paper are from the MIT/BIH arrhythmia database, whose data are from the arrhythmia laboratory of Beth Israel Hospital recorded from 1975 to 1979. The database contains more than 4000 cases of dynamic ECG data [17]. It has 48 records from 47 individuals [18]. Define AD as serial number of ECG in the MIT/BIH database. ADs of data used are shown in results. Firstly, the monitor port was set to 8888 to test the communication can be established normally or not. Secondly, loading an ECG from smartphone to test overall functions, include display and alarm on smartphone and client are function normally or not. Test the communication between smartphone and client is real-time or not at the same time. Thirdly, ECG signals with many kinds of cardiac arrhythmia are loaded one by one to test the diagnosis and alarm function.

3. Results and discussion

Table 1. Results of QRS complex detection. AD 100 101 102 103 104 105 106 107 108 109 203 207 210 214 215 217

Heart beats 2273 1865 2187 2083 2229 2572 2027 2137 1763 2532 2980 1862 2650 2262 3363 2208

False or missed detection 1 0 0 2 2 0 2 1 2 2 10 5 1 2 0 1

Accuracy (%) 99.95 100.00 100.00 99.90 99.91 100.00 99.90 99.95 99.89 99.92 99.66 99.78 99.96 99.91 100.00 99.95

Figure 8. Test results displayed on smartphone.

R waves of ECG AD203 from the MIT-BIH database were detected with the proposed algorithm. The results are shown in Fig. 7. The results of detecting the QRS complex of ECG from the MIT-BIH database are given in Table 1. From the table, we can know that the algorithm has a high detection rate. However, misdiagnosis and missed diagnosis were also found. The main reason for misdiagnosis and missed diagnosis is the P wave being identified as the R wave when amplitude of the former is larger than that of the latter. The detection rate is a little worse when the ECG waveform has larger changes. The algorithm has sufficient accuracy.

Figure 9 shows the overall operating effect of the system, including client and server. The display and alarm on PC are almost the same as them on smartphone. Load different ECG data with many kinds of cardiac arrhythmia from the MIT/BIH database one by one to test this system, and the diagnosis from smartphone are correct. The system is reliable and real-time.

3

amplitude/mv

2 1 0 -1 -2 -3 0

10

20

30 t/s

40

50

60

Figure 7. Results of R wave detection for AD203.

Figure 9. Test results of software system.

The debugged software was downloaded to the smartphone. The test results show that both modules on smartphone operated normally. The ECG signal and diagnosis results are displayed on the smartphone, as shown in Fig. 8. In order to ensure real time of the system, measure the time that the algorithm used in one processing. 4 ECG data are used in this test. The results show that it just costs less than 0.15 seconds in one processing. So the algorithm is efficient.

A remote ECG monitoring platform based on smartphone was developed in this paper. The system includes a diagnosis algorithm, monitoring software, and a remote center terminal. Analysis, diagnosis, display, and alarms are implemented on the smartphone, which can communicate with a computer. The diagnostic results and the ECG signal are sent to the remote monitoring center for synchronous display and recording. The symptoms of 14 kinds of arrhythmia were diagnosed correctly

J. Med. Biol. Eng., Vol. 33 No. 4 2013

using the diagnostic criteria. This paper implemented more applications on smart-phone, especially preliminary diagnosis of ECG, which is most improved with prior researches. Results of tests show that the system is reliable and real-time.

[5]

4. Conclusion

[7]

This paper provides an implementation based on smartphone for portable medical diagnostic care, which applies to remote health care, especially to home health care. The algorithm developed in this paper can operation on different smartphone system, including Microsoft system and Blueberry system. So the method could be improved easily. In future work, expanding the automatic diagnosis algorithm, software functions, and database will be considered. Furthermore, developing a lightweight and convenient device for ECG acquisition, even streamlining this device into an accessory for smartphones, will improve portability.

[6]

[8]

[9]

[10] [11]

Acknowledgments

[12]

This project was supported by the Spring Sunshine Program, Ministry of Education, P. R. China (Z2004-1-55006) and by the Fundamental Research Funds for the Central Universities Project (CDJXS11230045).

[13]

References

[15]

[1] [2]

[3]

[4]

K. Y. Li and G. S. Hu, “Arrhythmia classification based on ECG analysis,” J. Tsinghua Univ., 49: 416-418+423, 2009. Z. B. Zhang, Y. H. Shen, W. D. Wang, B. Q. Wang and J. W. Zheng, “Design and implementation of sensing shirt for ambulatory cardiopulmonary monitoring,” J Med. Biol. Eng., 31: 207-216, 2011. M. Engin, E. Çağlav and E. Z. Engin, “Real-time ECG signal transmission via telephone network,” Measurement, 37: 167-171, 2005. S. Winkler, M. Schieber, S. Lücke, P. Heinze, T. Schweizer, D. Wegertseder and F. Koehler, “A new telemonitoring system intended for chronic heart failure patients using mobile telephone technology-feasibility study,” Int J Cardiol, 153: 55-58, 2011.

[14]

[16] [17]

[18]

399

Y. Yu and J. Liu, “Study on mobile phone based wireless ECG monitoring technology system typical demonstration applications,” Chin. J. Med. Instrum., 35: 11, 2011. M. Elena, J. M. Quero, S. L. Toral, C. L. Tarrida, J. A. Segovia and L. G. Franquelo, “CARDIOSMART: intelligent cardiology monitoring system using GPS/GPRS networks,” Proc. IEEE Conf. Ind. Electron. Soc., 4: 3419-3424, 2002. S. C. Voskarides, C. S. Pattichis, R. Istepanian, C. Michaelides and C. N. Schizas, “Practical evaluation of GPRS use in a telemedicine system in Cyprus,” Proc. IEEE EMBS Conf. on Inf. Tech. App. in Biomed., 1: 39-42, 2003. O. J. Gibson, P. E. McSharry and P. M. Hayton, “A mobile phone telemedicine system for the self-management of type 1 diabetes: results of randomized controlled trial and measures of glycemic control,” Proc. 5th Diabetes Tech. Meeting, 1: 356, 2005. C. Worringham, A. Rojek and I. Stewart, “Development and feasibility of a smartphone, ECG and GPS based system for remotely monitoring exercise in cardiac rehabilitation,” PloS one, 6(2): e14669, 2011. Y. C. Chu and A. Ganz, “A mobile teletrauma system using 3G networks,” IEEE T. Inf. Technol. Biomed., 8: 456-462, 2004. S. Zhou, Z. Zhang and J. Gu, “Time-domain ECG signal analysis based on smart-phone,” Proc. Int. Conf. IEEE EMBS, 2011: 2582-2585, 2011. C. Wen, M. F. Yeh, K. C. Chang and R. G. Lee, “Real-time ECG telemonitoring system design with mobile phone platform,” Measurement, 41: 463-470, 2008. M. N. Boulos, S. Wheeler, C. Tavares and R. Jones, “How smartphones are changing the face of mobile and participatory healthcare: an overview, with example from eCAALYX,” Biomed. Eng. online, 10: 24, 2011. D. C. Randall, ECG Interpretation, North Carolina: Hayes Barton Press, 2004. S. G. Mallat, “A theory for multiresolution signal decomposition: the wavelet representation,” IEEE T. Pattern Anal., 11: 674-693, 1989. M. Akay, “Introduction: Wavelet transforms in biomedical engineering,” Ann. Biomed. Eng., 23: 531-542, 1995. A. L. Goldberger, L. A. N. Amaral, L. Glass, J. M. Hausdorff, P. C. Ivanov, R. G. Mark, J. E. Mietus, G. B. Moody, C. K. Peng and H. E. Stanley, “PhysioBank, physioToolkit, and physionet: components of a new research resource for complex physiologic signals,” Circulation, 101: e215-e220, 2000. G. B. Moody and R. G. Mark, “The MIT-BIH arrhythmia database on CD-ROM and software for use with it,” in: A. Murray and K. L. Ripley (eds.), Computers in Cardiology 1990, Los Alamitos: IEEE Comput. Soc. Press, 185-188, 1991.