[ieee 2012 ieee symposium on industrial electronics and applications (isiea 2012) - bandung,...

5
Comparison of Different Algorithms for ECG Signal Compression Based on Transfer Coding Hamidreza Saberkari, Mousa Shamsi Department of Electrical Engineering, Sahand University of Technology, Tabriz, Iran {h_saberkari, shamsi }@sut.ac.ir Abstract—Electrocardiogram (ECG) is utilizing widely in recognition and cardiac treatment. The goal of this paper is investigating of different algorithms in ECG signal compression, which comprise compression in frequency domain using four transforms; Discrete Cosine Transform(DCT), Fast Fourier Transform(FFT), Discrete Sine Transform(DST) and DCT-II. To evaluate performance of the methods, we have used two parameters; compression ratio (CR) and Percent root mean square difference (PRD). Simulation results represents that DST has the least amount of CR whereas DCT-II has the most. Moreover, the most amount of PRD belongs to DCT-II which a tradeoff should be established between these two transforms. Each specific transform is applied to a pre-selected segment of the MIT-BIH database and then compression is performed. Keywords- compression ratio; ECG; frequency domain; PRD I. INTRODUCTION The methods for transmission of biomedical signals through communication channels have turned into a vital issue which has clinical application. These techniques allow experts that evaluate this remote information which have been carried by these signals. However, in many conditions, this issue leads to transmission of large amount of information. For storage and transmission of this large amount of data, compression of ECG signals is crucial [1]. Up to now, distinctive methods have been proposed for compression which in a comprehensive categorization we can divide these into three groups; Time, frequency and Time-frequency domain techniques [2]. In the recent decades, most of the ECG compression techniques were included direct transformations methods such as AZTEC 1 , CORTES 2 , SAPA 3 , DPCM 4 [3]. Time domain techniques which are on the basis of direct approaches are considered as a preliminary transformation. At present, Transfer Coding is one of the most important digital waveform compression techniques in frequency domain. This paper comprises these sections: in section II, we investigate the proposed algorithms in ECG compression. Criteria to evaluate algorithms are discussed in section III. In 1 Amplitude-zone-time epoch coding 2 Coordinate reduction time encoding system 3 Scan-along polygonal approximation 4 Differential pulse code modulation section IV, the results of simulation are presented and finally section V includes conclusions of article. II. PROPOSED ALGORITHMS It is a necessity that we should compress the digitized ECG signals for storage and better transmission. A typical ECG monitoring device generates large of volume data in 24-48 hour's duration. For suitable signal recognition, more than twelve different streams of data may be obtained from the patient's body through connected sensors. The sampling rate of ECG signals is in the range of 125Hz-500Hz and each data sample can be digitized from 8 to 12 bits. By one sensor in the least sampling rate of 125Hz per minute and 8 bit decoding, data is generated by the rate amount to 7.5KB per minute and 250KB per hour. For a sampling rate of 500Hz and decoding of 12bit, data is generated by the rate of 54KB per minute and 30MB per hour [4]. Transfer coding (TC) is one of the significant methods in compression of digital waveforms in frequency domain. In this work, the purpose is decomposing of signal into frequency components and allotting true bits in the frequency domain. In many of the TC techniques, the input signal at first is divided to data blocks and each block is transformed to frequency domain, linearly. Transformation methods comprise processing of the input signals through a linear transformation and coding of the output signals by applying proper error criteria. For signal reconstruction, an inverse transform is used and signal is retrieved with some error. There is variety of the orthogonal transforms such as KLT 5 , DCT, FFT and DST that will be considered in the next sections [5]. A. Discrete Cosine Transform(DCT) It is an approximation of KLT and is used when the correlation between input samples is considerable. The DCT of V ൌ ሾV ,V …V Nଵ T for vector x is defined as follows [5]: = = 1 N 0 n n 0 x V N 1 ) 1 N ...( 1 k , ) N 2 k ) 1 n 2 ( cos( N 2 1 N 0 n n k x V = π + = = (1) 5 Karhunen-loeve transform 2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA2012), September 23-26, 2012, Bandung, Indonesia 978-1-4673-3005-3/12/$31.00 ©2011 IEEE 341

Upload: mousa

Post on 12-Dec-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: [IEEE 2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA 2012) - Bandung, Indonesia (2012.09.23-2012.09.26)] 2012 IEEE Symposium on Industrial Electronics and Applications

Comparison of Different Algorithms for ECG Signal Compression Based on Transfer Coding

Hamidreza Saberkari, Mousa Shamsi Department of Electrical Engineering, Sahand University of Technology, Tabriz, Iran

{h_saberkari, shamsi }@sut.ac.ir

Abstract—Electrocardiogram (ECG) is utilizing widely in recognition and cardiac treatment. The goal of this paper is investigating of different algorithms in ECG signal compression, which comprise compression in frequency domain using four transforms; Discrete Cosine Transform(DCT), Fast Fourier Transform(FFT), Discrete Sine Transform(DST) and DCT-II. To evaluate performance of the methods, we have used two parameters; compression ratio (CR) and Percent root mean square difference (PRD). Simulation results represents that DST has the least amount of CR whereas DCT-II has the most. Moreover, the most amount of PRD belongs to DCT-II which a tradeoff should be established between these two transforms. Each specific transform is applied to a pre-selected segment of the MIT-BIH database and then compression is performed.

Keywords- compression ratio; ECG; frequency domain; PRD

I. INTRODUCTION The methods for transmission of biomedical signals

through communication channels have turned into a vital issue which has clinical application. These techniques allow experts that evaluate this remote information which have been carried by these signals. However, in many conditions, this issue leads to transmission of large amount of information. For storage and transmission of this large amount of data, compression of ECG signals is crucial [1]. Up to now, distinctive methods have been proposed for compression which in a comprehensive categorization we can divide these into three groups; Time, frequency and Time-frequency domain techniques [2]. In the recent decades, most of the ECG compression techniques were included direct transformations methods such as AZTEC1, CORTES2, SAPA3, DPCM4[3]. Time domain techniques which are on the basis of direct approaches are considered as a preliminary transformation. At present, Transfer Coding is one of the most important digital waveform compression techniques in frequency domain.

This paper comprises these sections: in section II, we investigate the proposed algorithms in ECG compression. Criteria to evaluate algorithms are discussed in section III. In

1Amplitude-zone-time epoch coding 2Coordinate reduction time encoding system 3Scan-along polygonal approximation 4Differential pulse code modulation

section IV, the results of simulation are presented and finally section V includes conclusions of article.

II. PROPOSED ALGORITHMS It is a necessity that we should compress the digitized ECG

signals for storage and better transmission. A typical ECG monitoring device generates large of volume data in 24-48 hour's duration. For suitable signal recognition, more than twelve different streams of data may be obtained from the patient's body through connected sensors. The sampling rate of ECG signals is in the range of 125Hz-500Hz and each data sample can be digitized from 8 to 12 bits. By one sensor in the least sampling rate of 125Hz per minute and 8 bit decoding, data is generated by the rate amount to 7.5KB per minute and 250KB per hour. For a sampling rate of 500Hz and decoding of 12bit, data is generated by the rate of 54KB per minute and 30MB per hour [4].

Transfer coding (TC) is one of the significant methods in compression of digital waveforms in frequency domain. In this work, the purpose is decomposing of signal into frequency components and allotting true bits in the frequency domain. In many of the TC techniques, the input signal at first is divided to data blocks and each block is transformed to frequency domain, linearly. Transformation methods comprise processing of the input signals through a linear transformation and coding of the output signals by applying proper error criteria. For signal reconstruction, an inverse transform is used and signal is retrieved with some error. There is variety of the orthogonal transforms such as KLT5, DCT, FFT and DST that will be considered in the next sections [5].

A. Discrete Cosine Transform(DCT) It is an approximation of KLT and is used when the

correlation between input samples is considerable. The DCT of V V , V … VN T for vector x is defined as follows [5]:

∑ −

==

1N

0n n0 xV N1

)1N...(1k,)N2

k)1n2(cos(N2 1N

0n nk xV −=π+= ∑ −

=

(1)

5Karhunen-loeve transform

2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA2012), September 23-26, 2012, Bandung, Indonesia

978-1-4673-3005-3/12/$31.00 ©2011 IEEE 341

Page 2: [IEEE 2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA 2012) - Bandung, Indonesia (2012.09.23-2012.09.26)] 2012 IEEE Symposium on Industrial Electronics and Applications

where,V is the kth DCT coefficient. The cosine discrete inverse transformation of v is given by:

∑ −

=

π++= 1N

0k k0n )N2

k)1n2(cos(N2

N1 vvx

(2)

DCT is one of the appropriate tools for compression of signals and images due to its decorrelation and energy saving properties [6]. The DCT for N samples of signals is defined as follows:

1

0

2 (2 1)( ) ( ) ( ) cos( ); 0...( 1)2

N

x

x uF u c u f x u NN N

π−

=

+= = −∑ (3)

where:

C(u)= √ for u 01 O. W.

The f(x) and F(u) represent the xth amount of input signal sample and DCT coefficient, respectively. The inverse DCT is defined similar as follows:

∑ −

=−=+π= 1N

0x)1N...(0x),

N2u)1x2(cos()u(F)u(c

N2)x(f

(4)

B. Fast Fourier Transform (FFT) FFT is a prominent transform in digital signal processing

which has some applications in frequency analysis [7]. Periodicity and symmetry properties of DFT are advantages of the compression method. FFT for a sequence f(x) with a length of N and inverse FFT are defined as follows, respectively:

∑ −

=

π−

−== 1N

0xN

ux2j

)1N...(0u,)x(f)u(F e (5)

)1N...(0x,)x(fN1)x(f 1N

0uN

ux2j

e −== ∑ −

=

π (6)

C. Discrete Sine Transform(DST) DST [8] is equivalent with imaginary part of DFT while the

length is doubled. It is applied on real odd symmetrical dataset. DST determines a signal as the summation of sinusoids with different frequencies and amplitudes. It is linear and time invariant in F:RN RN which R indicates the set of real numbers. In addition, it can be assumed as N×N matrix. N real numbersx , x … xN are transformed into X , X … XN by the following equation:

∑ −

=−=++

+π= 1N

0n nk )1N...(0k)],1k)(1n(1N

sin[xX (7)

D. Discrete Cosine Transform-II(DCT-II) DCT-II [9] is commonly defined as a real and linear

orthogonal transform as follows:

∑δ −

=+π−

= 1N

0n n0,kII

k ]k)21n(

Ncos[

N2

xC (8)

where δ , is a Dirac delta function (for k=0 equals 1 and otherwise is zero).

DCT-II can be counted as a special DFT with real inputs. So, each FFT for calculating DFT leads to a fast algorithm like

DCT-II with eliminating redundancies. DFT is defined as follows:

∑ −

== 1N

0n nnk wxX (9)

where w e N .

Equation (9) is normalized for producing an appropriate relation between DFT and DCT-II.

∑ −

=+π= 1N

0n nk]k)

21n(

Ncos[2 xc (10)

In order to obtain c from DFT formula, we can use 2 cos LN w NL w NN L to acquire the following relation:

∑ −

=+π= 1N

0n nk]k)

21n(

Ncos[2 xc

∑ ∑−

=

=

−−+ += 1N

0n

1N

0n

k)1n2N4(

N4n

k)1n2(

N4n wxwx

∑ −

== 1N

0n

nk

N4n wx̂ (11)

in which x is real and even sequence with 4N length and is defined for 0<n<N as follows:

xx̂x̂ n)1n2(N4n2 == +− (12)

III. EVALUATION CRITERIA Study of the data comparison criteria is essential to evaluate

different ECG compression algorithms. The evaluation of performance for testing ECG compression algorithms includes three components: compression efficiency, reconstruction error and calculating complexity.

The compression efficiency is obtained by CR. The CR and reconstruction error are usually dependent on each other. The computational complexity is part of the practical implementation consideration [11-12].

A. Compression Ratio CR is one of the most important parameter in data

compression algorithms. High CR leads to a better response. CR is defined as ratio of the compressed signal rate over the original signal as follows [13]: CR= N N (13)

B. Distortion Measurment Determining of error criteria is one of the key points in

practical compression signals. Elimination of the redundancies and useless information is the aim of a compression system. We should find a solution for determining the difference between original and reconstructed signals, which is named distortion. Error measurement methods are RMSE6, PRD7 and SNR8.PRD is the best method for measuring distortion in which defines as follows [2]:

∑∑ ′−

=

== L

LPRD

b

b

1n

21n

2

)]n(x[)]n(x)n(x[ (14)

6Root mean square error 7Percentage root mean difference 8Signal to noise ratio

2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA2012), September 23-26, 2012, Bandung, Indonesia

342

Page 3: [IEEE 2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA 2012) - Bandung, Indonesia (2012.09.23-2012.09.26)] 2012 IEEE Symposium on Industrial Electronics and Applications

where x(n) is the original signal, x n is reconstructive signal and L is the block or sequence that PRD is calculated.

IV. EXPEMENTAL RESULTS In order to comprise the proposed algorithms, we use the

ECG data at MIT-BIH database. The MIT-BIH Arrhythmia Database contains 48 half-hour excerpts of two-channel ambulatory ECG recordings, obtained from 47 subjects studied by the BIH Arrhythmia Laboratory between 1975 and 1979. Twenty-three recordings were chosen at random from a set of 4000 24-hour ambulatory ECG recordings collected from a mixed population of inpatients (about 60%) and outpatients (about 40%) at Boston's Beth Israel Hospital; the remaining 25 recordings were selected from the same set to include less common but clinically significant arrhythmias that would not be well-represented in a small random sample [14]. ECG signals are sampled at 360Hz and the resolution of each sample is 11bits/samples.

In this work, compression of the ECG signals is done using DCT, FFT, DST and DCT-II.

• Steps of the first three algorithms are as follows:

- ECG signal is separated into x, y, z components, and the frequency and time between two samples are determined.

- The algorithms are applied on ECG signals and their initial coefficients set to zero (before compression). Then, the counter A increases while it lies in a specific range. These ranges are:

a. -0.22≤A≤0.22 for DCT.

b. -25≤A≤25 for FFT, and

c. -15≤A≤15 for DST.

- Depend on type of the algorithms, following steps are done:

a. DCT, FFT, DST coefficients set to zero after compression and the B counter is increased.

b. Inverse of the DCT, FFT and DST is calculated and the compression error curve is plotted.

c. Finally, the CR and PRD are computed.

Figures 1 to 6 represent the compressed and error signals for DCT, FFT and DST, respectively.

• Steps of the DCT-II are as follows:

a. Sequence x divided into N block of b ; i0 … N 1in which each block clarifies one

of the L samples. b. DCT is calculated for each block, then DCT

coefficients are quantized and finally they are encoded with lossless encoding.

Figures 7 and 8 represent the compressed and error signals after DCT-II coding, respectively.

In order to evaluate the performance of the proposed algorithms, the CR and PRD criteria are utilized. Table I

depicts the results of the mentioned algorithms based on these criteria. As seen from the table, the DCT-II has the high value for CR which it is appropriate. On the other hand, the PRD value in this algorithm is high. So, a compromise is made between CR and PRD.

V. CONCLUSION Compression rate of the four proposed algorithms was

investigated in this paper and their performance was evaluated based on two determined parameters. DST provides lowest CR among the four techniques presented and its distortion is also high. FFT improves CR and lowers PRD. So FFT is better choice than DST. DCT gives higher CR up to 91.43 with PRD as 0.9381, but DCT-II provides an improvement in terms of CR of 95.78 but PRD increases up to 1.3419. Thus DCT-II is commonly used for data compression due to its greater capacity to concentrate the signal energy in few transform coefficients.

TABLE I. COMPARISON OF COMPRESSION ALGORITHMS

PRD CR Method 0.9381 91.4300 DCT 1.1662 89.5800 FFT 1.2689 85.2800 DST 1.3419 95.7800 DCT-II

Figure 1.The ECG signal after DCT Compression.

Figure 2.Error signal after DCT Compression.

0 2 4 6 8 10 124

4.5

5

5.5

6

6.5

sec

mv

DCT Compression

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4The error signal after DCT Compression

sec

mv

2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA2012), September 23-26, 2012, Bandung, Indonesia

343

Page 4: [IEEE 2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA 2012) - Bandung, Indonesia (2012.09.23-2012.09.26)] 2012 IEEE Symposium on Industrial Electronics and Applications

Figure 3.The ECG signal after FFT Compression.

Figure 4.Error signal after FFT Compression.

Figure 5.The ECG signal after DST Compression.

Figure 6.Error signal after DST Compression.

Figure 7.The ECG signal after DCT-II Compression.

Figure 8.Error signal after DCT-II Compression.

REFERENCES

[1] X. Wang and J. Meng, “A 2-D ECG compression algorithm based on wavelet transform and vector quantization,” Science Direct, Digital Signal Processing,pp. 179-326, March 2007.

[2] Amita A.Shinde and Pramod Kanjalkar, “The Comparison of Different Transform Based Methods for ECG Data Compression,” International Conference on Signal Processing, Communication, Computing and Networking Technologies,(ICSCCN 2011).

[3] Satem Jalaeddine, “ECG Data Compression Techniques-A Unified Approach,” IEEE Transactions on Biomedical Engineering, Vol. 37,No.4,April1990.

[4] N. Ahmed, T. Natarajan and K. R. Rao, “Discrete Cosine Transform,” IEEE Trans. Trans. OnComputersC-23, pp. 90-93, 1974.

[5] M. Sharma and A. K. Wadhwani, “An Efficient Algorithm for ECG Coding,” International Journal of Scientific & Engineering Research,Volume 2, Issue 6, June-2011.

[6] S. O. Rajankar and S. N. Talbar, “An Optimized Transform for ECG Signal Compression,” In Proc. Of Int .Conf. on Advances in Computer Science, 2010.

[7] M. Clausen and U. Baum, “Fast Fourier Transforms,” BI-Wiss.-Verl, 1993.

[8] S. Chan and K. Ho, “Direct Methods for computing discrete sinusoidal transforms,” IEEE Proceedings, pp. 433-442, 1990.

[9] E. Feig and S. Winograd, “Fast Algorithms for Discrete Cosine Trnsforms,” IEEE Tran. On Signal Processing, vol-40(9), pp. 2174-2193, 1992.

0 2 4 6 8 10 124

4.5

5

5.5

6

6.5

sec

mv

FFT Compression

0 100 200 300 400 500 600 700 800 900 1000-0.5

-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

0.5

sec

mv

The error signal after FFT Compression

0 2 4 6 8 10 124

4.5

5

5.5

6

6.5

sec

mv

DST Compression

0 100 200 300 400 500 600 700 800 900 1000-0.5

-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

0.5

sec

mv

The error signal after DST Compression

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100004

4.5

5

5.5

6

6.5

sec

mv

DCT-II Compression

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-0.5

-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

0.5

secm

v

The error signal after DCT-II Compression

2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA2012), September 23-26, 2012, Bandung, Indonesia

344

Page 5: [IEEE 2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA 2012) - Bandung, Indonesia (2012.09.23-2012.09.26)] 2012 IEEE Symposium on Industrial Electronics and Applications

[10] Xuancheng Shao and Steven G. Johnson, “Type-II/III DCT/DST algorithms with reduced number of arithmetic operations,” Preprint submitted to Elsevier, May 2007.

[11] Shang-Gang Miaou, Heng-Lin Yen, Chih-Lung Lin, “Wavelet based ECG compression using Dynamic vector Quantization with Tree Code vectors in single codebook,” In IEEE Transaction on Biomedical Engineering, vol. 49, no. 7, pp. 671-680, 2002.

[12] R.shanta selva Kumari and V. Sadasivam, “A novel algorithm for wavelet based ECG signal coding,” cience Direct Computers and Electrical Engineering, 33, pp. 186-194,2007.

[13] Zhelong Wang ,Ying Chen, “ECG Signal Compression Based on MSPIHT Algorithm,” 5th International conference on Information technology and Application in Biomedicine, China ,May30-31,2008.

[14] Moody GB, Mark RG, “The impact of the MIT-BIH Arrhythmia Database,” IEEE Eng in Med and Biol, vol. 20, no. 3, PP. 45-50, May-June 2001.

2012 IEEE Symposium on Industrial Electronics and Applications (ISIEA2012), September 23-26, 2012, Bandung, Indonesia

345