complete coding scheme using optimal time domain ecg ... - eurasip

30 downloads 13497 Views 325KB Size Report
Which signal samples to be extracted depend on the underlying criterion for the sample selection process. To get a high performance time domain compression ...
COMPLETE CODING SCHEME USING OPTIMAL TIME DOMAIN ECG COMPRESSION METHODS Ranveig Nygaard and Dag Haugland

Høgskolen i Stavanger Dept. of Electrical and Computer Technology, P. O. Box 2557 Ullandhaug, 4004 Stavanger, NORWAY Tel: +47 51 83 10 51; fax: +47 51 83 17 50 e-mail:

[email protected]

ABSTRACT

Traditionally, compression of digital ElectroCardioGram (ECG) signals has been tackled by heuristical approaches. However, it has recently been demonstrated that exact optimization algorithms perform much better with respect to reconstruction error. Time domain compression algorithms are based on the idea of extracting representative signal samples from the original signal. As opposed to the heuristical approaches, the exact time domain compression algorithms are based upon a sound mathematical foundation. By formulating the sample selection problem as a graph theory problem, optimization theory can be applied in order to yield optimal compression. The signal is reconstructed by interpolation among the extracted signal samples. Dierent interpolation methods have been implemented, such as linear interpolation [1] and second order polynomial reconstruction [2]. In order to compare the performance of the two algorithms in a fully justied way, the results have to be encoded. In this paper we develop an ecient encoding method based on entropy coding for that purpose. The results prove good performance of the exact optimization methods in comparison with traditional time domain compression methods.

1 INTRODUCTION

The large amount of data involved in storage and transmission of digital ElectroCardioGram (ECG) signals call for ecient compression methods in order to keep such data in manageable sizes. The compression must be done in a way that makes accurate reconstruction of the signal possible. Time domain algorithms for signal compression is based on the idea of extracting a subset of signal samples from the original signal. Which signal samples to be extracted depend on the underlying criterion for the sample selection process. To get a high performance time domain compression algorithm, much eort should be put in designing intelligent sample selection criteria. There exist quite a few well known time domain compression algorithms for ECG signals today. They all have the one thing in common that they are based on

fast heuristics in the sample selection process. Examples of such algorithms is the popular FAN algorithm [3], the well known AZTEC [4] algorithm and the heuristics of Tai [5], [6]. As opposed to these algorithms, the Cardinality Constrained Shortest Path (CCSP) algorithm presented in [1] is based on a rigorous mathematical model of the entire sample selection process. By modelling the signal samples as nodes in a graph, optimization theory may be applied in order to achieve the best compression possible under the given circumstances. In [1] the goal is to minimize the reconstruction error given a bound on the number of samples to be extracted. The samples of the original signal are modeled as nodes in a directed graph. Any pair of nodes are connected with an arc, the direction of which is given from the sample order. We will associate a subset of selected samples with a path in the graph. Including a particular arc in the path corresponds to letting the end nodes of the arc constituting consecutive samples in the extracted subset of signal samples. The length of each arc in the digraph can be dened in a variety of ways. In [1] and [2] the length of the arc connecting two samples i and j is dened as the contribution to reproduction error from eliminating all samples recorded between i and j. Dening the problem in this way, minimization of the reconstruction error can be recognized as solving the cardinality constrained shortest path problem dened on the graph. The algorithm in [1] is, like most other time domain methods, based on reconstruction of the signal by linear interpolation between the extracted signal samples. As opposed to this, the method presented in [2] is based on reconstruction by use of second order polynomial interpolation between the extracted samples. Dierent second order polynomials are developed for each signal segment to be reconstructed, and the polynomials are tted in a way that makes the reconstruction error minimal. The performance of time domain compression methods are often evaluated as some distortion measure as a function of sample reduction ratio, dened as the number of samples in the original signal per retained sample. In order to be able to compare the method based on lin-

ear interpolation to the method based on second order polynomial interpolation in a fully justied way, encoding of the extracted signal samples will have to take place. This is due to the fact that in order to describe a second order polynomial, three parameters are generally needed while only two are necessary in the linear interpolation case. Therefore the sample reduction ratio will not make a fair yardstick in comparison of the two methods. In this paper, entropy coding is applied to the extracted signal samples along with their corresponding positions. The results in [2] show that the polynomial approximation method seems to have a high potential as compared to other time domain methods. By actually coding the results, the full truth will come to light. In the next section some background theory for the problem is presented. Section 3 deals with details regarding the actual encoding method applied. Finally, computationally results are reported, and in the concluding section dierent aspects of the method along with future work are considered.

2 BACKGROUND THEORY

M

M

n ;n

k

n ;n

ij

y j

ij

j

y i

i

ij

ij

ij

ij

ij

ij

ij

M

M

M

M

M

n

j

ij

N

n

k

k

i

N

k

k

n

k

n

3 CODING SCHEME

Denote the signal samples extracted by one of the time domain coders in [1] or [2] by y(n ), k = 1; : : : ; M . Denote the approximated signal samples used in the representation in the polynomial case by y^(n ), k = 1; : : : ; M 1. In order to make the coding scheme more eective, the signal amplitudes are substituted ^ by their relative  changes,  = y (n +1 ) y(n ),  = k+ k 1 k+1 + k y^ . Denote the run associated y^ 2 2 with each extracted signal sample as r = n +1 n . In the linear case, there are pairs of ( ; r ) to be coded. Together these constitute a natural source word to be encoded. In the polynomial case there are triples ( ; ^ ; r ) to be encoded for each segment of the signal. In the linear interpolation case we have at least two possible strategies when choosing between coding strategies: 1. Coding of amplitudes and runs by two separate coders. 2. Coding of the concatenated symbols ( ; r ) by one single coder. Alternative 2 implies a high number of possible source symbols. The original bit representation for the test signals in Section 4 is 12 bits for the amplitudes, and if we assume that no run is longer than 256, we arrive at 212 28 = 220 possible dierent source symbols. However, numerical experiments show that only a small fraction of these symbols, typically 2000 to 4000 dierent symbols, are actually used. By investigating the joint probability distribution of the dierential amplitudes and the runs, we nd that it is highly skew. This indicates that there is a prot by coding the amplitudes and runs together. For this reason we choose to use alternative 2 for the linear interpolation case in this context. When it comes to the polynomial interpolation case, the same reasoning as in the linear interpolation case is valid. We therefore apply one entropy coder to ( ; r ) and a separate entropy coder to (^ ). The structure of the total encoding system will thus be as illustrated in Figure 1. The complexity of the CCSP algorithm is of O(MN 2 ) where N is the number of original signal samples and M k

k

k

n

The methods described in [1] and [2] extract samples from a signal by modelling the samples of the original signal as nodes in a digraph. Denote the original signal samples by y(1); y(2); :::; y(N ) and let M denote the bound on the number of extracted samples. We seek an appropriate compression set C = fn1 ; n2 ; :::; n g  f1; 2; :::; N g and the corresponding sample values. Assume n1 = 1 and n = N . The approximation is then given by y^(n) = y(n) if n 2 C and y^(n) = f k k+1 (n) where n < n < n +1 for all n 2= C; n 2 f1; 2; :::; N g. Here f k k+1 (n) denotes a presumed reconstruction of y(n). In the case of linear interpolation f (n) is given by f (n) = y(i) + ( ) ( ) (n i), n 2 [i; j ]. In the second order interpolation case f (n) = a0 + a1 n + a2 n2 ; n 2 [i; j ] where a0 , a1 , and a2 denotes the optimal parameters of the second order polynomials, i.e., the parameters that minimize the reconstruction error. In this way we get a piecewise approximation to the original signal based on either linear interpolation or second order polynomial interpolation. Dene the directed graph G = (V; A) whose vertex set V = f1; 2; :::; N g and arc set A contains node pairs (i; j ) where i; j 2 V and i < j . If n1 ; n 2 V , the set (n1 ; n2 ; :::; n ) is said to be a path from n1 to n in G if n1 ; :::; n 2 V are distinct vertices and n1 < n2 <    < n . Let P denote the path from node 1 up to node n. The length of each arc (i; j ) in A is given as the contribution to the total reconstruction error by eliminating all nodes P between i and j . This can be expressed as c2 = =1+1 (^y(n) y(n))2 . We are then faced with the following problem : Minimize the length of P under the constraint that P contains no more than M vertices. This problem is solved by a k

dynamic programming algorithm thoroughly described in [1]. In order to be able to reconstruct the signal by linear interpolation, we need one sample amplitude and the distance from the previous sample, referred to as a run, for each segment of the signal to be reconstructed. For the polynomial interpolation case we need two amplitudes and one run. We represent each second order polynomial between nodes n and n +1 by the amplitude y(n ), the run length, n +1 n and the approx imate sample value y^ k +2 k+1 . This data set determines the piecewise polynomial reconstruction uniquely.

n

n

k

k

k

k

k

k

k

k

k

k

k

k

k

k

n

k

k

Extraction of (run,amplitude) samples by CCSP algorithm (linear)

mit100_1000

channel

25

Entropy coder

20

PRD

y(n)

a) Linear interpolation case

15 10 5

(run,amplitude) y(n)

0 0.2

Entropy coder 1

Extraction of

0.6

0.8

1 1.2 Bit rate (bits/sample)

1.4

1.6

1.8

1.4

1.6

1.8

mit207_1800

Multiplexer

25

CCSP algorithm amplitude Entropy coder 2

20

PRD

(polynomial)

0.4

channel

samples by

b) Polynomial interpolation case

10

Figure 1: Structure of encoding system

5 0 0.2

is the upper bound on the number of extracted samples in both the linear and polynomial interpolation case. To keep the execution time down, the input signal is divided into blocks of 500 samples before extraction of samples by the CCSP algorithm. The total record of extracted signal samples and their corresponding runs are then entropy coded as described above. To achieve an even more ecient implementation of the coder, the method described in [7] can be applied. By dividing the signal into short blocks (i.e., 100 or 150 original signal samples) before extraction of samples, the CCSP algorithm satises real time requirements. However, short blocks will lead to loss of optimality due to the fact that the end points of each block are always extracted as signicant signal samples. The method described in [7] proposes a technique to account for this. The FAN algorithm [3] is a well known time domain compression method. In comparison with other time domain coders, it has been reported to give high compression ratio, in addition to producing reconstructed signals with high delity [8]. We compare the results from the FAN algorithm to the exact optimization techniques. The samples extracted by the FAN algorithm are encoded in the same manner as the samples extracted by the CCSP algorithm with linear approximations, see Figure 1.

4 NUMERICAL EXPERIMENTS

For evaluation of the performance of the two coders, a commonly used performance measure, the Percentage Root mean square Dierence (PRD) is applied: v u uP PRD = t P=1 (y(n) N n

y^(n))2  100%; y)2 =1 (y (n)

N n

15

(1)

where y and y^ denotes the original and reconstructed signal, respectively, y is the mean value of y(n) and N is the original signal length. The PRD performance measure is useful for testing the relative performance of the coding techniques. However, as each compression

0.4

0.6

0.8

1 1.2 Bit rate (bits/sample)

Figure 2: Coding performance for the two test signals. The techniques used are: Linear interpolation CCSP (solid line), polynomial interpolation CCSP (- -), and FAN (solid line with circles). method has its own distortion characteristic, the PRD should be supplemented by visual inspection of the reconstructed signal. Several recordings taken from the MIT [9] database were applied in the coding experiments. We present results for two test signals: mit100 1000 and mit207 1800. Here mitxxx_yyyy denotes record number xxx starting at time yy:yy. Each total record time is ten minutes, corresponding to 216 000 samples. The sampling frequency is 360 Hz with 12 bits per sample. The signal mit100 1000 is normal sinus rhythm while mit207 1800 is abnormal ventricular rhythm. Figure 2 presents obtained PRD's for the coders for bit rates between 0.2 and 1.8 bits per sample (bps). For both test signals, the FAN method is outperformed by both the CCSP methods by a wide margin. At low bit rates (around 0.6 bps) the FAN algorithm has from 30 % to 90 % higher PRD than the CCSP algorithm based on linear approximations. At higher rates (around 1.0 bps) the dierence is smaller, but still signicant. The linear interpolation method performs best in terms of PRD for bit rates below 0.5 bps. For test signal mit100_1000, the CCSP method based on polynomial interpolation gives slightly lower PRD than the CCSP method based on linear interpolation for bit rates above 0.5 bps. For test signal mit207_1800, the dierence between the linear and polynomial interpolation methods is marginal. Side information has not been taken into account in the rate-distortion curves of Figure 2. When applying the encoding technique chosen here, we assume that we are either using xed tables in the encoding and decoding part of the system or coding on a block-adaptive basis.

Original

CCSP, linear approximation

FAN

CCSP, polynomial approximation

Figure 3: Reconstructed signal segment (taken from mit100_1000) at 1.0 bps. Evaluation of the performance of the dierent coders should be accompanied by visual inspection of the reconstructed signals. This is to show coding artifacts as they appear for the dierent coders. We have chosen a short segment of the mit100_1000 signal. The reconstructed signal is shown at a bit rate of 1.0 bps in Figure 3. The original signal is also included. We see that all coders smooth out some of the details in the original signal. This is particularly evident for the FAN coder, where the linear line pieces are also most prominent in the reconstructed signal. The CCSP coder with polynomial approximations produces a reconstructed signal which is less rough than the other methods.

5 CONCLUSIONS

We have compared the performance of two optimal time domain compression methods presented in [1] and [2], and a heuristical time domain compression method for ECG data compression. In order to make the comparison as justied as possible, a complete coding scheme is applied. Coding experiments show that the optimal time domain coders have signicantly higher performance than other well known time domain compression methods. This is validated by evaluation of the coders based on PRD and veried by visual inspection of the reconstructed signal. The CCSP algorithm with linear approximations has slightly higher performance than the CCSP algorithm with polynomial approximations for bit rates below 0.5 bps. However, the CCSP method based on polynomial approximations produces the visually best approximation to the original signal. In this paper we have considered rst and second or-

der polynomials in compression of ECG signals. The results show that there is a potential for polynomials of higher degree than one in compression of ECG signals. Development of such algorithms is left as a topic for future research.

References

[1] D. Haugland, J. Heber, and J. Husøy, Optimisation algorithms for ECG data compression, Medical & Biological Engineering & Computing, vol. 35, pp. 420424, July 1997. [2] R. Nygaard and D. Haugland, Compressing ECG signals by piecewise polynomial approximation, in Proc. Int. Conf. Acoust. Speech, Signal Proc., (Seattle, Washington, USA), May 1998. [3] D. A. Dipersio and R. C. Barr, Evaluation of the fan method of adaptive sampling on human electrocardiograms, Medical & Biological Engineering & Computing, pp. 401410, September 1985. [4] J. Cox, F. Noelle, H. Fozzard, and G. Oliver, AZTEC: A preprocessing program for real-time ECG rhythm analysis, IEEE Trans. Biomed. Eng., vol. BME-15, pp. 128129, 1968. [5] S. C. Tai, Slope  a real-time ECG data compressor, Medical & Biological Engineering & Computing, vol. 29, pp. 175179, March, 1991. [6] S. C. Tai, AZTDIS  a two phase real-time ECG data compressor, Journal of Biomedical Engineering, vol. 15, pp. 510 515, Nov. 1993. [7] J. G. Heber, D. Haugland, and J. H. Husøy, An ecient implementation of an optimal time domain ECG coder, in Proc. of IEEE Engineering in Medicine and Biology, (Amsterdam, The Netherlands), Nov. 1996. [8] S. M. S. Jalaleddine, C. G. Hutchens, R. D. Strattan, and W. A. Coberly, ECG data compression techniques  a unied approach, IEEE Trans. Biomedical Engineering, vol. 37, pp. 329343, April 1990. [9] G. Moody, MIT-BIH Arrhythmia Database CD-ROM (second edition), overview. Massachusetts Institute of Technology, August 1992.

Suggest Documents