A novel algorithm for wavelet based ECG signal coding

A novel algorithm for wavelet based ECG signal coding

Computers and Electrical Engineering 33 (2007) 186–194 www.elsevier.com/locate/compeleceng A novel algorithm for wavelet based ECG signal coding R. S...

302KB Sizes 3 Downloads 171 Views

Computers and Electrical Engineering 33 (2007) 186–194 www.elsevier.com/locate/compeleceng

A novel algorithm for wavelet based ECG signal coding R. Shantha Selva Kumari a

a,*

, V. Sadasivam

b

Department of Electronics and Communication Engineering, Mepco Schlenk Engineering College, Sivakasi 626 005, Tamil Nadu, India b Department of Computer Science and Engineering, Manonmaniam Sundaranar University, Tirunelveli 627 012, Tamil Nadu, India Received 27 July 2004; received in revised form 1 October 2005; accepted 8 February 2006 Available online 5 February 2007

Abstract Wavelets have emerged as powerful tools for signal coding especially bio-signal processing. Wavelet transform is used to represent the signal to some other time–frequency representation better suited for detecting and removing redundancies. A novel algorithm for wavelet based ECG signal coding is proposed in this paper. Experimental results show that this algorithm outperforms than other coders such as Djohn, EZW, SPIHT, etc., exits in the literature in terms of simplicity and coding efficiency by successive partition the wavelet coefficients in the space frequency domain and send them using adaptive decimal to binary conversion. Proposed algorithm is significantly more efficient in compression, simple in implementation and in computation than the previously proposed coders. This algorithm is tested for 26 different records from MIT–BIH arrhythmia database and obtained an average percent root mean square difference as around 0.01–4.8% for an average compression ratio of 2:1 to 35:1. A compression ratio of 8.5108:1 is achieved for MIT–BIH arrhythmia database record 117 with a percent mean square difference as 1.29%.  2006 Elsevier Ltd. All rights reserved. Keywords: ECG signal compression; Wavelets; Mean; Successive partitions; Adaptive decimal to binary conversion

1. Introduction Compression/coding of Electrocardiogram (ECG) signal are done by detecting and removing redundant information from the ECG signal [1]. ECG data compression algorithm is either of two categories: one method is direct data compression method [2,3], which detect redundancies by direct analysis of actual signal samples. Another method is transform method [4–8], which first transform the signal to some other time–frequency representations better suited for detecting and removing redundancies. Among transform methods, the wavelet transform method has been shown promise because of their good localization properties in the time and frequency domain. Villasenor et al., have proposed an explanation of why some wavelets are good for compression and others are not [9].

*

Corresponding author. E-mail address: [email protected] (R.S.S. Kumari).

0045-7906/$ - see front matter  2006 Elsevier Ltd. All rights reserved. doi:10.1016/j.compeleceng.2006.02.001

R.S.S. Kumari, V. Sadasivam / Computers and Electrical Engineering 33 (2007) 186–194

187

Recently, wavelets have been applied to several problems in electro cardiology including compression, detection of ECG characteristic points [10], the analysis of ventricular late potential [11] etc. This paper presents wavelet based coding algorithm to decor relate the mean removed ECG signal data for subsequent adaptive entropy coding. Well known embedded wavelet coders such as Djohn, EZW, SPIHT, and LZC adopted a bit plane/layeredbit scanning approach, in which each coefficient was quantized successively. The most significant bit of all coefficients were grouped together to form one layer and encoded initially. And then it moved to the second significant bit and so on. These methods adopted the progressive transmission of the compressed data, starting with initial transmission of a rough signal version followed by gradual transmission of the refinement details. Such bit plane/layered-bit scanning approach can be regarded as horizontal bit scanning. The main draw back of this scanning was each time all the wavelet coefficients were scanned. This increased circuit complexity and reduced the computational speed. In this paper, coder which uses both horizontal and vertical bit scanning is proposed. This concept is inspired from Huang’s Partition Priority Coding (PPC) for progressive DCT image compression [12]. Here, wavelet transform is used to de´cor relate the mean removed ECG data into low and high frequency sub band wavelet coefficients [13]. The low frequency sub band wavelet coefficients have significantly higher portion of energy than high frequency sub band wavelet coefficients. Therefore the order-by-frequency transmission of (PPC) embedded coding property of bit plane to construct a prioritized quantization/grouping scheme is used. For each pass, bits are being scanned horizontally and then vertically. After that, it reverts back to original layer retrieving horizontal direction again. This coder is different from other zero tree-based coder in such a way that it produces two symbols (‘0’ and ‘1’) instead of four symbols (ZTR, POS, NEG, and IZ) and without zero tree analysis. Each wavelet coefficient is scanned only one time. This leads to simple implementation. The subsequent adaptive entropy coding provides excellent quality signal reconstruction. This paper addresses the following problems: (1) Implementing simple algorithm, (2) obtaining high compression ratio using both horizontal and vertical bit scanning and intra band coding, and (3) achieving embedded fashion, that is all low frequency wavelet coefficients of the signal are embedded at the beginning of the bit stream generated for the coding. This is followed by high frequency wavelet coefficients bit stream. This paper is organized as follows: mean removal and discrete wavelet transform in Section 2. A coding algorithm is in Section 3. Quantitative and qualitative results obtained using this algorithm and comparison of the ability of the coder on 26 different records from the MIT-BIH arrhythmia database in Section 4. Finally conclude with some remarks in Section 5. 2. Mean removal and discrete wavelet transform All tested ECG signals/records are from MIT-BIH arrhythmia database. All records are sampled at 360 Hz with 11-bit resolution. The mean of the ECG signal is calculated using the equation mx ¼

N 1 X xðiÞ N i¼1

ð1Þ

where mx is the mean of the ECG signal, N is the number of samples in the ECG signal and x(i) is the samples of the ECG signal. The mean of the ECG signal/data is removed from each sample of the signal by subtraction method. That is by using the equation x1 ðiÞ ¼ xðiÞ  mx

ð2Þ

where x1(i) is the mean removed samples of the ECG signal, x(i) is the samples of the ECG signal and mx is the mean of the ECG signal. This mean removed signal requires less number of binary for their representation. The mean removed signal is decomposed (transformed) up to fifth level using Bior Spline wavelet (Bior4.4).

188

R.S.S. Kumari, V. Sadasivam / Computers and Electrical Engineering 33 (2007) 186–194

For decomposition The low pass filter coefficients used are h0 ðnÞ ¼ ½0 0:0378

0:0238 0:1106

0:3774

0:8527

0:3774 0:1106

0:0238

0:0378  ð3Þ

The high pass filter coefficients used are h1 ðnÞ ¼ ½ 0 0:0645

0:0407 0:4181

0:7885

0:4181

0:0407 0:0645

0:7885

0:4181

0:0407

0:3774

0:8527

0 0

ð4Þ

For reconstruction The low pass filter coefficients used are g0 ðnÞ ¼ ½ 0

0:0645

0:0407 0:4181

0:0645

0

0

ð5Þ

The high pass filter coefficients used are g1 ðnÞ ¼ ½ 0

0:0378

0:0238 0:1106

0:3774

0:1106

0:0238 0:0378  ð6Þ

The wavelet decomposition allows us to view the signal at various frequency bands. These minimizes the inter scale correlation of the decomposed signal which is essential for signal compression. Bi-orthogonal wavelets also allow perfect reconstruction of the signal using linear phase filter banks, which in turn avoid reconstruction error at the beginning and ending of the signal [14,15]. In [15], Yip reported that the energy contribution of the approximation band of level five to the total energy was around 99.5%. Out of the remaining 0.5%, the energy contribution of the detail band of level five was 50% and the remaining 50% energy was shared by detail band of level four to one. Maximum energy of the wavelet decomposed coefficients is concentrated in the lower approximation band. The coefficients of the decomposed signal form an inverted hierarchical pyramid, with the coarsest scale component at the bottom and the finest scale component at the top of the pyramid. In the interior of the pyramid, each coefficient cv,k has two children at next finer scale cv1,2k and cv+1,2k which correspond to the same spatial locations as cv,k Here v is the scale or dilation and k is the translation [16,17]. By using five level decompositions, five sets of high frequency coefficients and one set of low frequency coefficient are obtained. The amplitude of the wavelet coefficients in the detail (high frequency wavelet coefficients) sub bands is relatively very small compared with those in the approximation (low frequency wavelet coefficients) sub band. The number of wavelet coefficients in the detail sub band is relatively large compared with that of the approximation sub band that is essential for signal compression. This is verified for all records of MIT-BIH arrhythmia database. Fig. 2 shows the mean removed five levels decomposed signal of record 117 using Bior4.4 wavelet. 3. Coding algorithm A wide variety of encoding methods [5–8] have been developed for wavelets, and of these, the proposed algorithm gives better result. Fig. 1 shows the block diagram of the proposed algorithm. 3.1. Adaptive binary to decimal conversion The wavelet transformed coefficients cv,k simply taken as ci (where i = 1, 2, . . . , 2048) are normally ordered by frequency. The low frequency coefficients are encoded first. Actually the wavelet based six band sub band coding is done by decomposing the signal up to fifth level. The decomposed coefficients are normally in six groups. Adaptive decimal to binary conversion is done by using different number of bits representation for each group of transformed coefficients and one bit is used as sign bit for each transformed coefficients. The number of bits used for adaptive decimal to binary conversion is done by using the following:

R.S.S. Kumari, V. Sadasivam / Computers and Electrical Engineering 33 (2007) 186–194

189

Input Signal Mean Removal

Wavelet Transform Up to Five Levels (Decomposition)

Mean Insertion

Adaptive Decimal to Binary Converter and Encoder

Inverse Wavelet Transform Up to Five Levels (Reconstruction)

Encoded Signal

Adaptive Binary to Decimal Converter And Decoder

Output Signal Fig. 1. Block diagram of the proposed coder.

The first group consists of the approximation band coefficients (A5) of level five and decimal to binary conversion is done by using the number of bits (n1) as n1 ¼ blog2 ðmaxfjci jgÞ þ 1c

where i ¼ 1; 2; . . . ; 64

ð7Þ

The second group consists of the detail band coefficients of level five (D5) and decimal to binary conversion is done by using the number of bits (n2) as n2 ¼ blog2 ðmaxfjci jgÞ þ 1c

where i ¼ 65; 66; . . . ; 128

ð8Þ

The third group consists of the detail band coefficients of level four (D4) and decimal to binary conversion is done by using the number of bits (n3) as n3 ¼ blog2 ðmaxfjci jgÞ þ 1c

where i ¼ 129; 130; . . . ; 256

ð9Þ

The fourth group consists of the detail band coefficients of level three (D3) and decimal to binary conversion is done by using the number of bits (n4) as n4 ¼ blog2 ðmaxfjci jgÞ þ 1c

where i ¼ 257; 258 . . . ; 512

ð10Þ

The fifth group consists of the detail band coefficients of level two (D2) and decimal to binary conversion is done by using the number of bits (n5) as n5 ¼ blog2 ðmaxfjci jgÞ þ 1c

where i ¼ 513; 514; . . . ; 1024

ð11Þ

The sixth group consists of the detail band coefficients of level one (D1) and decimal to binary conversion is done by using the number of bits (n6) as n6 ¼ blog 2ðmaxfjci jgÞ þ 1c

where i ¼ 1025; 1026; . . . ; 2048

ð12Þ

3.2. Encoding Different coding schemes have been used to code the wavelet transformed coefficients. This novel coding is done in such a way that the code consists of four parts: the first part (header 1) has eleven bits used to send the mean of the signal, the second part (header 2) has four bits to represent the number of bits needed to code the wavelet transformed coefficients of each group, the third part has one bit to identify the sign of the coefficient, and the fourth part has bits variable in length that is given in header 2 and represents the binary equivalent of wavelet transformed coefficient (decimal). The first part is necessary only at the beginning of the coding of each signal. The second part is necessary only at the beginning of each group (quantization pass). The third and fourth parts are used for every coefficient. Here the decomposition is done up to five levels so that one group of approximation coefficients and five groups of detail coefficients exist. Totally one number of header 1 and six numbers of header 2 exist for single ECG signal coding. This algorithm is implemented in MATLAB 6.5 software.

190

R.S.S. Kumari, V. Sadasivam / Computers and Electrical Engineering 33 (2007) 186–194

3.3. Performance measure The Compression Ratio (CR) and Percent Root mean square Difference (PRD) are used as performance measures [5,7,8]. The compression ratio is calculated using the equation CR ¼ N x =ðH 1 þ ðH 2  6Þ þ N as þ N s Þ

ð13Þ

where CR is the compression ratio, Nx is the number of bits in the input signal (11 · 2048), H1 is an eleven bits header 1, H2 is a four bit header 2 (six numbers of header 2 are used), Nas is the minimum number of bits used to represent the mean removed wavelet decomposed coefficients, and Ns is the total number of sign bits. The PRD is calculated using the equation PRD ¼ Sqrtfsumð½xðiÞ  x1 ðiÞ2 Þ=sum½xðiÞ2 g  100

where i ¼ 1; 2; . . . ; 2048

ð14Þ

where PRD is the Percent Root mean square Difference, x(i) is the original signal, x1(i) is the reconstructed signal and Sqrt is the square root. The PRD indicates reconstruction fidelity by point wise comparison with the original data. 4. Experimental results This algorithm is tested for the first 2048 (N = 2048) samples of the following records 100, 101, 102, 104, 105, 107, 108, 111, 112, 114, 117, 121, 124, 200, 201, 202, 205, 207, 208, 210, 212, 213, 215, 219, 221, 222 from MIT-BIH arrhythmia database. All records are sampled at 360 Hz with 11-bit resolution. The mean value of the ECG signal is calculated by using Eq. 1. The mean value is removed from each sample by using Eq. 2. The wavelet decomposition is applied upto fifth level using Bior4.4 wavelet. In the mean removed five level wavelet decomposed signal, the first 64 number of wavelet decomposed coefficients (A5) have amplitude level around 600 mV (require 10 bits per wavelet decomposed coefficients), the next 64 number of wavelet decomposed coefficients (D5) have amplitude level around 300 mV (require 9 or 8 bits per wavelet decomposed coefficients), the next 384 number of wavelet decomposed coefficients (D4 & D3) have amplitude level around 200 mV (require 8 or 7 bits per wavelet decomposed coefficients), the next 512 number of wavelet decomposed coefficients (D2) have amplitude level around 30 mV (require 5 or 4 bits per wavelet decomposed coefficients) and the remaining 1024 number of wavelet decomposed coefficients (D1) have amplitude level

Fig. 2. Mean removed five level decomposed record 117.

R.S.S. Kumari, V. Sadasivam / Computers and Electrical Engineering 33 (2007) 186–194

191

around 8 mV (require 3 or 2 bits per wavelet decomposed coefficients). The number of wavelet coefficients in the detail sub band is relatively large compared with that of the approximation sub band [12,18]. This is verified for all the 26 records and Fig. 2 shows the mean removed five levels wavelet decomposed signal of record 117 using Bior4.4. Adaptive decimal to binary conversion is applied for wavelet transformed coefficients and then encoded. The performance of this coder is increased by sending the wavelet decomposed coefficients compactly by using adaptive bits size lead to higher CR. By compactly transmitting all the transformed coefficients this coder is able to achieve the CR as 2:1 with PRD as 0.0001%. The CR and PRD values are increased proportionally if the detail coefficients are partially omitted (D5–D1). The average PRD value is around 0.01–4.8% for the average compression ratio of 2:1 to 35:1. Coder based on the set partitioning in hierarchical trees (SPIHT) algorithm reported by Lu et al., the average PRD value was around 1.19–6.49% for the average compression ratio of 4:1 to 20:1. The average PRD value of this proposed algorithm is much better than the other coder exists in the literature. This is verified for all records and Fig. 3 shows the performance of this coder for ten different records from MIT-BIH arrhythmia database. Since in the proposed coder, each wavelet transformed coefficients are scanned only one time (horizontal and then vertical bit scanning) and all the six bands of transformed coefficients are encoded parallel, increases the computational speed. There are no zero trees in this coder. This makes the implementation of this coder as simple as possible. In [5], Djohn et al., presented a discrete symmetric wavelet transform based ECG compression and reported a PRD of 3.9% at a CR of 8:1 for record 117. In [7], Hilton presented a wavelet and wavelet packet based ECG

Fig. 3. Performance comparison of the proposed coder for 10 different records.

Table 1 Performance comparsion of the proposed coder Algorithm

PRD

CR

Proposed SPIHT Hilton (EZW) Djohn

1.29 1.18 2.6 3.9

8.5108:1 8:1 8:1 8:1

192

R.S.S. Kumari, V. Sadasivam / Computers and Electrical Engineering 33 (2007) 186–194

Fig. 4. Original and reconstructed signal of record-117 for different CR with PRD.

codec and reported a PRD of 2.6% at the same CR for same record. In [8], Lu et al., presented a SPIHT algorithm and reported a PRD of 1.18% at the same CR for same record. The proposed algorithm is tested for the same record and a PRD of 1.29% is achieved for a CR of 8.5108:1 which is slightly better than SPIHT codec and much better than other codec. Table 1 gives the performance comparison of this coder with other waveletbased coder exists in the literature for Record 117. Visual inspection of the compressed signal is necessary in order to extract the clinical information from the compressed ECG signal. Figs. 4 and 5 show the original and the reconstructed signal of records 117 and record 210 (one normal and one abnormal ECG record) that are coded using the proposed algorithm for different CR with the respective PRD. Note that the reconstructed ECG signals are smoothed version of the original signals as they do not suffer from the quantization noise introduced by the ECG recording unit. The original and reconstructed signals are analyzed by two cardiologists. They reported that all the clinical informations are preserved, thus the algorithm is safe to be used to compress any type of ECG signal. 5. Conclusion A novel algorithm for wavelet based ECG signal codec is proposed in this paper. It is tested and compared with different wavelet based codec exists in the literature. Coding several records in the MIT-BIH arrhythmia data base showed that this coding algorithm compresses all kinds of ECG signals with average PRD value with average compression ratio that are much better than other wavelet based codec used for ECG signal compression. Since no zero trees exist, coding and decoding are fast and easy to implement (computational speed is high). All clinical information is preserved after compression and this makes the algorithm safe to be used to compress all types of ECG signals. Implementation of this algorithm is very simple. By using both horizontal and vertical bit scanning and intra band coding high CR is achieved. These four features make the algorithm an attractive choice for use in portable heart monitoring systems.

R.S.S. Kumari, V. Sadasivam / Computers and Electrical Engineering 33 (2007) 186–194

193

Fig. 5. Original and reconstructed signal of record-210 for different CR with PRD.

References [1] Jalaleddine SMS, Hutchens CG, Strattan RD, Coberly WA. ECG data compression techniques – a unified approach. IEEE Trans Biomed Eng 1990;37(4):329–43. [2] Philips W. ECG data compression with time – warped polynomials. IEEE Trans Biomed Eng 1993;40(11):1095–101. [3] Hamilton PS, Tompkins WJ. Compression of the ambulatory ECG by average beat subtraction and residual differencing. IEEE Trans Biomed Eng 1991;38(3):253–9. [4] Cetin AE, Koymen H, Aydin MC. ECG data compression by sub band coding. Electron Lett 1991;27(February):359–60. [5] Djohn A, Nguyen TQ, Tompkins WJ. ECG compression using discrete symmetric wavelet transform, presented at the 17th IEEE Int Conf Medicine and Biology, Montreal, QC, Canada, 1995. [6] Ramakrishnan AG, Saha Supratim. ECG coding by wavelet based linear prediction. IEEE Trans Biomed Eng 1997;44(December):1253–61. [7] Hilton Michael L. Wavelet and wavelet packet compression of electrocardiogram. IEEE Trans Biomed Eng 1997;44(5):394– 402. [8] Lu Z, Kim DY, Pearlman WA. Wavelet compression of ECG signals by set partitioning in hierarchical trees (SPIHT) algorithm. IEEE Trans Biomed Eng 2000;47(5):849–56. [9] Villasenor JD, Belzer B, Liao J. Wavelet filter evaluation for image compression. IEEE Trans Image Process 1995;4(8):1053–60. [10] Li C, Zheng C, Tai C. Detection of ECG characteristic points using wavelet transforms. IEEE Trans Biomed Eng 1995;42(1):21–8. [11] Meste O, Rix H, Caminal P, Thakor N. Ventricular late potentials characterization in time frequency domain by means of a wavelet transform. IEEE Trans Biomed Eng 1994;41(7):625–33. [12] Huang Y, Driezen HM, Galatasanos NP. Prioritized DCT for Compression and Progressive Transmission of Images. IEEE Trans Image Process 1992;1(4). [13] Yip P, Rao KR. Energy packing efficiency for the generalized discrete transforms. IEEE Trans Commun 1978;26(8):1257–62. [14] Mallat SG. A theory for multiresolution signal decomposition: the wavelet representation. IEEE Trans Pattern Anal Machine Intell 1989;11(7):674–93. [15] Phoong SM, Kim CW, Vaidyanathan PP, Ansari R. A new class of two channel biorthogonal filter banks and wavelet bases. IEEE Trans Signal Process 1995;43(12):649–65.

194

R.S.S. Kumari, V. Sadasivam / Computers and Electrical Engineering 33 (2007) 186–194

[16] Cetin AE, Koymen H, Aydin MC. Multichannel ECG data compression by multi rate signal processing and transform coding techniques. IEEE Trans Biomed Eng 1995;40(5):495–9. [17] Rioul O, Vetterli M. Wavelets and signal processing. IEE Signal Process Mag 1991;8(October):11–38. [18] Shapiro JM. Embedded image coding using zero trees of wavelet coefficients. IEEE Trans Signal Process 1993;41(12):649–65.

R. Shantha Selva Kumari received her B.E. degree in Electronics and Communication Engineering from Bharathiyar University, in 1987 and M.S. degree in Electronics and Control from Birla Institute of Technology, Pilani, in 1994. She is currently doing her Ph.D. degree in Manonmanium Sundaranar University, Tirunelveli. She has 19 years of teaching experience and she is currently working as Assistant Professor in the department of Electronics and Communication Engineering at Mepco Schlenk Engineering College, Sivakasi, Tamil Nadu, India. Her current research interest includes Signal Processing, Wavelets and its Applications, Neural Networks.

V. Sadasivam received his B.E. degree in Electrical Engineering from Madurai Kamaraj University in 1973 and M.Sc. (Engg) degree in Power Systems from Madras University, in 1975. He received his Ph.D. degree in Computer Science and Engineering in 1993 from Anna University, Tamil Nadu, India. He has 27 years of teaching experience and he is currently working as Professor and Head of the Department of Computer Science and Engineering at Manonmanium Sundaranar University, Tirunelveli, Tamil Nadu, India. His current research interest includes Signal Processing, Image Processing, Artificial Intelligence, Expert Systems and Neural Networks.