Di-Hu Chen & Sheng Yang
Department of Precision Machinery & Instrumentation, University of Science and Technology of China, Hefei 230027, China.* Correspondence
should be addressed to Di-Hu Chen (dhchen@mail.ustc.edu.cn).
relations like video signals with intra-frame and
ABSTRACT inter-frame correlations, video codec technology can
be used for ECG compression. For ECG signals, there
In this paper, we present a method using is a little difference, so some pre-process will be
video codec technology to compress ECGneeded: ECG signals should be segmented and period
signals. This method exploits both intra-beatnormalized to a sequence of beat cycles with the
and inter-beat correlations of the ECG sig-same size. Then these beat cycles can be treated as
nals to achieve high compression ratios (CR) 'picture frames' and compressed with a video codec.
and a low percent root mean square differ-In this work, we present a method using video
ence (PRD). Since ECG signals have both codec technology to compress ECG signals. This
intra-beat and inter-beat redundancies like method exploits both intra-beat and inter-beat corre-
video signals, which have both intra-framelations of the ECG signals to achieve high compres-
and inter-frame correlation, video codec tech-sion ratios (CR) and a low percent root mean square
nology can be used for ECG compression. Indifference (PRD). Although video codec technology
order to do this, some pre-process will bewas developed to compress video signals, it can be
needed. The ECG signals should firstly be used to compress other signals as well, and we illus-
segmented and normalized to a sequence of trate how video codec technology can be used to com-
beat cycles with the same length, and thenpress ECG signals. In Section II, we take a brief over-
these beat cycles can be treated as pictureview of video codec technology. Section III presents
frames and compressed with video codecthe coding algorithm. Experimental results and com-
technology. We have used records from MIT-parisons with other algorithm are presented in Sec-
BIH arrhythmia database to evaluate our algo-tion IV.At last, we provide conclusions.
rithm. Results show that, besides compres-
sion efficiently, this algorithm has the advan-
tages of resolution adjustable, random 2. OVERVIEW OF VIDEO CODEC TECH-
access and flexibility for irregular period and NOLOGY
QRS false detection. Representing video material in a digital form
requires a large number of bits. The volume of data
generated by digitizing a video signal is too large for
most storage and transmission systems. This means
that compression is essential for most digital video
applications. Statistical analysis of video signals indi-
cates that there is a strong correlation both between
The electrocardiogram (ECG) is an important tool for
successive picture frames and within the picture ele-
diagnosis of heart diseases. The volume of ECG data
ments themselves.Theoretically decorrelation of these
produced by modern monitoring system can be quite
signals can lead to bandwidth compression without
large over a long period of time and data compression
significantly affecting image resolution. A video sig-
is often needed for efficient process, store and trans-
nal consists of a sequence of individual frames. Each
mit of such data. In the past, many ECG compression
frame may be compressed individually using an
methods were proposed and could be classified into
image CODEC, such as JPEG. This is described as
three major categories [1]: a) Parameter extraction
intra-frame coding for each frame is intra coded with-
techniques. b) Transform-domain techniques. c)
out any reference to other frames. However, better
Direct time-domain techniques.
compression performance may be achieved by
In this paper, we present a method for compression
exploiting the temporal redundancy in a video
of ECG data using video codec technology. Since
sequence or the similarities between successive
ECG signals have both intra-beat and inter-beat cor-
Keywords: ECG compression; Video
CODEC; QRS detection; Arithmetic coding
Compression of ECG signal using video codec
technology-like scheme
Compression of ECG signal using video codec
technology-like scheme
J. Biomedical Science and Engineering, 2008, 1, 22-26Scientific
Published Online May 2008 in SciRes.http://www.srpublishing.org/journal/jbise
SciRes Copyright ©2008
videoframes. This maybeachievedbyintroducingsequence of individual frames and these frames are of
two functions: 1. Prediction: create a prediction of the same size. But for ECG signals, these 'frames' or
thecurrentframebasedononeormorepreviouslybeat cycles are jointed together, and even the sizes of
transmittedframes.2.Compensation:subtractthethem are not the same. The comparability of the ECG
prediction from the current frame to produce a resid-signalsandvideosignalsmotivatesustodesigna
ual frame. Then the residual frame is compressed by novel ECG compression scheme using video codec
an image CODEC. In order to decode the frame the technology, in which the scheme employs the arith-
decoder adds the prediction to the decoded residualmetic coding for intra-beat redundancies, and a pre-
frame. This is described as inter-frame coding fordictor using cross correlation for inter-beat redun-
frames are coded based on some relationship with dancies.
other video frames.showstheprocessThe functional block diagram of the proposed cod-
above.ing scheme is shown in . The encoder system
consists mainly four parts: segmentation, period nor-
malization, predictor and residual coding. The pro-
3. METHODposed encoding algorithm is briefly described as fol-
3.1. System overviewlows. Since ECG signals are continuous and in order
The redundancies in ECG signals can be broadly clas-to use compress them using a video codec scheme,
sified into two types: The redundancies in a single firstly we should segment them to a sequence of
ECG cycle and the redundancies across ECG cycles. cycles, by noting that the length of each beat cycle
These redundancies are sometimes referred to as may be varying, a period normalization process is
intra-beat and inter-beat redundancies [2]. These are then proceeded to ensure that the size of each beat
the same with redundancies in video signals. On the cycle is adjusted to be the same. Initially, the counter
other hand, there is a little difference between video is set to zero and we select the first cycle as the pre-
signals and ECG signals: A video signal consists of a
Figure 2
Figure 1. Video CODEC with prediction.
Figure 2.Functional block diagram of the encoder.
SciRes JBiSE Copyright ©2008
D.H. Chen et al./J. Biomedical Science and Engineering 1 (2008) 22-26
diction cycle and compress this cycle with no predic-nology, we normalize each ECG period to the same
tion, then any time when there is a new cycle, the length.Weimplementthisusingamethodsimilarto
counter is added by one and the cross correlation theonedescribedin[4]. Letx=[x(1)x(2) x(N)]
kk kkk
coefficient of the new cycle and the prediction cycle denote thek-th ECG cycle. Then the period-normalized ECG
is calculated. If the result is less than the threshold,cycley=[y(1)y(2) y(N)] is computing using
kk kk
which indicates that this new cycle and the prediction
cycle have little similarity, or the count is larger than
L(used for random access), we set the counter to zero
and set this new cycle as the prediction cycle and com-
press it with no prediction, else the prediction cycleWhere is an interpolate version of the samples
is subtracted from this new cycle, and the residualx(n) , andt'= ,N is the period of the k-th
cycle is then quantized and compressed with theECG cycle, and Nis the normalized period. We uti-
arithmetic coding.lize cubic-spline interpolation [5] to determine .
The Nabove can be thought as the resolution, like
3.2. QRS detection and segmentationthe spatial resolution (typically 352288 or 352
To cut continuous ECG signals to individual beats, 240 pixels in MPEG-1) in a video encoder. The value
the peaks of QRS waves should be detected firstly to ofNis predefined in consideration of the sample fre-
identify each heartbeat. We use a different method toquency and it can affect the CR and the PRD.
do this: Letx(i) denote the ECG signal, and a corre-After period normalization, each ECG period will
sponding different signal x'(i) is given bybe with the same length like video frames with the
same size. Then we can use similar video CODEC
technology to compress them.
3.4. Prediction
where n is a small integer determined by the samplingIn part 2 we know that, in order to exploit the similar-
frequency (typically a value between 0.01f and 0.02fities between successive video frames, two functions
is used, where f is the sampling frequency). Several prediction and compensation are introduced. The key
zero points are added to the front and the end of theto this approach is the prediction function: if the pre-
ECG signals for calculation of the first and last few diction is accurate, the residual frame will be con-
points ofx'(i). When select proper n for different sam-taining little data and will hence be compressed to a
ple frequency, (1) is like a band pass filter. It makesvery small size by the image CODEC.
the QRS waves be amplified and the other waves beFor video compression, the simplest predictor is
weaken.shows a typical ECG signal and its just the previous transmitted frame. We can utilize
corresponding difference signal generating by (1).this in ECG compression. Since successive ECG
The sample frequency is 360Hz withn equals to 5. cycles are very similar all the times, we make a small
For the different signal x'(i), we can use a similarchange and introduce the cross correlation coeffi-
scan algorithm in [3] for the QRS detection. Resultscient. Cross correlation coefficient is a standard
show that, our method has a higher detection rate.method of estimating the degree to which two series
After each QRS peak of heartbeat cycles is identi-are correlated. Consider two series x and y where
fied, the original ECG signal is cut at every QRS peak.ii
i=0,1,2 N1, the cross correlation coefficient is
defined as
3.3. Period normalization
Since each ECG period can have a different duration,
and in order to compress them using video codec tech-
Where x and y are the means of the corresponding
Prediction with cross correlation is shown in
.Initially we set the counter to zero. The first
ECG beat cycle is set as the prediction beat cycle and
compressed with no prediction. Any time when there
is a new beat cycle, the counter is added by one and
the cross correlation coefficient of the new beat cycle
and the prediction beat cycle is calculated. If the
counter is smaller than L (predefined for random
access) and the correlation result is higher than the
threshold (typically 0.95 or more), which indicates
that the prediction beat is similar with the current
beat to a great extent, then we use it as the prediction
Figure 3
ure 2
SciRes JBiSECopyright © 2008
24D.H. Chen et al./J. Biomedical Science and Engineering 1 (2008) 22-26
Figure 3.ECG signal and corresponding different signal.
Voltage mV
Voltage mV
500 1000 1500
500 1000 1500
of the current beat. Otherwise, we use the currentpicture. It is followed by an arrangement for P- and
beat to replace the prediction beat and compress itB-pictures. Likewise, we introduce the group of
with no prediction and set the counter to zero again.cycles in our scheme to assist random access into the
ECG data. The group of cycles length is defined as
the distance between I-cycles, which is represented
3.5. Quantization and Coding
by parameter Lin.A short group of cycles
The quantization stage removes less important infor-
may support random access well at the cost reducing
mation, such as information that does not have a sig-
the compression ratio.shows a typical
nificant influence on the appearance of the recon-
group of cycles.
structed ECG signals, making it possible to compress
the remaining data.
In this paper, we use the arithmetic coding [6] for4. RESULT
compression of the residual signal and the period infor-We used the MIT-BIH arrhythmia database to evalu-
mation.An arithmetic encoder converts a sequence of ate the performance of the proposed scheme. The
data symbols in to a single fractional number. The lon-ECG data used in our experiments are sampled at 360
ger the sequence of the symbols, the greater the preci-Hz and each sample has a resolution of 12 bit per sam-
sion required to represent the fractional number.ple. Through period normalization, we have made the
Arithmetic coding provides a practical alternative to number of samples in each beat cycle equal 240.
Huffman coding and can more closely approach theAlthough for a typical hart rate of 75 beat per minute,
theoretical maximum compression [7].288 samples in each beat cycle will be good, but a rel-
ative small samples will increase compression ratio
3.6. Coding of beat cycleswithout obviously affecting the reconstruction qual-
In the video coding standard MPEG-1, each frame ofity.
video is encoded to produce a coded picture. ThereWe use two widely used measures, the compres-
arethree maintypes: I-pictures, P-pictures and B-sion ratio (CR) and the percent root mean square dif-
pictures. I-pictures are intra-coded without any ference (PRD) to evaluate our scheme.The CR and
motion-compensated prediction. An I-picture is used PRD aredefinedas
as a reference for further predicted pictures. P-
pictures are inter-coded using motion-compensated
prediction from a reference picture. B-pictures are WhereB is the total bits of the original ECG sig-
inter-coded using motion-compensated predictionori
from two reference pictures, the P- and/or I-pictures nal, B is the total bits of the ECG signal after com-
before and after the current B-picture. However, inpression.
our proposed scheme for ECG compression, we only
introduced two types: I-cycles and P-cycles.
I-cycles are useful resynchronization points in the
coded bit stream: because it is coded without predic-
tion, an I-cycle may be decoded independently of any
other coded cycles. This support random access by a
Wherex and x are the original and the recon-
decoder in some degree (a decoder may start decod-ori rec
ing the bit stream at any I-cycle position). However,structed ECG signals, andndenotes the length of the
an I-cycle has poor compression efficiency because signals.
no prediction is used.and show example of ECG data
In MPEG-1 due to the existence of several picturefrom record 117 and record 119 with irregular period
types, a group of pictures (GOP) is the highest level before and after compression.
of the hierarchy.A GOP is a series of one or more pic-In, the proposed method is compared with
ture to assist randomly access into the pictureother methods in literature for record 117 and 119.
sequence. The first coded picture in the group is an I-
Figure 2
Figure 4
Figure 5Figure 6
Table 1
Figure 4.Group of cycles in coded bit stream.
Figure 5.Reconstruction example of MIT-BIH record 117 with
quantization level of 10V and 20V : (a) original signal of
channel 1, (b) reconstruction signal of channel 1 with quantization
level of 10V, CR=16 and PRD=2.87, (c) reconstruction signal of
channel 1 with quantization level of 20V,CR=30.79 and
SciRes JBiSE Copyright ©2008
D.H. Chen et al./J. Biomedical Science and Engineering 1 (2008) 22-26
The main contribution of this paper is to provide an
effective and efficient ECG compression scheme
using video codec technology. We have tested the per-
formance of the proposed scheme by compressing
record from the MIT-BIH arrhythmia database and
compared the results with other methods. The results
show that the proposed algorithm compares favorable
to other methods in literature. Besides compression
efficiently, the proposed algorithm benefits from char-
acteristics of the video codec and has the following
advantages: a) Resolution adjustable. By changing
the length Nin section 3.3, we can achieve different
resolution just like spatial resolution in a video codec;
b) Random accessible. In coding stream of the ECG
data, the I-cycles are intra-coded without any predic-
tion, thus we can access the ECG data from every I-
cycle. c) Flexibility for irregular period and QRS
false detection. In our scheme, the irregular periods
or the QRS false detection beat cycles will be treated
as the new prediction cycles and compressed with no
prediction if they don't have enough similarity with
the formal prediction cycle.
Figure 6. Reconstruction example of MIT-BIH record 119 with
quantization level of 10Vand 20V: (a) original signal of
channel 1, (b) reconstruction signal of channel 1 with
quantization level of 10V, CR=14.2 and PRD=3.03, (c)
reconstruction signal of channel 1 with quantization level of
20 V,CR=24.2 and PRD=6.25.
Lu et. al[8]
Djohan et. al[10]
Lee et.al[1]
Lu et. al[8]
PRD (%)
Table1. PRD comparison of different algorithms for record
117 and 119.
SciRes JBiSECopyright © 2008
26D.H. Chen et al./J. Biomedical Science and Engineering 1 (2008) 22-26
[1] H. Lee & K. M. Buckley. ECG data compression using cut and
align beats approach and 2-D transforms.IEEE Trans-Biomed.
Eng. 1999, (46):556-565.
[2]Ali Bilgin & W. Marcellin. Compression of electrocardiogram
signals using JPEG2000.IEEE Transaction on Consumer Elec-
tronics. 2003, 49(4).
[3] Engelse, W.A.H. & Zeelenberg, C. (). A single scan algorithm
for QRS detection and feature extraction.IEEE Computers in
Cardiology 1979, pages 37-42.
[4] Wei, J. J., Chang, C. J., Chou, N. K. & Jan, G. J. ECG data com-
pression using truncated singular value decomposition.IEEE
Trans. on Information Technology in Biomedicine2001, 5:290-
[5] T. M. Lehman, C. Gonner, & K. Spitzer. Survey: interpolation
methods in medical image processing. IEEE Trans. on Medical
Imaging 1999, 18:1049-1075.
[6] James A. Storer,ed. Practical implementations of arithmetic
coding. Image and text compression, MA, 1992 pages 85-112.
[7] I. Witten, R. Neal & J. Cleary. Arithmetic coding for data com-
pression. Communications of the ACM 1987, 30(6).
[8] Lu, Z., D. Y. Kim, & W. A. Pearlman. Wavelet compression of
ECG signals by the set partitioning in hierarchical trees algo-
rithm. IEEE Trans. on Biomedical Engineering2000, 47:849-
[9] M. L. Hilton. Wavelet and wavelet packet compression of elec-
trocardiograms. IEEE Trans. on Biomedical Engineering1997,
[10] A. Djohan, T. Q. Nguyen & W. J. Tompkins. ECG compression
using discrete symmetric wavelet transform.Proc. of 17th
Int. IEEE Med. Biol. Conf. 1995.