2013 IEEE International Conference on Green Computing and Communications and IEEE Internet of Things and IEEE Cyber, Physical and Social Computing
Improved P-T Algorithm Applied to a Wearable Integrated Physiological Parameters System Z.H.Xua.b, Z. Fanga*, Z. Zhaoa, X.X.Chena, D.L.Chena.b, F.M.Suna.b,L.D.Dua, Y.M.Qianc*, H.Y.Huic, L.L.Tianc a
(State Key Laboratory of Transducer Technology, Institute of Electronics, Chinese Academy of Sciences, Beijing 100190, China) b (Graduate University of Chinese Academy of Sciences, Beijing 100049, China) c (Navy General Hospital of PLA 100037, Beijing, China)
[email protected], {zfang, zhaozhan}@mail.ie.ac.cn,
[email protected],
[email protected]
any time and early treatment before the onset of disease is extremely necessary
Abstract—This paper presents a wearable physiological parameters monitoring device real time monitoring electrocardiograph (ECG), respiration, blood oxygen saturation, blood pressure, motion state and temperature continuously, online analysis and displaying the result in personal computer. Especially, Improved Pan-Tompkins Algorithm was embedded into wearable physiological parameters monitoring device to detect R peak, and further compute heart rate. Based upon the analysis of QRS frequency, the slope and the threshold decision, the improved algorithm can reliably recognize R peak of QRS complexes. Compared to the traditional Pan-Tompkins, there are three improvements. First one is accurately calculating heart rate even in a slow-moving state; another is wider sampling rate-500 and 1000 sampling rate or any other sampling rate; the last one is effectively avoiding the finite word-length effect during calculation in float type. The improved Pan-Tompkins algorithm makes ECG measurement more accurate and more flexible. Based on 20 volunteers’ experimental tests, the fully-integration system with improved Pan-Tompkins Algorithm can accurately monitor the real-time R peak and other physiological indicators in a calm status, even in slow-moving status the system works well.
Apparently, the existing hospital medical resources can’t satisfy such a anytime and anywhere demand, and as healthcare costs are increasing and other factors, there is an urgent need to monitor a health status while he is in his personal environment out of the hospital. To meet this demand, real-time wearable health care with improved Pan-Tompkins algorithm was designed. Improved Pan-Tompkins algorithm has three features:
Wider sampling rate-500 and 1000 sampling rate or any other sampling rate to make the measurement more accurate;
Effectively avoiding the finite word-length effect during calculation in float type.
The remainder of this article is divided as follows: section II presents related work; section III presents the device’s hardware design; section IV presents the algorithms; section V presents the analysis of the algorithms, results of above sections and conclusion.
INTRODUCTION
Cardiovascular and cerebrovascular diseases have become NO.1 killer. As cardiovascular and cerebrovascular disease has characteristics of high prevalence, high morbidity, high mortality and low awareness, low control rates and low cure rate, many people pay attention to the diseases until the onset of diseases, which leads to high death rate; even survived, most with loss of work ability.
II.
RELATED WORK
Real-time QRS complex Algorithm has drawn a lot of attention from the research community during the last decade as it is pointed out by the numerous and yearly increasing corresponding research and development efforts. The algorithms are mainly classified into two ideas: one is based on spectral considering band-pass filtering, derivation and the duration of the sliding window, i.e. Pan-Tompkins; the other is wavelet transforms [2], and with the developing of wavelet, the second generation wavelet appears. Besides, there are other several methods: [3] proposed “Difference Operation Method (DOM)” for detecting the QRS complex. The paper [4]
An ECG signal is the expression of the myocardium electrical activity on the body surface, which appears as a nearly periodic signal and contains much information about heart diseases. ECG signal contains P wave, T wave, QRS complex and U wave. Among these waves, QRS complex is the dominant feature of the ECG signal [1]. Monitoring electrocardiogram (ECG) and measurement of heart rate at * Corresponding author: Zhen Fang, E-mail address:
[email protected]. YangMing Qian, E-mail address:
[email protected].
978-0-7695-5046-6/13 $26.00 © 2013 IEEE DOI 10.1109/GreenCom-iThings-CPSCom.2013.323
Accurately detect R peak even in a slow-moving state;
With improved Pan-Tompkins algorithm, our wearable physiological parameters monitoring device accurately calculating heart rate blood oxygen saturation, blood pressure, motion state and temperature even in a slow-moving state.
Key words: QRS detection, R peak detection, heart rate, wearable physiological parameters monitoring device
I.
1756
Irregular wavelet function to approximate the sharp changes in the signal is clearly better than smooth sinusoidal, but computational intensive is not suitable for real-time monitoring mobile devices.
proposed the SVM algorithm to find the QRS points. The paper [5] proposed “geometrical matching approach”. In the following of this section, we will present classical PanTompkins algorithm and Wavelet Algorithm. A. Pan-Tompkins Algorithm Pan-Tompkins Algorithm is a real-time algorithm for detection of the QRS complexes of ECG signals. It reliably recognizes QRS complexes based on digital analyses of slope, amplitude, and width. Figure 1 shows the flow of PanTompkins Algorithm [6]. First, in order to reduce various types of interference in ECG signals, the signal passes a bandpass filter composed of one high pass filter and one low pass filter. The next process is derivation to obtain the information of slope in ECG signal, followed by squaring to intensify the slope of the frequency response and restrict interference caused by T-wave which may be higher than usual spectral energies. Moving-window integrator processes the signal with the information about both the slope and the width of the QRS complex. Adaptive threshold detects the R peak in ECG signal.
Figure 1 Pan-Tompkins Algorithm
Pan-Tompkins algorithm is simple and reliable adopting integer filter and suitable for real-time portable equipment, but the band pass filter has to be changed following with the sampling rate, as the main power spectrum is definite; and finite word-length effect appears in float type.
T
CP2102 Charging to Libattery; transfer data to PC
f (t ) ( scale, position, t ) dt
Li-Battery 890mAh
LT1962 Low-noise
STM32F405 Core: ARM CortexM4; high performance with DSP SPI
USART
Step2: translation of the “mother wavelet “with scale factor gives a family of basic functions called “daughter wavelets”.
Max8808 Charging to LiBattery; Low-Dropout
Step3: the convolution between the signal and a timescaled daughter wavelet.
TPS73230 AC output:3.3V Low-Dropout
ECG +Respiration module
I
Memory
SP
USART
USB
AR
Zigbee: Multi-point to Single point US
The architecture of the wearable node is depicted in Figure 2, which includes five function modules, i.e. the core processing unit, power, memory, transmission module and parameters acquisition module. Each hardware sub-circuit is isolated; power to the circuit can be turned on or off independently of the reset of the platform. This isolation provides a degree of robustness-in the event of a failure. For the practical convenience, the package with ECG cable and PPG probe illustrated in Fig. 3 is designed for our wearable system by using plastic material. The system board was embedded in the package. There are an ECG interface, blood oxygen interface, SD interface and power interface in the sidewall.
Bluetooth: single point to single point
Step1: a time limited wave (wavelet) is chosen to be a “mother wavelet”, set Ψ (scale, position, t), where scale means transform scale, position means pan position, t means time domain.
C ( scale, position)
HARDWARE DESIGN
A. Micro-controller sub-system: Each system is equipped with a micro-controller (MCU) which acts as a local control center for collecting and processing data, arbitrating sensor behavior, maintaining communication with the wireless module, and timing events. Since our system needs multi-parameter continuous detection, the entire software algorithm is embedded in the MCU.
B .Wavelet Algorithm Scaling and translating the mother wavelet is the mechanism by which the transform adapts to the spectral and temporal changes in the signal being analyzed [2], the transform function shows in equation (1). The wavelet transform following these steps.
III.
The main innovative hardware feature is high integration with electrocardiogram acquisition module, respiration acquisition module, blood oxygen acquisition module, temperature acquisition module, motion state acquisition module, and wireless communication module. The overview of system architecture is discussed in this section.
SPI
Motion detection module
SPI
Temperature detection module
SP I
Blood Oxygen module: SpO2, blood rate,PPG obtained
Figure 2: The architecture of system
Commonly used wavelet transform functions are Haar Wavelet, Quadratic Spline Wavelet, DB3 wavelet and Cubic Spline Wavelet [1].
A demand on computing speed and code memory size of MCU is higher. So we choose STM32F405, whose core is ARM 32-bit, cortex-M4 CPU with FPU, and no wait state execution from Flash memory, frequency up to 168MHz and
1757
DSP instructions. So an excellent performance is fully able to meet our requirements. B. ECG and Respiration sub-system: Real-time ECG signal is vulnerable to electromagnetic interference, then an EMI filter is needed, an amplifier to amplify the weak signal. Additionally, the right leg drive (RLD) block is used as a means to counter the common-mode interference in an ECG system as a result of power lines and other sources. To measures the chest lead signal, the signals coming from RA (right arm), LA (left arm) and LL (left leg) are needed to generate the Wilson Central Terminal (WCT).
E. Temperature sub-system: There is proportional relationship between temperature and thermal resistance. Determining the dynamic curve of thermal resistance obtain the temperature. F. wireless sub-system: Wireless communication module consists of two parts: Bluetooth and Zigbee. The Bluetooth module realizes reliable transmission between our device and mobile devices; and Zigbee builds network from multi-point to single-point to send and receive packets. IV.
ALGORITHMS
To meet real-time demand, we adopt the Pan-Tompkins algorithm based on spectral. The main power spectrum of the ECG is from 3Hz to 15Hz, the spectrum from motion artifact is from 2Hz to 6Hz, but spectrum of muscle noise covers all the range [7]. Before R peak detection, we need to obtain pure ECG signal with pre-processing, then R peak detection with Improved Pan-Tompkins algorithm. This section is divided into two subsections. Subsection A shows pre-processing, subsection B shows the improved Pan-Tompkins algorithm. A. Figure 3: The package with electrocardiogram cable and photoplethysmography probe
Pre-processing. Pre-processing is one band pass filter composing of one high pass filter and one low pass filter to reduce motion artifact and muscle noise.
Meanwhile, Respiratory impedance is proportional to lung volume. Based on the collected ECG data, the system tests, and converses, calculates the changing state of lung volume, and achieves the DC signal varying with respiratory impedance, finally result the respiratory rate. ECG and Respiration could be monitored simultaneously. In this condition, we choose ADS1294R with fully-integrated, respiration impedance measurement function, achieving three channels of ECG data in ECG-I, ECG-II, V1 and one channel respiration data at 250 samples per seconds. ADS1294R needs AC and DC voltage, shown in the architecture. C. SpO2 sub-system: The measurement of blood oxygen is based on the different absorptivity to red and infrared. A single photodiode in response to the red and infrared light receives light. Transimpedance amplifier generates the voltage proportional to the received light intensity. In order to reduce interference with each other, a time-multiplexed manner is usually applied in Red and infrared LED. D. Motion sub-system: The measurement of motion state is using the motion sensor to measure X-axis, Y-axis, Z-axis acceleration, thereby determining the motion state. Low power accelerometer CMA3000 is chose.
High pass filter is a comb filter with 0.5 Hz (-3dB) cut-off frequency and 50Hz notch frequency. Its Differential equation is shown in equation (2).
y(n) 0.969067 y(n 5) 0.984534 [ x(n) x(n 5)]
(2)
Low pass filter is 5-moving-average filter with cut-off frequency of 15Hz and 50Hz notch frequency. Its differential equation is shown in equation (3).
1 y (n) [ x(n) x(n 1) x(n 2) x(n 3) x(n 4)] (3) 5 B.
Improved Pan-Tompkins Algorithm The bandwidth of the traditional Pan-Tompkins Algorithm is 4.8 to 11.8 Hz. In frequency normalized principle, in 250 sampling rate conditions, the band-pass filter bandwidth is approximately [6 ~ 14.75] Hz; in 500 sampling rate conditions, the bandwidth of the band pass filter is about [12 ~ 29.5] Hz; in 1000 sampling rate conditions, the bandwidth of the band pass filter is about [24 to 58] Hz. The main power spectrum of QRS complex is [6~15] Hz. The traditional Pan-Tompkins Algorithm is designed for 200 sampling rate per second and greatly suitable for 250 sampling rate, but to 500 sampling rate or higher sampling rate, it does not work. To meet this demand, the algorithm was improved [Figure.4]. Improved algorithm is suitable for wider sampling rate, and 500 sampling rate and
1758
1000 sampling rate are commonly used, we show the whole filters in the following part at these sampling rate. High pass filter
Output
Low pass filter-I
Adaptive Threshold
Low pass filter-II Moving window Integrator
Frequency response curve [Fig.5]:
Single-order Low pass filter
Cut-off frequency of single-order low pass filter is 22 Hz, the delay is 3 samples, and amplitude is 7.
Derivation
Transfer function: Absolute
H ( z)
Figure 4 Improved Pan-Tompkins Algorithm
We also adopt band pass filter to reduce the various interference, and derivation obtains the information of slope in ECG signal, and adaptive threshold detects the R peak in ECG signal .There are four improvements.
Improved band pass filter separately suitable for wider sampling rate, and the band pass filter based on 500 samples per second and 1000 samples per second were given to obtain main QRS complex.
Two signal-order low pass filters instead of two-order low pass filter to avoid finite word-length effect.
Absolute instead of square to reduce computation.
Changing length of sliding window, which has close relationship with QRS width.
1 z 7 1 z 1
(7)
Differential function:
y ( nT ) y ( nT T ) x ( nT ) x ( nT 7T )
(8)
The following of this sub-section is divided into three parts. Part (1) shows the algorithm fit for 500 sampling rate; Part (2) shows the algorithm fit for 1000 sampling rate; Part (3) shows the main idea fit for any other sampling rate. Figure 5: High pass Amplitude-frequency at 500 samples, the two red dots
(1) The algorithm fit for 500 sampling rate (a) Band pass filter: Band pass filter compose of one high pass filter and two signal-order low pass filters.
represents two points of -3dB.
Frequency response function:
High pass filter
| H (e jwT ) ||
Cut-off frequency of high pass filter is 5.5 Hz, the delay is 39 samples.
1 1 z 79 79 1 z 1
(4)
(b) The length of sliding window In principle, the length of sliding window must vary in the range between 80ms and 100ms. And at 500 sampling rate, the length of sliding window from 40 to 50 is suitable. In our experiment, we adopt 46.
Differential function:
y (nT ) y (nT T ) x(nT ) / 79 x(nT 39T ) x(nT 40T ) x(nT 79T ) / 79
(5)
(2) The algorithm fit for 1000 sampling rate. (a) Band pass filter Band pass filter is composed by one high pass filter and one low pass filter.
Frequency response function:
| H (e jwT ) | 1
1 sin(79 / 2 w T ) | | 79 sin(1/ 2 w T )
(9)
Two single-order low pass filter cut-off frequency is 15.5 Hz, the delay is 6 samples, and amplitude is 49.Frequency response curve with two-order low pass filter [Fig. 6]:
Transfer function:
H ( z ) z 39
sin(7 / 2 w T ) | sin(1/ 2 w T )
(6)
High pass filter
Cut-off frequency of high pass filter is 5.5 Hz, the delay is 39 samples.
1759
Transfer function:
Figure 6: Low pass response at 500 samples/s and the green circles represent two positions of -3dB.
H ( z ) z 79
1 1 z 159 159 1 z 1
(10)
Differential function:
y(nT ) y(nT T ) x(nT ) /159 x(nT 799T ) x(nT 80T ) x(nT 159T ) /159
(11)
Frequency response function:
| H (e jwT ) | 1
1 sin(159 / 2 w T ) | | 159 sin(1/ 2 w T )
(12)
Figure 7: High pass Amplitude-frequency at 1000 samples, the two red dots represents two points of -3dB
Frequency response curve [Fig.7]:
Single-order Low pass filter
Cut-off frequency of single-order low pass filter is 21 Hz, the delay is 6.5 samples. Amplitude is 14. Transfer function:
H ( z)
1 z 14 1 z 1
(13)
Differential function:
y (nT ) y (nT T ) x(nT ) x(nT 14T )
(14)
Figure 8: Low pass Amplitude-frequency at 1000 samples, the two red dots represents two points of -3dB.
Frequency response function: | H (e jwT ) |
sin(14 / 2 w T ) sin(1/ 2 w T )
(b) The length of sliding window In principle, the length of sliding window must vary in the range between 80ms and 100ms. And at 1000 sampling rate, the length of sliding window from 80 to 100 is suitable. In our experiment, we adopt 90.
(15)
Two single-order low pass filter cut-off frequency is 15.5 Hz, the delay is 13 samples, and amplitude is 196.Frequency response curve with two signal-order low pass filter [Fig.8]:
(3) The main idea fit for any other sampling rate. As the main power spectrum of ECG is definite, the band pass filter and the length of sliding window have to vary with the sampling rate. In this sub-subsection, we present the common rules of band pass and the length of sliding window. (a) Band pass filter Band pass filter is composed of one high pass filter and one low pass filter. As the main power spectrum of QRS complex is [6~15] Hz, and cut-off frequency of high pass filter is 6Hz; the cut-off frequency of low pass filter is 15Hz. The common equation of high pass filter is shown in equation (16).
H hp ( z ) z m
1760
1 z (2m 1) 1 z 1
(16)
where m is one factor with the sampling rate, and higher sampling rate, the value of m is bigger. The delay is m samples. The common equation of low pass filter is shown in equation (17).
1 zR N H lp ( z ) ( ) 1 z 1
Figure 9(d): Signal after high pass filter
(17)
where R represents different polar points, which directly affects the bandwidth of filter; factor N represents the order of the filter, which affects attenuation of pass-band and stop-band. In order to avoid the finite word-length effect in float type, the implement of low pass filter should be divided into N oneorder low pass filter. The choice of factor R and N follows the sampling rate. The experiments show when R is higher than 20, the filter effect changes a little.
Figure 9(e): Signal after first single-order low pass filter
Figure 9(f): Signal after second single-order low pass filter
(b) The length of sliding window We set the sampling rate is T, the length of sliding window is W. According to the length of sliding window varying in the range between 80ms and 100ms, we obtain the relationship between T and W [equation (18)]
W1 W W2 , W1
Figure 9(g): Signal after derivation
80 4 T 100 T (18) , W2 1 1 1000 25 1000 10 T T Figure 9(h): Signal after absolute filter
V.
ANALYSIS, RESULTS AND CONCLUSIONS
A. Analysis of the algorithms In this subsection, we show the signals after the improved Pan-Tompkins Algorithm. Figure 9 shows the signals at 500 sampling rate after various filter with improved Pan-Tompkins Algorithm; Figure 10 shows signals at 1000 sampling rate after various filter with improved Pan-Tompkins Algorithm.
Figure 9(a)-(i): The signals at 1000 sampling rate after various filters
Figure 9(a): original signal;
Figure 10(a): Original signal
Figure 9(b):5-moving-average signal
Figure 10(b):5-moving-average signal
Figure 9(c): Signal after IIR filter
Figure 10(c): Signal after IIR filter
Figure 9(i): Signal after moving average filter
1761
C. Conclusions In this paper, we have presented a wearable medical monitoring system, which combines multi-parameter real-time measurement of vital signs, online analysis and link to TMF, especially to the real-time heart rate; we adopt improved PanTompkins Algorithm. Based on 20 volunteers’ experimental tests, the fully-integration system with improved PanTompkins Algorithm can accurately monitor the real-time R peak and other physiological indicators in a calm status, even in slow-moving status the system works well. In future, based on the current promising multiple parameters physiological system, abnormal heart rhythms on-line classification would be researched and developed.
Figure 10(d): Signal after high pass filter
Figure 10(e): Signal after first single-order low pass filter
Figure 10(f): Signal after second single-order low pass filter
Figure 10(g): Signal after derivation
Figure 11: Result of TMF Figure 10 (h): Signal after absolute filter
ACKNOWLEDGMENT
The paper is based on research funded through 863 Program under Grant no. 2013AA041201, 2012AA040506. REFERENCES [1]
Figure 10(i): Signal after moving average filter Figure 10(a)-(i): Signals at 1000 sampling rate after various filters
[2]
B. Result [3]
The result of wearable physiological parameters monitoring device with improved Pan-Tompkins Algorithm is displayed in “The Monitoring Flat (TMF)”, which is based on LabView platform running on a Windows PC, which monitors and reports the patient’s condition. The server software displays the current data in order of PPG, Respiration wave, 7 channel ECG in the left, and pulse rate, SpO2, heart rate, temperature, arterial blood pressure, venous pressure and PTT in order of right volume. Medical trials were performed on 20 volunteers. One result of TMF is shown in Figure 11.
1762
[4]
[5]
[6]
[7]
H.A.N. Dinh, D.K.Kumar, N.D.Pah, P. Burton, “Wavelets for QRS detection”, Australas. Phys. Eng. Sci. Med. Vol. 24, No 4, pp. 207211,2001 Berdakh Abibullaev, Hee Don Seo, “A new QRS detection method using wavelets and artificial neural networks”, J Med Sys., pp:683-691, , 2011 Yun-Chi yeh, Wen-June Wang, “QRS complexes detection for ECG signal: The Difference Operation Method”, Computer Methods and Programs in Biomedicine, pp. 245-254, 2008 S.S.Mehta, N.S.Lingayat, “Combined entropy based method for detection of QRS complexes in 12-lead electrocardiogram using SVM”, Computers in Biology and Medicine 38(2008), pp. 138-145 [K.V.Suarez, J.C.Silva, Y.Berthoumieu, P.Gomis, M.Najim, “ECG beat detection using a geometrical matching approach”, IEEE Trans. Biomed. Eng.,2007 Jiapu Pan, Willis J. Tompkins, “A real-time QRS detection algorithm”, IEEE Transations on Biomedical Engineering, vol. BME-32, pp. 230-236, March 1985 Nitish V. Thakor, John G. Webster, Willis J. Tompkins, “Estimation of QRS complex power spectra for design of a QRS filter”, IEEE Transations on Biomedical Engineering , vol. BME-31, pp. 702-706, November 1985