Design and Realization of Signal Processing Platform of Multi-Parameter Wearable Medical Devices

This paper presents a design of new type of multi-parameter wearable medical devices signal processing platform. The signal processing algorithm has a QRS-wave detection algorithm based on LADT, wavelet transformation and threshold detection with TMS320VC5509 DSP system. The DSP can greatly increase the speed of QRS-wave detection, and the results can be practical used for multi-parameter wearable device detection of abnormal ECG.


Introduction
The multi-parameter wearable medical devices have physiological signal detection and processing modules, signal feature extraction and data transmission basic function modules which can implement a non-invasive detection and diagnosis on the human body.It generally has the characteristics of removable operation, easy to use, support long time of continuous work, the intellectualized display diagnostic results, abnormal physiological condition alarms and wireless data transmission, etc. [1].
The multi-parameter devices may be simultaneously monitoring electrocardiogram (ECG), respiration, body temperature, blood pressure, blood oxygen and other parameters.In order to achieve the purpose of demonstration, this paper focuses on the implementation process of the multi-parameter central monitoring.In the ECG signal analysis process, the QRS-wave detection is the most important issue.Not only the QRS-wave is the most important basis for diagnose the arrhythmia, but also only analyze other details information of ECG after the QRS-wave is determined [2][3][4][5][6][7][8].The linear approximation distance thresholding (LADT) algorithm was originally developed by Udupa and Murthy for preprocessing in syntax-directed ECG rhythm analysis.The LADT algorithm has shown more efficient performance than other piecewise linear approximation algorithms in respect to compression ratio and the quality of reconstructed ECG.Therefore, LADT widely used in ECG signal processing, especially QRS wave detection [7].
During the process of ECG signal analysis process with LADT algorithm, due to the LADT algorithm is a compute-intensive algorithm that require long time for processing, so how to improve the processing speed of LADT algorithm is the key link during practical application.The drawback of use software (such as C++, Java) to implement the LADT algorithm is slower on the PC; this way can be used for algorithm simulation, so the general-purpose computer system with special accelerated processor were a feasible solution.By contrast, general-purpose programmable DSP chips have greater development flexibility which can easier to adapt to a variety of digital signal processing environment for sophisticated digital signal processing algorithms.With the development of digital signal processing and very largescale integration (VLSI) technology, single-chip digital signal processors become more powerful, price getting lower and lower, which are increasingly being applied to people in all areas of life.This paper describes the structure of a multi-parameter monitoring module based on DSP chip solutions of hardware architecture and software components.
DSP chips [9], also known as digital signal processors, since its invention in the early 1980 of the 20th century, in a short period of more than ten years have been rapid development.DSP chips is a processor or microcomputer with special structure whose hardware, software, and instruction sets are optimized for high-speed numeric processing applications an essential for processing digital data representing analog signals in real time.The DSP's high-speed arithmetic and logical hardware is programmed to rapidly execute algorithms modeling the filter transformation.As DSP chips cost performance and develop means of continuously improve, it has been in the communications and information systems, signal and information processing, automatic control, radar, military, aerospace, medical, household appliances, such as a wide range of applications in many areas.Therefore, this paper using DSP chips to form signal processing platform to meet design requirements.

Fast Realization of the LADT Algorithm
LADT algorithm first appears in Reference [7], was originally used for pretreatment of syntactic analysis, which is a method of data compression that is a fitting curve with the line, the fitting principle as shown in Figure 1.
Let  , 1,2, , be the ECG signal amplitudes, σ be the admissible distance error, and m 0 be the first trial distance.Define a distance function, d k , as follows. Let be the kth sample following an initial sample X i .For a fixed integer, m i , the values of the function d k are: where and The value d k of the distance function corresponds to the distance of the kth sample from the line joining the ith and the (i + m i )th samples as shown in Figure 1.
If max d   then the line joining the ith and (i + m i )th samples constitutes a line segment.Let i be the new value of i and repeat step 1, if , else stop.
The LADT algorithm is superior because it uses the distance error (rather than amplitude error) between the original sample point and the approximate segment as the criterion, which makes the approximation more reasonable that is consistent with the human eye in the habit of watching wave [10].The only problem is that the computation is too time-consuming, especially after the failure of the initial fitting, the calculation must be repeated that is difficult to achieve real-time.Therefore, the author uses a table look-up method complete fast realization of the LADT calculation [11]. In We thus have decided to use the a/t relationship: Let us consider one threshold value According to Equation ( 7), the relationship of the function d max, a and a max are: According to Equation ( 8), there is an admissible value of a , (i.e., max a ) corresponding to each value of a t (i.e., the slope of the line segment) in the threshold table.At each approximation, we can obtain the value of max a by looking into the table according to the a t value of the current segment.We then obtain the amplitude difference between each original sample value at instant and the approximating linear segment, and check if the condition It is obviously faster to obtain max a by looking in the table than by calculating by division once, addition once, square root once, and multiplication once.The data compressed by the fast realization of the LADT algorithm is a chain structure model [11].
Selection of thresholds will affect the LADT compression effect in directly.Obviously the larger of the threshold, the greater of the distortion, but can improve the compression ratio.Selection of initial step will affect the compression of time, which cannot be ignored for real time system.
ECG analysis system, detection of QRS complex wave is a very important task.The current QRS detection method is usually too complex, compute-intensive and difficult to achieve.Current wavelet transform in biomedical engineering has been widely used, but all of the ECG data are greater, which results in calculated measure, poor real-time and cannot meet needs.
Based on this reason, the system uses the fast realization of the LADT algorithm combined with the wavelet transform to process the ECG signal.

Basic Principle of Wavelet Transform [12,13]
The template is used to format your paper and style the text.All margins, column widths, line spaces, and text fonts are prescribed; please do not alter them.You may note peculiarities.For example, the head margin in this template measures proportionately more than is customary.This measurement and others are deliberate, using specifications that anticipate your paper as one part of the entire proceedings, and not as an independent document.Please do not revise any of the current designations.
The algorithm uses a continuous Wavelet transform, let , ( be the square integrable real number space), the Fourier transform is called a basic wavelet or mother wavelet function.We can get wavelet basis function after scaling and displacement.

 
, , ; 0 where a is the scale factor, b is the displacement factor.Continuous Wavelet transform (CWT) is expanded   f t which in arbitrary space of under the wavelet basis function [14], its expression is: The continuous wavelet inverse transform is: According to the admissible condition in mother wavelet function of Equation ( 10), the function that can be used as mother wavelet function must satisfy the function The stability condition is: where A, B are constants, and .0 A B    

Design of R-Wave Detection Algorithm for ECG Signal
The design of R-wave detection algorithm for ECG signal is divided into three parts: First, use the fast realization of the LADT algorithm to compress the data of original ECG, retain the necessary feature points while highlighting the R-wave eigenvalue.Second, according to the characteristic of wavelet transform for signal Singularity (breakpoints, Spike, and so on) has a high sensitivity, the wavelet transform coefficients can be obtained from wavelet transform.At this point, due to the inherent nature of the wavelet, most of these coefficients should be close to zero, only the peak signal will be relatively large coefficient values.
Finally, a detection window defined by threshold method, this window actually represents the local area of the analysis signal, a time window in which to find local maxima to determine and locate the R-wave, which can excluded wavelet transform coefficients maximum point result from the pulse peaks and the signal breakpoint.
The algorithm uses a first-order Daubechies wavelet; Daubechies wavelet is a wavelet function which is constructed by Inrid Daubechies who is a world-renowned scholar.Generally written as d N b , and N is the order of the wavelet.Daubechies wavelet support area is 2  1 N  , vanishing moment is N.In addition to , 1 N  d N b has no symmetry, i.e. nonlinear phase.d N b is no explicit expression except for . 1 N  Principle of analysis by wavelet transform, the high frequency noise of ECG signal should fall primarily on the small scales of 1 and 2; low frequency components and noise (P-wave, T-wave, etc.) fall mainly on the larger scales 4 and 5; In the 3rd scale, QRS-wave with the largest amplitude of wavelet transform, so use this scale Wavelet transform to detect QRS complex.However, according to different signal source of ECG using the same scale decomposition of the signal may be different, so for different ECG signal waveform to be adjusted at any time of the decomposition scale to meet practical needs.
Access to the waveform data of the QRS complex which is decomposed the ECG signal in the decomposition scale, the next task is to locate the data in the waveform of the R-wave.As the eigenvalue of R-wave is good reflected by LADT algorithm, the R-wave peak which treated by LADT algorithm is much higher than the original R-wave peak of the waveform that can offset part of the baseline drift interference, which will be very suitable to detect maximum.Therefore, the system defines a detection window defined by threshold method, this window actually represents the local area of the analysis signal, a time window in which to find local maxima to determine and locate the R-wave.This algorithm will set the size of the window with calculating the mean distance between the two R-wave peak, so exclude R-wave peak duration which is too long or too short, so that can have more accurate test results.But the practical application of this method will still produce error, especially in the case of arrhythmia.However, this method can more likely to exclude some obvious errors caused by the baseline drift compared with rely on wavelet transform combined with threshold method to local R-wave, that can improve the accuracy.

Hardware Platforms
In this paper, use TI Corporation's TMS320VC5509 fixed-point DSP processor to accurately and quickly implement LADT algorithm of QRS wave detection, which have clock frequency of 144 MHz, one or two of instructions executed in each clock cycle, two multipliers, two adders, and two internal write bus.TMS320VC5509 is a high-speed, low-power DSP chips, it makes the algorithm response faster, and has high precision, to provide a guarantee to achieve the algorithm [15].The software development processes of DSP processor are basically identical with the general computer programming processes.
1) The algorithm program was written with assembly language and c language or mixed programming in assembly language and C language, and then they will be compiled by compiler to generate object files (*.obj) after converted to DSP assembly language.
2) The target file will be send to the linker to get the executable code files (*.out).
3) Download the executable code to debugger and run the on-line debugging, checking the results are correct.If correct, continue, otherwise modified.
4) Practice executable code file for transcoding (HEX), which wrote to the EEPROM or FLASH via a dedicated programmer.Then the program runs from the emulator.If test results are correct, end, otherwise return.
In order to achieve wearable multi-parameter monitoring device of signal processing platform data communication with the central server, this paper uses GPRS wireless communication module with the Internet as a transmission medium for data transmission.The bidirectional communication between wearable monitoring device and monitoring center can be achieved by this method, the system block diagram shown in Figure 2.
The ECG module debugging process in three stages: 1) Debug hardware.The DSP board ensures that all devices are working properly, which is the basis for software debugging.
2) Debug software in TMS320VC5509.With a modular approach to the preparation of the corresponding subroutines of each function and debug each module, then assembled through the interface of these modules to achieve the function of the system.
3) Debug GPRS communication module.Ensure that the correct data transceiver, and on this basis, gradually adding new features.After debugging, writing object codes to TMS320VC5509 flash by JTAG, for the entire system offline operation.

The Realization of ECG Detection Algorithm
In order to achieve this algorithm in the TMS320VC5509 DSP, use C language as a programming language with calling TI Corporation's supplied library functions of the corresponding mathematical algorithms to achieve.Wavelet function is included in IMGLIB library which supplied by TI Corporation, where one dimensional wavelet pyramid decomposition and the one dimensional wavelet pyramid reconstruction defined as follows: //One dimensional wavelet pyramid decomposition void IMG_wave_decom_one_dim(short *in_data, short *wksp, int *wavename, int length, int level) //One dimensional wavelet pyramid reconstruction void IMG_wave_recon_one_dim(short *in_data, short *wksp, int *wavename, int length, int level); Add library file 55ximagex.libto the projects which have been built before using these two functions.
In CCS by setting the corresponding BIOS, it can set the external resources of TMS320VC5509 DSP chip to meet the design requirements.The TMS320VC5509 data line, address line, control line can operate in 4 modes, respectively: data EMIF, full EMIF, non-multiplexed EHPI, and multiplexed EHPI.
The system chose DSP development board whose work in Full EMIF mode.In the BIOS settings as follows: First, Right-click the chip support library > chipglobal CLS device configuration > chip configuration.Second, click properties, select full EMIF in parallel port mode to complete configuration.

Experimental Results
The system used the ECG signal processing detect the QRS-wave of 3 groups of ECG signals.In the experiment, detection of a total of 214 QRS-wave, each group of ECG signal has different length of time; all signals come from the MIT/BIH ECG database.The experiment results of the ECG detection algorithm as shown in Table 1.
In the 3 groups of ECG signals, the ST Change Database (Record: 300) and ECG Compression Experiment Database (Record: 12936_03) of MIT/BIH ECG database signal does not have the obvious pathology characteristic, the quality of signal is better.The signal has not more noise as well as baseline drift.We can see that this algorithm has achieved 100% rate of detection to this kind of regular ECG signal, as shown in Figure 3.The Atrial Fibrillation Database (Record: 08219) of MIT/BIH ECG database signal is pathological electrocardiogram, it not only has noise interference but more serious baseline drift, this algorithm had only achieved 87% about recognition rate, there is room for improvement.However, the ECG signal can be through the design of front-end hardware electric circuit to carry out the pretreatment.Therefore, this kind of low quality of ECG signal only can appear in the extreme situation, as shown in Figure 4.
Experiments show: The signal processing platforms use the ECG detection algorithm that make a high correct rate of detection in this system, the DSP to achieve rapid, and note that the system has real-time monitor and analysis of ECG signal.

Conclusion
The system has met the qualification of the design specification, but also has potential for further expansion.In terms of software, because of its modular design, we can easily add new function modules, such as autocorrelation processing, and other parameters detection module; In terms of hardware, we can use PLD or FPGA chip instead of SSI (Small Scale Integration) to program the logic interface of TMS320VC5509 and peripheral chip, which can reduce chip count and improve system reliability.

Figure 1 (
a) simplified as shown in Figure 1(b) shows, let us consider (Figure 1(b)) three samples taken at instants n, n k  , and m, with n n respectively.Define an amplitude error by Figure 1(b):

Figure 2 .
Figure 2. The block diagram of ECG signal processing platform for DSP.