ST Segment Extraction from Exercise ECG Signal Based on EMD and Wavelet Transform

Myocardial ischemia is always characterized by the changes in ST complex. But ischemia is not obvious at rest. Only in the state of exercise, abnormal ST will appear. The signal of ST is susceptible to noise interference which causes the inaccuracy of the ST segment detection. Combining the advantages of empirical mode decomposition (EMD), the paper proposes a modified threshold method to filter a serious of noise from exercise ECG. Extracted from the ECG feature, it includes ST segment detection, with wavelet transform. In the end, the method is tested with synthetic exercise data and real exercise ECG data. The results of ST segment detection are accurate and this method can be applied in practical exercise.


The importance of ST segment detection
Myocardial ischemia and arrhythmia are common coronary heart disease, which poses a health risk to humans.There is almost no symptom of myocardial ischemia in ordinary ECG detection.The patient will develop symptoms only under load of exercise [1] .Doctors usually increase the heart load in particular mode of motion, such as running.With the increase of exercise intensity, heart rate and other ECG features have changed, noise were also increased.The noise mainly includes baseline drift caused by breathing, EMG interference, frequency interference and motion artifacts.The stress test is performed to access cardiac ischemia, and thus ST segment measurement plays an important role in the diagnosis.Most of the ECG algorithms are used for the QRS wave or heart rate.While QRS wave have strong amplitude, and distinguishing between peaks is relatively simple.The usual methods distinguish the noise and signal based on frequency.But there are some overlaps between noise and ST segment that makes exercise ECG filtering and de-noising very complex and difficult.

Comparison of different filtering method
The traditional method to remove signal noise is Fourier transform theory, but the Fourier transform is a kind of frequency domain transform which cannot reflect the characteristics of the time-frequency of the signal.It is limited to use for the nonlinear and non-stationary biomedical signal, like ECG.Wavelet transform is widely used as an analysis method for non-stationary signals.Wavelet transform have the localization characteristics of time domain and frequency domain.But the method also has many insufficiencies, such as the choice of the wavelet base.Different wavelet bases will make different signal decomposition.The EMD was a technique for processing nonlinear and non-stationary signals.It behaves as a wavelet-like filter, but the basic functions are derived from the signal itself.EMD was introduced by Huang and it could be implemented on data obtained from physiological measurements.The method decomposes the signal into a series of intrinsic mode function (IMF) from high frequency to low frequency order.Reconstruction signal made from the IMF components which are processed to remove unwanted part.

Empirical mode decomposition (EMD) and Hilbert Transform
There are two conditions that the IMF must be satisfied: 1) In the whole data set, the number of local extreme and that of zero crossings must be equal to each other or different at most one.2) At any point, the mean value of the envelope defined by the local maxima and that defined by the local minima should be zero [2] .Determine all of the local extreme points, which include maxima and minima point.Join the two parts of the points by cubic spline line as the upper and lower envelopes.The mean value m(t) of the upper and low-er envelops are subtracted from the original signal x(t) to obtain the component h. (

1)
Treat h as a new x(t) to repeat the step above until h satisfies the two conditions to be an IMF.The h will be the first IMF c1 which is subtracted from the original x(t) to obtain the next component r. ( Treat r as a new x(t) to repeat the step above until we get the second IMF c2, the third IMF c3 and so forth.The process will stop until c n or r becomes a constant or monotonic function.

¦ (3)
The different scale components reflect the intrinsic mode characteristic of nonlinear and non-stationary signal.
Do Hilbert transform on IMFs: Combine analytic signal with c(t) and H[c(t)] which is the virtual part.

> @ T (5)
The amplitude function of the z(t) is: The phase function of the z(t) is: The instantaneous frequency of each IMF is: Do Hilbert transform on every IMF to figure out the instantaneous frequency and Hilbert spectrum.The signal will be: After the EMD and Hilbert transform, we can also get the relationship between power and instantaneous frequency.

EMD de-noising
The ECG signal is decomposed into eight to more than ten IMFs with the order from high frequency to low frequency.A result of 10 IMFs decomposed from a real motion ECG signal is shown in Figure1.
The high frequency components contain the useful ECG signal and the high frequency noise.FIR filter with strict linear phase doesn't change the shape of the input signal.The sampling unit is finite length so that it is stable.Window function filter is commonly used in FIR filter.The original signal with a plurality of frequency components was removed noise based on frequency.Therefore Hamming window with narrow main lobe is a better choice.Hamming window is cosine window and the weighted coefficient can reach smaller side lobe.The Hamming window coefficients are expressed as: After calculation and test, the order of the window was eight to ten that achieved a good effect.The first six components filtered positive and negative.
The low frequency components mainly contain the baseline drift.The IMFs with frequency lower than 0.3Hz don't participate in the reconstruction.

De-noising test and result analysis
In order to detect the effect of filter, noise with different SNR was added into the ECG signal of the resting state.The ECG signal of the resting state came from a twelve lead Holter recorder which was made by our laboratory.The participant without heart disease was keeping resting state for half an hour to record the ECG signal.The signal can be preserved by the SD card in it.The noise is mixture of real muscle artifacts, electrode movements, baseline wander and white noise.Compare the signal to radio of the noisy signal and filtered signal.The formula of the SNR: The y i expresses standard original signal and x i expresses the signal after processing.Bigger SNR is better.
The effect can be seen from the comparison of the noisy signal and de-noising result of the signal (Fig2).The SNR that is added into the noisy signal is 1.37 dB and filtered signal improved SNR to 4.28 dB.The filtered signal is close to the original signal.The ST segment was preserved well with the clean waveform after filter.

Detection of ST segment
Take advantage of the fact that the original signal frequency is an integer multiple of the scale signal frequency to detect ECG feature.Extract the low frequency coefficients after the transform of db4 wavelet and 4 scales.We will find that the first signal resembles to the original signal but has exactly half number of samples.The 2th level has exactly half number of samples that of 1st level, 3rd  Choose any level signal as an ideal ECG signal from which QRS must be detected.There is one point that should be considered.The first R is located in 3rd level decomposition signal at approximately 40th sample whereas the same is located in the original signal at 260th location.Therefore once R peak is detected in 3rd level reconstructed signal, it must be cross validated in the actual signal.
Find the max value max(x) of the selected level signal and get the positions p(x) of the values that are greater than 60% of the max value.u t (12)   So p is now set of points which satisfies the criteria above.But R-Peak is not a signal impulse peak that we will get multiple points in each peak satisfying criteria.Get the first value of p as the first value of p1.Than drop 10 points after p(1) and get the p(12) as the second value of p1.We will get a new position of R-Peak with repeating the step above.
As we know that the R-Peak location in decomposition level is at least 1/2th of the original R-Peak location of the same point, so we multiply p1 with a multiple which depends on the level selected before.u (13) M may be 2, 4, 8 or 16.P2 is not the peak location on the original signal because R location in down sampled signal is not on the original signal at a scale of 4 after decomposition.Add a window of 20 samples to p2 to search for the maximum value.The maximum values are the P-Peak on the original signal.
Traverse forth from R-Peak and search for minima which are the S peaks with a window of [+5, +50].Search for maxima which are the T peaks with a window of [+25, +150].
J point is the first change point of slope after S peak and the starting point of T wave is the first change point of slope before T peak.Connect the T peak and S peak to form a straight line: Take the absolute value of the between the straight line and ECG signal.The extreme value points for both sides are the J points and starting points of T wave.

Synthetic exercise data
In order to test the accuracy of the ST segment after filtering the signal with different SNR, We still used the resting ECG data from the twelve lead Holter re-corder made by our laboratory.The sampling frequency of the signal is 1024Hz.The participant without heart disease was keeping resting state for half an hour to record the ECG signal.The signal can be preserved by the SD card in it.
Detect ST segment of the de-noising ECG signal which was mentioned in 2.3.The result is shown in the Figure 3, and red points express J points and green points express the starting points of T wave.
The extension of T-P segment is the standard baseline to determine the ST segment shift.Use the level of ST segment elevation point which refers to baseline to compare the accuracy.Add noisy which was mentioned in 2.3 of SNR from -3dB to 10dB into the ECG signal of resting state.SNR1 expresses the noisy signal in the table below.SNR2 expresses the signal after processing.The SNR of each signal are improved which is shown in Table 1.E represents the deviation of the mean and e represents the standard deviation.The difference of ST segment level identification between the filtered signal and noisy signal is relatively small.It proved that the use of this method can extract ST segment closer to the original signal.There are 3000 samples of signals involved in this experiment which is shown in Figure 4.The signal

Web of Conferences MATEC
segment is around 4.8 minute.As it can be seen in Figure 4, the noisy of the real motion ECG signal was strong and the electrode movements noisy were particularly serious.The method can remove all kinds of noisy in the real motion ECG and retain the signal shape well.
Detection of ST segment could be better on the basis of using the filter (Fig. 5).These results further demonstrate that the proposed method is not only applicable to synthetic noise cases, but also suitable for real noise cases.

CONCLUSIONS
Through the improvement algorithm for ECG de-noising based on the EMD and the detection algorithm based on wavelet, we realize the automatic detection of ST segment.Different IMFs are chosen and processed to successfully achieve the de-noising of the muscle artifacts, electrode movements, baseline wan-der and white noise.The effectiveness of the method in ST detection is shown through several experiments that consider synthetic motion data and real motion ECG data.The method used here can be applied in practical exercise ECG test as in these cases strong noise and baseline components are present in the recorded ECG.The extract of the ST features laid a foundation for further automatic diagnosis.

1
Wavelet transformWavelet transform is a process which develops the time signal as a linear superposition of wavelet function family.The kernel function of wavelet transform is a wavelet function.The discrete wavelet transform decompose down the signal into different frequency scales.The low frequency coefficients have less number of samples than the original signal due to down sampling.

Figure1.
Figure1.EMD of motion ECG signal: the signal has been decomposed into ten IMFs.

Table 1 .
SNR comparison and difference of ST segment level identification between the filtered signal and noisy signal.

Table 2 .
It is the most commonly used scheme currently.The oxygen consumption value and the power increment of the Bruce are larger, which is easier to reach the target heart rate.