The ECG Signal Compression Using an Efficient Algorithm Based on the DWT

The storage capacity of the ECG records presents an important issue in the medical practices. These data could contain hours of recording, which needs a large space for storage to save these records. The compression of the ECG signal is widely used to deal with this issue. The problem with this process is the possibility of losing some important features of the ECG signal. This loss could influence negatively the analyzing of the heart condition. In this paper, we shall propose an efficient method of the ECG signal compression using the discrete wavelet transform and the run length encoding. This method is based on the decomposition of the ECG signal, the thresholding stage and the encoding of the final data. This method is tested on some of the MIT-BIH arrhythmia signals from the international database Physionet. This method shows high performances comparing to other methods recently published. Keywords—ECG compression; wavelet transform; lossy compression; hard thresholding


INTRODUCTION
The Electrocardiogram signal (ECG), as shown in Fig. 1, represents the electrical activity of the hearts.This signal is recorded using the electrodes placed on the surface of the patient's skin.The theoretical and the practical basis of the ECG recording were set out by Einthoven in 1901 [1][2].The ECG signal contains different waves and segments .e.g.QRS complex, the P and T waves.These features represent the different sequences of the heart muscle activities, which permit to evaluate the cardiac sequences and the nature of disease affecting the heart.The ECG signal could be presented in different morphologies as presented in Fig. 2.These are due to the different way of electrodes placement [3][4][5].
The storage capacity of the ECG records presents an important issue in the medical practices as well as for the biomedical engineering.These data could contain hours of recording, which needs a large space for storage to save these records.The problem is more complex in the real-time processing and the transmission of the ECG signal where the doctors need to evaluate the heart condition using the fewest information possible [6].The compression process of these records is widely used to deal with this issue.The problem with this process is the possibility of losing some important features of the ECG signal.This loss could influence negatively the analysing of the heart condition [7][8][9].
The compression of the ECG signal presents a substantial challenge for searchers and engineers.Different research works are proposed to deal with this task.Two kinds of compression are widely proposed, namely, the lossless methods and the lossy methods.With the lossless compression, the reconstructed signal is identical to the original.Different methods are proposed in this axe to deal with the ECG signal [10][11][12][13][14].The disadvantages of the lossless methods are the compression rate, which does not highly minimize the storage space comparing to the original signal [15].The aim of the lossy compression is to present a reconstructed signal close enough to the original, which permits to evaluate correctly the heart condition.This offers a high compression rate of the original signal comparing the lossless methods.Among lossy methods, the algorithms based on the discrete wavelet transform (DWT) [16][17] offer an important solution for the ECG compression.These algorithms provide a better localization of the different features consisting the ECG signal.This is due to the wavelet transform properties in the timefrequency localization [1].This paper proposes an efficient method of the ECG signal compression using the discrete wavelet transform and the run length encoding.This method is based on the decomposition of the ECG signal, the thresholding stage and the encoding of the final data.The proposed method is tested on some of the MIT-BIH arrhythmia signals from the international database Physionet [16].This paper is organized as follows, after the introduction; the next section presents the different steps of the proposed method from the decomposing of the ECG signal to the encoding of data.Afterward, the results and discussion section present the qualitative and the statistical results of the proposed method using some of the MIT-BIH arrhythmia signals, as well as the comparison of these results with other methods recently published.Finally, the last section concludes this paper.

A. The discrete wavelet transform
The DWT is a known method widely used in the signal processing.It decomposes the signal over the different level of the high pass and low pass filters [16].Several coefficients have been developed for large choices among different scales is the output of the high pass filter (detail), A[k] is the output of the low pass filter (approximation), h[n] is the half band of the low pass filter, g[n] is the half band of the high pass filter and x[n] is the discrete form of the original signal.The DWT decomposes the signal as illustrated in fig.3, where every approximation becomes a signal to be decomposed at the next level.The selection of wavelet function is a substantial step in the ECG signal decomposition [1], the selected function must be close enough to the analysed signal.The Symlet 7 (sym7) is the chosen function for this method; this function shows the best results comparing to others in the proposed method.

B. ECG signal decomposition
This paper proposes the use of the MIT-BIH Arrhythmia signals of the international database Physionet.These signals are sampled at 360Hz, where the maximum frequency range of the real signals component is 180Hz [1].The values of these signals are higher and positive, where the baseline of these signals is 1024 and the real values are multiplied by 200.This allows an easy conservation of the data for storage and transmission.In this paper, we propose the conservation of the MIT-BIH values.In the evaluation of the results, these values are returned to their original form, where the baseline is lower and equal to zero.The DWT decomposes the signal as illustrated in Fig. 4, where C is the vector of the decomposition, as shown in Fig. 5.This vector contains different details and the last approximation of the desired resolution.This paper proposes to decompose the signal at four resolutions, which allows observing the conservation status of the ECG features e.g. the QRS complex.

C. The hard thresholding step
The hard thresholding permits to discard the data lower than the threshold coefficient as follows, where φ is the threshold coefficient and C[n] is the result vector of the wavelet decomposition: The thresholding step allows reducing the noises presented in the second approximation and set one similar value to these noises.This paper proposes an adaptive threshold coefficient as follows: Where α is the parameter of thresholding, n 1 to n 2 presents the length of the details.The proposed coefficient allows a simple thresholding of the C vector, where the α parameter is the principal factor of the thresholding as shown in table 1, where the CR is the compression ratio, and the PRD is the Percentage Root mean.www.ijacsa.thesai.org

D. Run length encoding (RLE)
The RLE permits to minimize the length of a vector or matrix where these data show a similarity.The aim of this technique is to count the redundancy of samples .e.g.considering this vector: a,a,a,b,b,c,d,d,d the RLE data vector is: a,b,c,d and the RLE redundancy vector is: 3,2,1,3.

E. The minimization of the bits number
The aim of this process is to minimize the number of data presented in the compressed vector.The MIT-BIH database contains for each signal of 10 second 3600 samples.These signals are coded in 11/10 bits.The proposed minimization process allows reducing the number of bits to 9 bits/sample or lesser.The process is simple, each sample of the RLE vector higher than 100 is divided by 4 and adding to this value the RLE indicator of 100, where only the integer results are conserved.The difference between the original RLE vector and the minimized one is very low.Other data lesser than 100 will not be minimized because these data contain the RLE parameters, which are the RLE indicator and the run length number.The last approximation could contain some negative values.Before the divided, these data are returned to a positive form by adding a fixed number of 1024 to these samples, which is close to the maximum absolute value presented in the analysed signals.These samples are excluded from the RLE process.

F. Decompression process
The low complexity of the proposed method permits to the decompression process to be simple as well as the compression one.The decompressed process is as follows: Step 1.The RLE minimized vector is returned to his original form by subtracting the data higher than the RLE indicator by 100 and multiplying the result by 4.
Step 2. The last approximation data are returned to his original form by subtracting the additive fixed number of 1024 from his values.
Step 3. The decoding of the RLE vector using the inverse process of the modified RLE algorithm.Following is the RLE decoding process, Where RLE_V is the RLE vector, N is the length of the RLE_V and Rec_C is the reconstructed C victor: i=1; j=1; Else Rec_C(i)=RLE_V(j); j=j+1 ;i=i+1; Step 4. The last step is the inverse wavelet transform of the reconstructed C vector, which allows the reconstruction of the ECG signal.

III. RESULTS AND DISCUSSION
The simulation results have been drawn using MATLAB.As indexed previously, this paper proposes the use of some of the MIT-BIH Arrhythmia signals.

A. Analysis of the qualitative results
The qualitative results allow observing the signal quality before and after compression.This permits to evaluate qualitatively the performance of the proposed method.Fig. 7 and Fig. 8 shows the results of decompression of the MIT-BIH signals n°112 and n°121 respectively.These results have been drawn using different sorts of the α parameter.As presented in these figures, the quality of the decompressed signal is related to the α parameter.The best result is presented in the lowest α parameter.This is due to the low loss of the data in the compression process, which influence also on the compression ratio (CR).The CR for the lowest α parameter is lesser than the highest α parameter.So, for the highest quality, the lowest value of the α parameter is recommended.However, for high compression of the ECG signal, the highest value of the α parameter is recommended.Even for the 30% of the α parameter, the reconstructed signal still shows important results, which is due to the high performances of the proposed method.

B. Analysis of the quantitative results
The quantitative results permit to evaluate statistically the performances of the proposed method using different statistical parameters presented in the related works.
To evaluate the compression performances, three parameters are widely used [16][17][18][19][20], namely, the Percentage Root mean Difference (PRD), the Compression Ratio CR and the Quality Score (QS).Following are the PRD, the CR and the QS equations, where x[n] is the original signal, ̃[ ] is the reconstructed signal, Nbo is the number of bits in the original file and Nbr is the number of bits in the compressed file: The values used in the PRD evaluation are the values where the baseline is zero.This offers a real analysis of the proposed method.The PRD results allow a good analysing of the ECG signal after the reconstruction.The CR results are valuable for the storage and the transmission of the ECG signal.The analysis of the statistical results allows observing the high performances of the proposed method in the compression of the ECG signal, where the proposed approach offers a simple method to deal with the storage issue of the ECG records.

C. Performance comparison
This paper proposes the evaluation of the statistical results comparing to others techniques recently published.Table 2 presents the different results of the proposed method in the analysed ECG signals, as well as different results of other techniques, namely, R. Kumar [16], X. Wang [17][18] as reported in [16], and B. Huang [19], J. Chen [20] as reported in [19].In bought the highest and the lowest α parameters, the proposed method shows competitive results comparing to [16][17][18][19][20] and it shows the best quality score of 6,02.

IV. CONCLUSION
The compression of the ECG signal is a widely used process to deal with the storage capacity of the ECG records.The problem with this process is the possibility of losing some important features of the ECG signal.This loss could influence negatively the analysing of the heart condition.This paper proposes an efficient method of the ECG signal compression using the discrete wavelet transform and the run length encoding.This method is based on the decomposition of the ECG signal, the thresholding stage and the encoding of the final data.This method is tested on some of the MIT-BIH arrhythmia signals from the international database Physionet.As the results of the proposed approach, the PRD parameter varies between 5.78 and 1.62 for an α parameter interval of 30% to 5%.For the same interval of α, the CR parameter varies between 12.36 and 8.40.which permits to have an average quality score of 4.27.In bought the highest and the lowest α parameters, the proposed method shows competitive results comparing to other technique recently published.www.ijacsa.thesai.org The proposed approach shows high performances in the compression of the ECG signal with a simple method.This permits to this method to be implemented in different sorts of the software and hardware of the ECG signal analysis systems.

Fig. 1 .
Fig. 1.Normal ECG signal with his different features

Fig. 2 .
Fig. 2. Example of different morphologies of the ECG signal

Fig. 3 .
Fig. 3.The DWT decomposotion and translations in order to obtain different sorts of high pass and low pass filters.e.g.Debauchies coefficients, Symlets coefficients, Coiflets coefficients.Following are the equations of these filters for one level of the decomposition:

Fig. 9
Fig. 9 presents the different results of the CR parameter and the PRD parameter of different α parameters in some of the MIT-BIH signals, namely, signals 112, 117 and 121.As shown in this figure, the PRD parameter varies between 5.78 and 1.62 for an α parameter interval of 30% to 5%.For the same interval of α, the CR parameter varies between 12.36 and 8.40.

Fig. 9 .
Fig. 9. CR and PRD results of the proposed method using different levels of the α parameter

TABLE I .
THE INFLUENCE OF THE THRESHOLD PARAMETER ON THE COMPRESSION OF THE ECG SIGNAL