Professional Documents
Culture Documents
Abstract—In this study, we develop an efficient lossless ECG Huffman code is an optimal statistical code that is veri-
compression based on delta coding and optimal selective fied to generate the shortest average codeword length
Huffman coding and implement the proposed algorithm in the
among all uniquely decodable variable length codes [4].
S3C2440 development board. The delta coding is applied to
reduce the dynamic range of the original ECG signals. The However, the compression of canonical Huffman coding
optimal selective Huffman coding is used to enhance the com- needs a full predefined probability distribution table. This
putation efficiency of canonical Huffman coding. In order to makes canonical Huffman coding not practical for encoding
evaluate the effectiveness of the proposed algorithm, a 10-min time varying data in real-time. To alleviate this problem,
ECG recordings (MIT100) which is a normal sinus rhythm optimal selective Huffman coding was proposed in [5]
taken from the MIT/BIH database were applied to the coding
which just needs a partial probability distribution table but it
experiments. Comparing with the canonical Huffman coding
algorithm, the proposed algorithm has gained much improve- may slightly sacrifice the compression ratio. Optimal selec-
ment on the computation efficiency by 211.2% when the first tive Huffman is a more efficient algorithm that allows the
63 frequently occurring codewords are selected, although utilization of the compression advantages of canonical
slightly sacrificing the compression rate by 0.34%. Huffman coding in the lossless ECG compression.
Considering practical applications, ECG compression al-
Keywords—Lossless ECG Compression, Delta Coding, Op-
timal Selective Huffman Coding. gorithm should have an adequate compression rate and must
be operated in real-time. In this paper, delta coding is firstly
used to transform the original ECG sequence into a new
I. INTRODUCTION sequence which has a smaller variance and dynamic range.
Next, we employ optimal selective Huffman coding to
An electrocardiogram (ECG) contains useful physiologi- compress the delta encoded ECG signal. Subsequently, we
cal information on the physical condition of the heart. A implement the proposed algorithm in the S3C2440 devel-
portable ECG recorder is common used to measure transient opment board.
responses of cardiac electrical activity for a period of time
24 hours or longer. The memory requirements for such a
long ECG signal are very huge and can significantly in- II. METHODS
crease the recorder’s size and cost. Therefore, ECG signal
compression is required to reduce the size of the stored data.
A. Delta Coding
Moreover, the decompressed ECG signals must contain
sufficient message for clinical doctors to be able to diagnose ECG is a waveform signal. The successive samples of
electrical activities in the heart and further data processing. ECG signal have a very high correction and small differ-
Lossy compression algorithms likely neglect some features
ences between them. This small difference signal will have
that may be desired for further analysis of ECG signals. On
the other hand, lossless compression algorithms can keep a much lower dynamic range than the original ECG signal,
the signal exactly as measured. so it can be effectively quantized using a smaller number of
Several researches of lossless ECG compression were in- bits by some coding methods, like delta coding. Fig. 1
vestigated. Koski [1] used LZ77, complex extraction, and shows an example of how delta coding is performed. The
Huffman coding for lossless ECG compression. Giurcâne- first sample in the encoded signal is equal to the first sample
anu et al. [2] proposed a lossless scheme using contexts and of the original ECG signal. Subsequent encoded samples are
R-R interval estimation. Miaou and Chao [3] proposed a
lossless ECG compression method based on wavelet trans- equal to the difference between the current sample and the
form and vector quantization. previous sample of the original ECG signal.
C.T. Lim and J.C.H. Goh (Eds.): WCB 2010, IFMBE Proceedings 31, pp. 1327–1330, 2010.
www.springerlink.com
1328 G.C. Chang and Y.D. Lin
B. Huffman Coding
Huffman coding is an entropy encoding algorithm used
for lossless data compression. It uses the most frequently
occurring symbols with short codewords and the less fre-
quently occurring ones with long codewords. A Huffman C. Optimal Selective Huffman Coding
code is created by constructing a binary tree. The path from
Assume k different symbols, s1, s2, …, sk, with frequen-
the root to each leaf gives the codeword of different symbol
cies of occurrence p1 ≥ p2 ≥ … ≥ pk, respectively. The opti-
for the bit sequence of the edges passing through the path.
mal selective Huffman coding only uses m+1 Huffman
An example of constructing a Huffman code can be shown
in Table 1 and Figs. 2. Table I shows the frequency of oc- codewords, m for encoding the m most frequently occurring
currence of each of the possible symbols. Fig. 2 displays the symbols, s1, s2, …, sm (m < k), and 1 for indicating the rest,
full Huffman tree. Table II presents the compressed data sm+1, …, sk, unencoded symbols. The occurrence probability
given in Table 1. of the latter codeword is equal to the sum of the occurrence
probabilities of all the unencoded different symbols.
Table 1 Data Set, Occurrence Frequency, and Codewords Consider the data set of Table 1 and let m = 3, that is,
0001 and 0010 are the unencoded symbols. The sum of the
occurrence probabilities of 0001 and 0010 is equal to 3/20.
Fig. 3 shows the optimal selective Huffman tree. Table 3
presents the compressed data using optimal selective Huff-
man coding.
III. EXPERIMENTAL RESULTS Table 4 The probability of occurrence of each distinct symbol in MIT100
ECG signal
In order to analyze the performance of the proposed algo-
rithm described here, a 10-min ECG recordings (MIT100)
which is a normal sinus rhythm taken from the MIT/BIH [6]
database were applied in the coding experiments. The sam-
pling frequency is 360 Hz with 12 bits per sample. Fig. 4(a)
shows the original ECG signal selected from record
MIT100. Fig. 4(b) presents the delta encoded ECG signal. It
can be seen that the dynamic range of the original ECG
signal has been limited between -100 and 100 which can be
represented by 8-bit per sample.