International Journal of Scientific & Engineering Research, Volume 2, Issue 12, December-2011 1

ISSN 2229-5518

Wavelet Based Encoder/Decoder for

Compression of ECG Signal

Om Prakash Yadav, Vivek Kumar Chandra, Pushpendra Singh

Abstract-Signal compression is an important problem encountered in many applications. Various techniques have been prop osed over the years for addressing the problem. In this paper three compression algorithms are presented. In EZW algorithm, 3 -level decomposition is performed to the original ECG samples, and the wavelet coefficients at different sub -band representing the same spatial location in the ECG samples are loaded into a spanning tree.MEZW is a method derived from EZW method. The difference between them is that only on e dominant pass and one subordinate pass are performed in MEZW. If the computation time is a conce rn, both EZW and MEZW, especially EZW method, need to be applied to each of the ECG beats in order to break down the computational complexity.

Index Terms: Compression Ratio, ECG, Embedded zerotree wavelet (EZW ), Modified embedded zerotree wavelet (MEZW ), NMAE, NRMSE, Wavelet based linear prediction (WBLP)

—————————— ——————————

1. INTRODUCTION

OST techniques of ECG compression reported till now have not exploited correlation between
cycles (interbeat correlation). There is also some redundancy within each ECG cycle. Direct time-domain techniques such as [1],[2],[3] and transform-domain techniques such as [4],[5],[6],[7],[8] have considered only this intrabeat correlation between successive samples. Whereas, long term prediction [9] and average beat subtraction [10] techniques have used only the beat to beat correlation, ignoring the redundancy within beat. Another limitation of [9] and [10] rises from the fact that, since the period of a beat changes constantly, points that are equidistant and farther from the wave in two different cycles are not always well correlated. Further, [9] requires detection of the end points of each cycle, in addition to QRS detection and the correlation of QRS complex of each beat with a codebook of complexes. Similarly, the methods based on modeling, such as [11] and [12] require component identification for both model order selection and proper cycle separation. Parametric techniques [12] have minimized only the intrabeat redundancy and not the other. The electrocardiogram (ECG) signal is the electrical interpretation of the heart activity; it consists of a set of, well defined, successive waves denoted: P, Q, R, S, and T waves [15],[16],[17].

Om Prakash Yadav, Department of Electronics & Telecommunication Engineering, Chhatrapati Shivaji Institute of Technology, durg (CG), India. Email-opyadav@csitdurg.in. Vivek Chandra, Department of Electrical & Electronics Engineering, Chhatrapati Shivaji Institute of Technology, durg (CG), India.

Email-vivekchandra@csitdurg.in.

Pushpendra Singh, Department of Electronics & Telecommunication

Engineering, Chhatrapati Shivaji Institute of Technology, durg (CG), India. Email- pushpendrasingh@csitdurg.in.

Fig.1. Important feature of the ECG signal (Lynch, 1985)

This work uses the technique reported in [13] for the QRS detection, and it applies three steps to process the original ECG signals: 1) linear digital filtering, 2) nonlinear transformation, 3) decision rule algorithm. After the delineation of the QRS complex, both WBLP algorithm and EZW algorithm can use the results to conduct cycle- to-cycle compression.
The WBLP [14] method normalizes the period of each beat by resampling each beat so that each beat contains the same number of samples. It also normalizes the amplitude of each beat by scaling a factor of maximum amplitude of the beat. Thus, the generated period and amplitude normalized (PAN) beats bear more correlations. Next, the Daubechies-4 (D4) wavelet is used for representing each PAN beat, and Mallet’s pyramidal DWT algorithm is used to compute the wavelet coefficients. To increase the compression ratio, only the residual sequence obtained after linear prediction of the significant wavelet coefficients is transmitted to the decoder [14]. At the decoder, the original signals are reconstructed by the significant wavelet coefficients.
In the 1-D EZW algorithm, each ECG beat will be decomposed into several sub-bands by wavelet transform, and there are wavelet coefficients in different sub-bands that represent the same spatial location in the ECG beat. The large compression ratio is achieved by conducting dominant passes to select the wavelet coefficients bigger
IJSER © 2011 http://www.i jser.org

International Journal of Scientific & Engineering Research, Volume 2, Issue 12, December-2011 2

ISSN 2229-5518

than the threshold and encode their positions following
the tree’s structure, and the recording of the selected significant wavelet coefficients are refined by the subordinate passes.
Modified the 1-D EZW algorithm is to only conduct one dominant pass, and in the subordinate pass, the selected wavelet coefficients are uniformly quantized. This paper also applies 1-D EZW and 1-D modified EZW algorithms directly to the ECG samples without the QRS detection. While they bypass the hassle to delineate the beats, their worst case computational complexity, especially for 1-D EZW, to too high to put them into use if the computation time is a concern.

2. COMPRESSION TECHNIQUES

2.1 Wavelet-Based Linear Prediction (WBLP)

The WBLP [14]method normalizes the period of each beat by resampling each beat so that each beat contains the same number of samples. Following beat delineation, the periods of the beats are normalized by multirate processing. After amplitude normalization, discrete wavelet transform is applied to each beat. Due to the period and amplitude normalization, the wavelet transform coefficients bear a high correlation across beats at identical locations. To increase the compression ratio, the residual sequence obtained after linear prediction of the significant wavelet coefficients is transmitted to the decoder. The difference between the actual period and the mean beat period, and that between the actual scale factor and the average amplitude scale factor are also transmitted for each beat. At the decoder, the inverse wavelet transform is computed from the reconstructed wavelet transform coefficients. The original amplitude and period of each beat are then recovered.

2.2 1-D Embedded Zerotree Wavelet (EZW)

The EZW algorithm is a simple, yet remarkably Effective lossy image compression algorithm. [18]. It generates a progressive compressed bit stream and is one of the highly attractive data compression algorithms. EZW is one of the transform based data compression algorithms. Discrete wavelet transform is the transform used in EZW algorithm,
and it transforms the original signal to a joint time-scale
domain.
1-D EZW [21] algorithm to compress ECG signals in two ways. One way is to EZW encode the wavelet coefficients from each ECG beats after the QRS detections, and the other way is to EZW encode the wavelet coefficients from the entire set of discrete ECG samples without QRS detections. The cycle-by-cycle 1-D EZW compression can be implemented in two different ways: setting a constant desired threshold for all the beats, or setting a same number of significant coefficients for all the beats by putting different desired threshold for each beat.

2.3 Modified 1-D Embedded Zero-tree

Wavelet (MEZW)

The modified EZW algorithm only uses one dominant pass to aggressively select all the significant coefficients bigger than the desired minimum threshold and code their relative locations within the tree structure. In the subordinate pass, all these significant coefficients are one time uniform encoded. In the modified EZW algorithm, the initial threshold is set as:
Tinitial = Tdesired

3. PERFORMANCE EVALUATION

Depending on the nature of the application there are various criteria to measure the performance of a compression algorithm [19]. Following are some measurements used to evaluate the performances of algorithms.

3.1 Normalized Root Mean Square Error

(NRMSE)

The root-mean-square error (RMSE) is a frequently used measure of the differences between values predicted by a model or an estimator and the values actually observed from the thing being modeled or estimated. RMSD is a good measure of accuracy. These individual differences are also called residuals, and the RMSD serves to aggregate them into a single measure of predictive power.
IJSER © 2011 http://www.i jser.org

International Journal of Scientific & Engineering Research, Volume 2, Issue 12, December-2011 3

ISSN 2229-5518

(1)

where N is the total number of samples, and X0(i) and Xr(i) are the ith sample of original and reconstructed ECG, respectively.

3.2 Normalized Maximum Amplitude Error

(NMAE)

(2)

where NMAEi is the NMAE for ith cycle and NMAE is obtained by averaging over all the cycles.

3.3 Compression Ratio (CR)


Compression ratio is the ratio between the size of the compressed file and the size of the source file [20].
(3)
The second subplot in Fig. 4 demonstrated much better
recovery of ECG than that shown in Fig. 3. The NRMSE is only 16.98% with compression ratio CR being 5.88. In Fig.
3, using WBLP, the NRMSE is as high as 26.74% with
compression ratio only being 3.26.
Using WBLP to compress ECG signal1, as seen from Fig.2, when the CR is only 6.34, the NRMSE and NMAE respectively are as high as 59% and 61%, while using MEZW with QRS detection and constant threshold for all the beats, the NRMSE and NMAE are respectively only
14.39% and 16.20% when CR reaching 7.60 as seen in Fig.
6.
All the above methods evaluate the effectiveness of
compression algorithms using file sizes. There are some other methods to evaluate the performance of compression algorithms. Compression time, computational complexity and probability distribution are also used to measure the effectiveness.

4. RESULTS AND DISCUSSION

WBLP method is effective when compressing ECG at high ratios, because to achieve high compression ratios, less quantization bits can be used. Fig.2 shows the result from using second order LP and keeping 180 coefficients for each beat and quantizing them by 2 bits, the compression ratio is 6.34% and NRMSE is 59%. In Fig. 3, without using LP, though keeping 220 coefficients and quantizing them by 3 bits, the compression ratio is 3.26%, and the NRMSE is 26.74%.

Fig.2.Wavelet based linear prediction on ECG signal1 with CR= 6.34

Fig.3. Wavelet based linear prediction on ECG signal1 with CR= 3.26

IJSER © 2011 http://www.i jser.org

International Journal of Scientific & Engineering Research, Volume 2, Issue 12, December-2011 4

ISSN 2229-5518

Fig.4. Embedded zerotree wavelet with QRS and constant T on ECG

signal1, CR=5.88

Fig.5. Direct Embedded zerotree wavelet on ECG

signal1,with CR=11.98

Fig.6. MEZW with QRS and cons. T on ECG signal1 with

CR=7.60.

5. CONCLUSION

All of the algorithms simulated in this paper employ wavelet transform and the essence of the compression is to find an efficient way to use as few bits as possible to encode, as accurately as possible, the locations of the significant wavelet coefficients in the time-frequency domain and their magnitudes.
This study uses three algorithms to compress ECG. WBLP method does not only approximate the magnitudes of the significant wavelet coefficients from every ECG beats, but also estimates their locations by the generalizations from the sample beats. While MEZW shares the same characteristic as
1-D EZW that both of them accurately encode the locations
of the significant coefficients for each of the beats, it is different from 1-D EZW in that it conducts uniform quantization to all of them at once.

REFERENCES:

[1] J. R. Cox, F. M. Nolle, H. A. Fozzard, and G. C. Oliver, “AZTEC: A preprocessing scheme for real time ECG rhythm analysis,” IEEE Trans. Biomed. Eng., vol. BME-15, pp. 128–
129, 1968.
[2] J. P. Abenstein and W. J. Tompkins, “A new data- reduction algorithm for real-time ECG rhythm analysis,” IEEE Trans. Biomed. Eng., vol. 29, pp. 43–48, 1982.
[3] M. Ishijima, S. B. Shin, G. H. Hostetter, and J. Sklansky, “Scan-along polygonal approximation for data compression of electrocardiograms,” IEEE Trans. Biomed. Eng., vol. BME-
30, pp. 723–729, 1983.
[4] N. Ahmed, P. J. Milne, and S. G. Harris, “Electrocardiographic data compression via orthogonal transforms,” IEEE Trans. Biomed. Eng., vol.BME-22, pp.
484–487, 1975.
[5] G. P. Fragakis, G. Papakonstantinou, and S. G. Tzafestas, “A fast Walsh transform-based data compression multimicroprocessor system: Application to ECG signals,” Math. Comput. Simulation, vol. 27, pp. 491–502, 1985.
IJSER © 2011 http://www.i jser.org

International Journal of Scientific & Engineering Research, Volume 2, Issue 12, December-2011 5

ISSN 2229-5518

[6] B. R. S. Reddy and I. S. N. Murthy, “ECG data
compression using Fourier descriptors,” IEEE Trans.
Biomed. Eng., vol. BME-33, pp. 428–434, 1986.
[7] R. Degani, G. Bortolan, and R. Murolo, “Karhunen–Loeve coding of ECG signals,” Comput. Cardiol., 1991.
[8] M. E. Womble, J. S. Halliday, S. K. Mitter, M. C. Lancaster, and J. H. Triebwasser, “Data compression for storing and transmitting ECGs/VCG’s,” Proc. IEEE, vol. 65, pp. 702–706, 1977.
[9] G. Nave and A. Cohen, “ECG compression using long-
term prediction,” IEEE Trans. Biomed. Eng., vol. 40, pp. 877–
885, 1993.
[10] P. S. Hamilton and W. J. Tompkins, “Compression of ambulatory ECG by average beat subtraction and residual differencing,” IEEE Trans. Biomed. Eng., vol. 38, pp. 253–
259, 1991.
[11] B. Madhukar and I. S. N. Murthy, “ECG data compression by modeling,” Comput. Biomed. Res., vol. 26, pp. 310–317, 1993.
[12] J. A. Cadzow and T. T. Hwang, “Signal representation: An efficient procedure,” IEEE Trans. Acoust., Speech, Signal Processing, vol. ASSP- 25, pp. 461–465, 1977.
[13] J.Pan and W.J.Tompkins, “ A Real-Time QRS Detection Algorithm,” IEEE Trans. Biomed. Eng., vol. BME-32, No.3, pp. 230-236, 1985
[14]A.G.Ramakrishnan and Supratim Saha, “ECG Coding by Wavelet-Based Linear Prediction, ” IEEE Trans. Biomed. Eng., vol. 44, No.12, pp.1253-1261, 1997.
[15]Al-Nashash, H. A. M., 1994, "ECG data compression using adaptive Fourier coefficients estimation", Med. Eng. Phys., Vol. 16, pp. 62-67
[16]Bradie, Brian., 1994, "Wavelet Packet Based Compression of Single Lead ECG", Scheduled to appear in IEEE Transactions on Biomedical Engineering
[17]Hamilton, Patrick S., 1991, "Compression of the
Ambulatory ECG by Average Beat Subtraction and Residual
Differencing", IEEE Transactions on Biomedical Engineering,
Vol. 38, No. 3., pp. 253-259.
[18] J. Makhoul, "Linear prediction: A tutorial review," Proc. IEEE, vol. 63, pp. 561--580, 1975.
[19] J. Abenstein and W. Tompkins (1982): A new data- reduction algorithm for real time ECG analysis. IEEE Tran. On Biomed. Engg., 29(BME-1):4, 3-8.
[20]S. M. S. Jalaleddine, C. G. Hutchens, R. D. Strattan and W. A. Coberly. ECG Data Compression Techniques – A Unified Approach. IEEE Trans. on Biomedical Eng., vol. 37, 4 (April 1990), pp. 329-341.
[21] Jerome M. Shapiro, “Embedded Image Coding Using Zerotrees of Wavelet Coefficients,” IEEE Trans. On Signal Processing, vol.41, No12, 1993
IJSER © 2011 http://www.i jser.org