Electrocardiogram Signal Analysis for Physical Motion Based on Wavelet Approach

In this study, a portable, low-cost system, Portable Motion Analyzer (PMA), is introduced to obtain data from daily physical motions, such as ECG, heart rate signals, as well as kinetic information of motion and free-living gait. It can gather, process and analysis the signals from multiple input channels. To process these signals, digital filtering and wavelet analysis is used for quantitative analysis, which can de-noise, de-composite and reconstruct the signals. Similar to the Fast Fourier Transformation (FFT) in the Fourier, Mallat algorithm can realize the decomposition and reconstruction of the signal according to the coefficient. Experiments show that the system can effectively de-noise analysis of the data from MIT-BIH arrhythmia database and analysis the signals of body subjected to the shock of ground. It is proved efficient and stable in the most practical scenarios.


INTRODUCTION
Analysis of physical motion, such as gait and upper limb movement, has important significance for quantization of physiological function and disease and evaluation of physical and operational ability and also important to clinical medicine, e.g., rehabilitation, orthopedics, plastic surgery, neuron-surgery etc. In our research, we have developed a portable and low-cost system, Portable Motion Analyzer (PMA), to get gait parameters of kinematics and kinetics and to obtain the variation of heart rate in active process and also to detect the relationship between movement, physical activity and heart rate, acting and energy consumption as in the literature (Kim, 1997;Bouten, 1997).
ECG signal, a kind of low SNR (Signal Noise Ratio), plays an important role in the analysis of physical motion, as it reflects the status of body directly. For a long time, a lot of researchers have focused at the spectral analysis of the heart rate (Merri, 1988), cardiac-beat detection (Garner et al., 2010) and the monitoring of blood pressure (Zelin and Jamieson, 1992). In this study, we use wavelet approach to process the signals from ECG, such as heart rate and T waveform.
In the practice of ECG signal analysis, the method of digital filter is always employed to filter the high frequency noise signal and smooth the curves of waves. However, using the tradition filters, such as difference filter and Butterworth filter, the phenomenon of distortion is very serious, especially in the case of high coefficient filter. To solve this problem, in our research, a wavelet approach is used to analysis the ECG signal of the physical motions such as sports, posture, the normal human activities causing periodic interference artifact. For instance, cardiac detection, the process contains maternal ECG signal, if using classical filter, it can't combine them strictly distinguish, affect the accuracy of the analysis. The results show that using wavelet filter, it can improve the signal-to-noise ratio and greatly enhance the capture and detection useful information.

SYSTEM ARCHITECTURE OF PORTABLE MOTION ANALYZER (PMA)
A Portable Motion Analyzer (PMA) is an information system with the following functions: • The gathering, processing and analysis of the data from multiple input channels • The advanced algorithm and model to treat the individual difference and the complex changes caused by the repetitive operations from motions, including some nonlinear time-varying signal • Solving the portable problems, including the miniaturization of data recorder and sensors, lowpower consumption, compact structure, security and Internet access The system architecture of a typical PMA is depicted in Fig. 1, which collects data through a data logger and some five sensors that can measure the angles in the radial and vertical directions of a 2dimensional plane. Each sensor is placed on the chest, the front of each thigh and the bottom of each foot, to momentarily record gait parameters, including pulling acceleration, deceleration process of extremities swinging, the ground impact, speed, rhythm, step length and pace. PMA also records the data in flash memory and connects computer via the USB cable after data acquisition, in order to analysis and observation. After inputting file name, weight, height, age, gender and the optional number, PMA begins to record data according to user command and it can independently record data without PC.
As the significant progress of the PMA technology, some new features are imported in it. One is the acquirement of the angle of the fore-plane the legs, the angle of the radial plane of chest and that of fore-plane of ankle, knee and hip. The other is adding the original Electrocardiogram (ECG) signal, heart rate, comprehensive flesh report graph and foot pressure data.

Processing of Electrocardiograph (ECG) signal:
This study focuses on the processing of Electrocardiograph (ECG) signal in biomedical signal. ECG signal is a kind of low SNR (Signal Noise Ratio), periodic and weak signal (Renumadhavi et al., 2006). In the signal acquisition process, it is affected by the instrument, the human body and many other factors, thus its processing becomes an important area in which signal processing technology plays an important role.
The whole handling process is illustrated as the following steps: • Sampling index of the signal: 12 BIT, sampling rate: 256HZ • Data pre-processing stage: o Filtering out the high frequency components with a low-pass analog filter (implemented by hardware) o Filtering out the high-frequency interference from the data with a low-pass digital filter o Removing the drift part of low-frequency baseline from the data with a high-pass digital filter • Data analysis stage: Carrying out the heart rate detection to the pre-processed data, which is detecting QRS (Tompkins et al., 1984) combined wave in the ECG signal, calculating heart rate within some period of time according to the Rwave intervals, to provide data for further analysis.

WAVELET APPROACH FOR SIGNAL ANALYSIS OF PHYSICAL MOTION ACTIVITY
Most filters, such as Bunerworth, Chebyshev, Bessel and Elliptic are used to filter the high frequency noise in ECG signal analysis. However, it also often damages the high frequency signals, because the signals' frequency spectrum always coincides that of noises.
In our research, we decide to use wavelet approach to process the signals from ECG, such as heart rate and T waveform. The analogous Mather waveform with electrocardiogram QRS (Tompkins et al., 1984) the can be found by wavelet. In contrast, although the classic filters perform well in DC drift and slow waves, such as surface resistance, electrode impedance, position change and so force, it still show poor ability with the changes by the low frequency periodic. For instance, fetal heart rate, which also contains mother's ECG signals, is also the normal ones. If using classic filters in this case, it cannot differentiate the 2 ECG signals strictly.
Discrete wavelet transform: In practical applications, for the convenience of computers analyzing and processing, the continuous wavelet must be discredited. In numerical analysis and functional analysis, a Discrete Wavelet Transform (DWT) is any wavelet transform for which the wavelets are discretely sampled. As with other wavelet transforms, a key advantage it has over Fourier transforms is temporal resolution: it captures both frequency and location information (location in time).
Given a = a j 0 , b = ka 0 j b 0 , where j, k ∈ z, a 0 >1, the discrete wavelet function can be written as follows: where, the corresponding discrete wavelet transform is: As the discrete wavelet function family ψ j,k has the following properties: where, A, B are the limit of the frame, if A = B, {ψ j, k (t)} is a tight frame. Especially, if A = B = 1, the tight frame is an orthogonal basis. If the discrete wavelet Function Family ψ j,k (t) becomes a tight frame, its inverse transformation will be: Usually, a, b are discrete with binary step, which is a 0 = 2, b 0 = 1, then we will get the wavelet named binary wavelet, the expression is: The discrete wavelet still has some redundancy, but the redundancy is greatly reduced compared to the continuous wavelet transform. In the field of signal processing, we hope that minimize the redundancy of the wavelet transform coefficients in conditions of not lost of the information of original signal f(t). We can combine the redundancy of the continuous wavelet transform with economic of the discrete wavelet transform guided by wavelet frame theory, which is the advantages of the wavelet frame.

Mallat algorithm:
In literature (Mallat, 1999), proposed the concept of multi-resolution analysis, which illustrates the traits of wavelet in the perspective of space. It not only provides a simple approach to construct the orthogonal wavelet bases, but also brings a theoretical foundation to the fast algorithm of orthogonal wavelet transform. As it is similar to the multi-sample-rate filter group, it is then used to combine with digital filter theory. In brief, the multiresolution analysis places an important part in the orthogonal wavelet transform theory.
In 1989, inspired by the pyramid algorithm in the theory of multi-resolution analysis with its applications in image processing, Mallat developed a fast algorithm, the Mallat algorithm, to the pyramid multi-resolution analysis and reconstruction (Mallat, 1999;Mallat and Zhong, 1992). In large scale space roughly corresponds to the signal profile, in small scale space roughly corresponds to the signal details. In Mallat algorithm, it is not need the knowledge of the specific structure of the scaling function and wavelet function. However, it can realize the decomposition and reconstruction of the signal according to the coefficient. Through the algorithm, the length of the signal will be half in each pass of decomposition, so it is a fast decomposition and reconstruction algorithm, similar to the FFT in the Fourier. It reduces the complexity of the wavelet transform in practical applications and it has the advantage of facilitating in software and hardware engineering.
In literature (Yu et al., 2011), the Mallat algorithm is used to process seismic signals, photo acoustic signals, voice signals and other non-stationary signal and the ideal effects of noise removal and filtering have been achieved for the photo acoustic signals through this method.

Mallat decomposition algorithm:
The formula of the signal decomposition in Mallat algorithm is shown as follows: ∑ When signal decomposition is carried out by Mallat fast algorithm, the sampling sequence f(n∆t) of the signal f(t) is used to approximate to α 0 (n) (f(n∆t) is expressed as f(n)), h 0 is the low-pass filter, h 1 and is the high-pass filter. α j+1 (k) and d j+1 (k) is the signal sequence extracted from the convolution of α j+1 (k) h 0 (k) and h 1 (-k). We decompose the signal into many components in different scales with the algorithm. Signal f(t) creates two coefficient sets: the lowfrequency coefficient α 1 (k) and the high frequency coefficient d 1 (k).The further decomposition are only to low-frequency.

Mallat reconstruction algorithm:
For random signals, some transformation has a unique inverse in theory, but cannot be achieved in practice. There is a unique inverse discrete wavelet transform, which makes the original function be fully restored according to components at different scales. The reconstruction algorithm is a 2-scale relationship of scale function and wavelet function. Application of Mallat algorithm to reconstruct the signal is calculated as follows: In the formula, h 2 is the low-pass filter, h 3 is the high-pass filter, they are respective image filter of h 0 and h 2 . The reconstruction process is: low-scale and low-resolution are signal approximation, they are stretched by inserting a zero value between 2 samples and then get low-resolution approximation at high-scale through the low-pass filter h 2 , the low-scale and lowresolution details becomes high-scale details after scale upgrading, we can reconstruct the original signal f(n) namely a 0 (n) as we calculate them.

COMPUTATIONAL RESULTS
To verify the correctness and efficiency of our approach, 2 experiments are conducted both based on classic dataset and real data. The former is de-noising about MIT-BIH arrhythmia data and the latter is signal analysis of body subjected to the shock of ground collected in Sport classes of Wuhan Institute of Physical Education in Sept 2010. All the experiments are executed in MATLAB 2009 in the Inter (R) Core i3-2350 CPU @ 2.30 GHz 2.29 GHz and 2GB RAM Computer.

Experiment 1: De-noising analysis of the data from MIT-BIH arrhythmia database:
The waveform characteristic of the original signal is shown as Fig. 2, in which the baseline of the signal from 88 to 90 has a trend of sinking similar to the case in Rashid (2011).
Using the wavelet multi-resolution analysis to perform the 2 nd time signal decomposition is the 1 st operation of this experiment. Due to the sunken baseline, sometimes drifted baseline, are very low frequency data signals, so it can be deco posited by respective separated signals with the fundamental frequency of human ECG (the main frequency range of human ECG is 0.05-100 Hz, the amplitude is about 0-4 mV).
Then it is restored by the wavelet reconstruction algorithm; Mallat reconstruction algorithm. This study adopts the signal analysis using DB4 wavelet, the result is shown as Fig. 3. In it, the green line is the graphic after filtering out baseline drift using wavelet; the blue line is the curve of the original signal. It can be seen that from the figure, waveform range from 88 to 90 is elevated to the position 0, but in the normal area; and the curve after wavelet processing is coincident with the original curve, effectively removing the baseline drift.
Experiment 2: Signal analysis of body subjected to the shock of ground: Usually, excessive impulse force of human body and the outside world (such as the ground) may cause damage to the body, e.g., the shock by ground when a person jumps from high place. In this study, we use the deceleration measuring instrument to acquire the waves form the body after shocked by An algorithm using wavelet transformation is adopted with the variable thresholds, which is also called wavelet shrinkage (Welka et al., 2008). Because all the wavelet basses are compact supports, so the wavelet transformation has the ability of collection, which can make the energy of pulse signal aggregated on small number of wavelet coefficients and that of noise signal scattered on big number of wavelet coefficients. This means that we can set a threshold on wavelet coefficients to remove noises (Alfaouri and Daqrouq, 2008).
The main phases of this experiment are summarized as follows: Wavelet transformation: In this study, N = 4, there are 4-fold decompositions of the signal. We can decompose the low frequency part after decompositions, in the experiment; we find that there is a lower-frequency cycle on the fourth layer, shown as Fig. 4. Denoising: The energy in the wavelet domain of the original signal is relatively concentrated, it shows that the absolute value of the signal decomposition coefficient in energy-intensive domain will be relatively large and the energy spectrum of the noise signal be relatively fragmented, so the absolute value of the coefficient is small, we can filter the wavelet coefficient which is less than a certain threshold based on threshold method and then we can achieve the effect of noise reduction. We take a hierarchical threshold noise reduction to the signal, it is more effectively selecting soft threshold of noise threshold at all levels. The threshold in the study is closed to white noise, thr = (1.562, 0.105, 0.055, 0.054) and the threshold can be mediated according to need in practice.

Reconstruction:
The coefficient through noise reduction can restore the signal by wavelet reconstruction.
Features extraction: After noise reduction, we can use the algorithm to remove the characteristics.
The detection of the maximum wave peak (the starting point of a cycle): It generates the trough at the first row (lower trough). Because the starting point of a signal cycle is generally at the left of the point, so we can use this information to mark the starting point of the signal cycle. We firstly mark the starting point of the cycle of the signal after de-noising, then find the largest point of the original signal around the point and mark the point as the starting point (green dot) of the original signal.
The detection of the minimum wave peak: Firstly, we find three minimum wave peaks behind the starting point of the de-noising signal, mark 3 peak values of 3 peaks in the original signal as the required minimum wave peaks, indicated by black dots.
The detection of wave trough: We find a trough point between 2 wave troughs. The sample image and result of the experiment is shown as Fig. 5.

CONCLUSION
In our research, we have designed a portable, lowcost system to obtain data from daily physical motions, such as ECG/heart rate signals, as well as kinetic information of motion and free-living gait.
To process these signals, digital filtering, wavelet analysis, medical statistics and expert system is used for quantitative analysis, which can be obtained and visualized for superior diagnosis and future database. From the experiments, we can make a conclusion that the Mallat algorithm for reconstruction and decomposition performs well in the practical scenarios.