14790
14790
14790
www.intechopen.com
144
2. ElectroCardioGraphy
ECG signal is a recording of the electrical activity of the heart over time produced by an
electrocardiograph and is a well-established diagnostic tool for cardiac diseases. ECG signal
is monitored by placing sensors at defined positions on chest and limb extremities of the
subject. Each heart beat is caused by a section of the heart generating an electrical signal
which then conducts through specialized pathway to all parts of the heart. These electrical
signals also get transmitted through the chest to the skin where they can be recorded. The
following four steps in the generation of ECG signal can be monitored:
1. The S-A node (natural pacemaker) creates an electrical signal.
2. The electrical signal follows natural electrical pathways through both atria. The
movement of electricity causes the atria to contract, which helps push blood into the
ventricles.
3. The electrical signal reaches the A-V node (electrical bridge). There, the signal pauses to
give the ventricles time to fill with blood.
4. The electrical signal spreads through the His-Purkinje system. The movement of
electricity causes the ventricles to contract and push blood out to lungs and body.
ECG signal is obtained from a machine known as an Electrocardiograph, which captures the
signal through an array of electrode sensors placed at standard locations on the skin of the
human body. Modern electrocardiographs record ECG signals by digitizing and then
storing the signal in magnetic or optical discs. An automated diagnostic system is required
to speed up the diagnostic process and assist the cardiologists in examining patients using
non-invasive techniques. Electrical impulses in the heart originate in the sinoatrial node and
travel through the heart muscle where they impart electrical initiation of systole or
contraction of the heart. The electrical waves can be measured at selectively placed
electrodes (electrical contacts) on the skin. Electrodes on different sides of the heart measure
the activity of different parts of the heart muscle. An ECG displays the voltage between
pairs of these electrodes, and the muscle activity that they measure, from different
directions, also understood as vectors. The ECG signal is composed from five waves labeled
using five capital letters from the alphabet: P, Q, R, S, and T. The width of a wave on the
horizontal axis represents a measure of time. The height and depth of a wave represent a
measure of voltage. An upward deflection of a wave is called positive deflection and a
downward deflection is called negative deflection. A typical representation of the ECG
waves is presented in Figure (1) (Moody, (1992).
The electrocardiogram essentially reads the electrical impulses that stimulate the heart to
contract. It is probably the most useful tool to determine whether the heart has been injured
or how it is functioning. The ECG signal is made up of a number of segments or waves of
different durations, amplitudes, and forms: slow, low-frequency P and T waves and short
and high-frequency Q, R, and S waves, forming the QRS complex. P wave, QRS wave, and T
wave, they are diagnostic critical waves. The P wave represents the atrial depolarization
where the blood is squeezed from the atria to the ventricles. The QRS segment is when the
ventricles depolarize and squeeze the blood from the right ventricle to the aorta. The T wave
represents the period of time when the ventricles repolarize (get ready for the next heart
beat). Most of the ECG signal energy is concentrated in the QRS complex, but there are
diagnostically important changes in the low amplitude PQ and ST intervals, the P and T
waves.
www.intechopen.com
145
www.intechopen.com
146
1.
2.
3.
www.intechopen.com
147
W (s , ) =
where,
s , ( x ) =
www.intechopen.com
f ( x ) s , ( x ) dx
1
x -
(
)
s
s
(1)
(2)
148
s and are called scale and translation parameters, respectively. W (s , ) denotes the
wavelet transform coefficients and is the fundamental mother wavelet. If W (s , ) is
given, f ( x ) can be obtained using the inverse continuous wavelet transform (ICWT) that is
described by:
f (x) =
1
C
W (s, )
s , ( x )
s2
d ds
|(u)|2
|u| du
(3)
(4)
The discrete wavelet transform can be written on the same form as Equation (1), which
emphasizes the close relationship between CWT and DWT. The most obvious difference is
that the DWT uses scale and position values based on powers of two. The values of s and
are: s = 2 j , = k * 2 j and ( j , k ) Z 2 as shown in Equation (5).
j ,k (x) =
1
soj
x - k osoj
soj
(5)
The key issues in DWT and inverse DWT are signal decomposition and reconstruction,
respectively. The basic idea behind decomposition and reconstruction is low-pass and highpass filtering with the use of down sampling and up sampling respectively. The result of
wavelet decomposition is hierarchically organized decompositions. One can choose the level
of decomposition j based on a desired cutoff frequency. Figure (3-a) shows an
implementation of a three-level forward DWT based on a two-channel recursive filter
bank, where h0 (n) and h1 (n) are low-pass and high-pass analysis filters, respectively,
and the block &2 represents the down sampling operator by a factor of 2. The input signal
x(n) is recursively decomposed into a total of four subband signals: a coarse signal C 3 (n) ,
and three detail signals, D3 (n), D2 ( n) , and D1 (n) , of three resolutions. Figure (3-b) shows an
implementation of a three-level inverse DWT based on a two-channel recursive filter
bank, where h#0 (n) and h# 1 ( n ) are low-pass and high-pass synthesis filters, respectively, and
the block %2 represents the up sampling operator by a factor of 2. The four subband signals
C 3 (n), D3 (n), D2 ( n) and D1 (n) , are recursively combined to reconstruct the output
signal x# (n) . The four finite impulse response filters satisfy the following relationships:
h1 (n) = (-1)n h0 (n)
(6)
h#0 (n) = h0 (1 - n)
(7)
(8)
so that the output of the inverse DWT is identical to the input of the forward DWT.
www.intechopen.com
149
Fig. 3. A three-level two-channel iterative filter bank (a) forward DWT (b) inverse DWT
The compression ratio (CR) is defined as the ratio of the number of bits representing the
original signal to the number required for representing the compressed signal. So, it can be
calculated from:
www.intechopen.com
150
CR =
N bc
( N S + M )(bS + 1)
(9)
Where, bc is the number of bits representing each original ECG sample. One of the most
difficult problems in ECG compression applications and reconstruction is defining the error
criterion. Several techniques exist for evaluating the quality of compression algorithms. In
some literature, the root mean square error (RMS) is used as an error estimate. The RMS is
defined as
( x(n) x(n))2
&
RMS =
n=1
(10)
&
where x(n) is the original signal, x(n) is the reconstructed signal and N is the length of the
window over which the RMS is calculated(Zou & Tewfik, 1993). This is a purely
mathematical error estimate without any diagnostic considerations.
The distortion resulting from the ECG processing is frequently measured by the percent
root-mean-square difference (PRD) (Ahmed et al., 2000). However, in previous trials focus
has been on how much compression a specific algorithm can achieve without loosing too
much diagnostic information. In most ECG compression algorithms, the PRD measure is
employed. Other error measures such as the PRD with various normalized root mean
square error and signal to noise ratio (SNR) are used as well (Javaid et al., 2008). However,
the clinical acceptability of the reconstructed signal is desired to be as low as possible. To
enable comparison between signals with different amplitudes, a modification of the RMS
error estimate has been devised. The PRD is defined as:
( x(n) x(n))2
&
PRD =
n=1
x
N
n=1
(11)
( n)
This error estimate is the one most commonly used in all scientific literature concerned with
ECG compression techniques. The main drawbacks are the inability to cope with baseline
fluctuations and the inability to discriminate between the diagnostic portions of an ECG
curve. However, its simplicity and relative accuracy make it a popular error estimate among
researchers (Benzid et al., 2003; Blanco-Velasco et al., 2004).
As the PRD is heavily dependent on the mean value, it is more appropriate to use the
modified criteria:
( x(n) x(n))2
N
PRD1 =
n=1
N
&
( x(n) x )2
(12)
n=1
where x is the mean value of the signal. Furthermore, it is established in (Zigel et al., 2000),
that if the PRD1 value is between 0 and 9%, the quality of the reconstructed signal is either
www.intechopen.com
151
very good or good, whereas if the value is greater than 9% its quality group cannot be
determined. As we are strictly interested in very good and good reconstructions, it is taken
that the PRD value, as measured with (11), must be less than 9%.
In (Zigel et al., 2000), a new error measure for ECG compression techniques, called the
weighted diagnostic distortion measure (WDD), was presented. It can be described as a
combination of mathematical and diagnostic subjective measures. The estimate is based on
comparing the PQRST complex features of the original and reconstructed ECG signals. The
WDD measures the relative preservation of the diagnostic information in the reconstructed
signal. The features investigated include the location, duration, amplitudes and shapes of
the waves and complexes that exist in every heartbeat. Although, the WDD is believed to be
a diagnostically accurate error estimate, it has been designed for surface ECG recordings.
More recently (Al-Fahoum, 2006), quality assessment of ECG compression techniques using
a wavelet-based diagnostic measure has been developed. This approach is based on
decomposing the segment of interest into frequency bands where a weighted score is given
to the band depending on its dynamic range and its diagnostic significance.
www.intechopen.com
152
g [ n] =
( 1)n h [L
n] , n = 0 , 1, . . . , L 1
(13)
where L is the filter length. To adapt the mother wavelet to the signals for the purpose of
compression, it is necessary to define a family of wavelets that depend on a set of
parameters and a quality criterion for wavelet selection (i.e. wavelet parameter
optimization). These concepts have been adopted to derive a new approach for ECG signal
compression based on dyadic discrete orthogonal wavelet bases, with selection of the
mother wavelet leading to minimum reconstruction error. An orthogonal wavelet transform
decomposes a signal into dilated and translated versions of the wavelet function (t ) . The
wavelet function (t ) is based on a scaling function (t ) and both can be represented by
dilated and translated versions of this scaling function.
(t ) = h(n) (2t n)
L 1
n=0
www.intechopen.com
and
(t ) = g(n) (2t n)
L 1
n=0
(14)
153
With these coefficients h(n) and g(n), the transfer functions of the filter bank that are used to
implement the discrete orthogonal wavelet transform, can be formulated.
H ( z ) = h(n) z n and G( z ) =
g( n ) z n
L 1
L 1
b =0
b =0
(15)
For a finite impulse response (FIR) filter of length L, there are L / 2 + 1 sufficient conditions
to ensure the existence and orthogonality of the scaling function and wavelets (Donoho &
Johnstone, 1998). Thus L / 2 1 degrees of freedom (free parameters) remain to design the
filter h.
www.intechopen.com
154
cos i
R( i ) =
sin i
sin i
cos i
16)
Ge ( z2 ) Go ( z2 )
i = o sin i
sin i 1
cos i 0
z1
(17)
H ( z) = H e ( z 2 ) + z1 H o ( z 2 )
(18a)
G( z) = Ge ( z 2 ) + z1 Go ( z 2 )
(18b)
and
To obtain the expressions for the coefficients of H(z) in terms of the rotational angles, it is
necessary to multiply out the above matrix product. In order to parameterize all orthogonal
wavelet transforms leading to a simple implementation, the following facts should be
considered.
1. Orthogonality is structurally imposed by using lattice filters consisting of orthogonal
rotations.
2. The sufficient condition for constructing a wavelet transform, namely one vanishing
moment of the wavelet, is guaranteed, by assuring the sum of all rotation angles of the
filters to be exactly -45o .
A suitable architecture for the implementation of the orthogonal wavelet transforms are
lattice filters. However, the wavelet function should be of zero mean, which is equivalent to
the wavelet having at least one vanishing moment and the transfer functions H(z) and G(z)
have at least one zero at z =-1 and z=1 respectively. These conditions are fulfilled if the sum
of all rotation angles is 45o (Xie & Morris, 1994), i.e.,
i = 45o
L /2
i =1
(19)
Therefore, a lattice filter whose sum of all rotation angles is 45o performs an orthogonal WT
independent of the angles of each rotation. For a lattice filter of length L, L/2 orthogonal
www.intechopen.com
155
i = ( 1) ( i 1 + i ) for i = 2, 3, . . ., L / 2 1 ,
L /2 = ( 1)L /2 L /2 1
1 = 45o 1 ,
i
(20)
At the end of the decomposition process, a set of vectors representing the wavelet
coefficients is obtained
C = d1 , d2 , d3 , . . . , d j , . . . , dm , am
(21)
where, m is the number of decomposition levels of the DWT. This set of approximation and
detail vectors represents the DWT coefficients of the original signal. Vectors d j contain the
detail coefficients of the signal in each scale j. As j varies from 1 to m, a finer or coarser detail
coefficients vector is obtained. On the other hand, the vector am contains the approximation
wavelet coefficients of the signal at scale m. It should be noted that this recursive procedure
can be iterated ( m log 2 N ) times at most. Depending on the choice of m, a different set of
coefficients can be obtained. The inverse transform can be performed using a similar
recursive approach. Thus, the process of decomposing the signal x can be reversed, that is
given the approximation and detail information it is possible to reconstruct x. This process
can be realized as up-sampling (by a factor of 2) followed by filtering the resulting signals
and adding the result of the filters. The impulse responses h and g can be derived from h
and g. However, toL generate an orthogonal wavelet, h must satisfy some constraints. The
basic condition is h(n) = 2 , to ensure the existence of . Moreover, for orthogonality, h
n = 1 and must satisfy the quadratic condition
must be of norm one
h(n) h(n 2 k ) = 0,
L
n=1
n=1
for k = 1,. . ., L / 2 1
(22)
)(
i=0 ,1
h(i ) = 1 + ( 1)i cos1 + sin 1 1 ( 1)i cos2 sin 2 + ( 1)i 2 sin 2 cos1 / 4 2
i=2 ,3
i=4,5
h( i ) = 1 / 2 h(i 4) h(i 2)
www.intechopen.com
(23)
156
For other values of L, expressions of h are given in (Maitrot et al., 2005). With this wavelet
parameterization there are infinite available wavelets which depend on the design
parameter vector to represent the ECG signal at hand. Different values of may lead to
different quality in the reconstructed signal. In order to choose the optimal values, and
thus the optimal wavelet, a blind criterion of performance is needed. Figure (6) illustrates
the block diagram of the proposed compression algorithm. In order to establish an efficient
solution scheme, the following precise problem formulation is developed. For this purpose,
consider the one-dimensional vector x(i), i=1, 2, 3, ., N represents the frame of the ECG
signal to be compressed; where N is the number of its samples. The initial threshold values
are computed separately for each subband by finding the mean () and standard deviation
() of the magnitude of the non-zero wavelet coefficients in the corresponding subband. If
the is greater than then the threshold value in that subband is set to (2*), otherwise, it is
set to (-). Also, define the targeted performance measures PRDtarget and CRtarget and start
with an initial wavelet design parameter vector = [10 , 20 ,. .., L 10 ] to construct the
wavelet filters H(z) and G(z). Figure (7) illustrates the compression algorithm for satisfying
predefined PRD (PRD1) with minimum bit rate representation of the signal. The same
algorithm with little modifications is used for satisfying predefined bit rate with minimum
signal distortion measured by PRD ( PRD 1 ); case 2. In this case, the shaded two blocks are
replaced by: CR calculation and predefined CR is reached?, respectively.
www.intechopen.com
157
process and when the target is met, the encoding simply stops. Similarly, given a bit stream,
the decoder can cease decoding at any point and can produce reconstruction corresponding to
all lower-rate encodings. EZW, introduced in (Shapiro, 1993) is a very effective and
computationally simple embedded coding algorithm based on discrete wavelet transform, for
image compression. SPIHT algorithm introduced for image compression in (Said & Pearlman,
1996) is a refinement to EZW and uses its principles of operation.
Fig. 7. Compression Algorithm for Satisfying Predefined PRD with Minimum Bit Rate.
www.intechopen.com
158
These principles are partial ordering of transform coefficients by magnitude with a set
partitioning sorting algorithm, ordered bit plane transmission and exploitation of selfsimilarity across different scales of an image wavelet transform. The partial ordering is done
by comparing the transform coefficients magnitudes with a set of octavely decreasing
thresholds. In this algorithm, a transmission priority is assigned to each coefficient to be
transmitted. Using these rules, the encoder always transmits the most significant bit to the
decoder. In (Lu et al., 2000), SPIHT algorithm is modified for 1-D signals and used for ECG
compression. For faster computations SPIHT algorithm can be described as follows:
1. ECG signal is divided to contiguous non-overlapping frames each of N samples and
each frame is encoded separately.
2. DWT is applied to the ECG frames up to L decomposition levels.
3. Each wavelet coefficient is represented by a fixed-point binary format, so it can be
treated as an integer.
4. SPIHT algorithm is applied to these integers (produced from wavelet coefficients) for
encoding them.
5. The termination of encoding algorithm is specified by a threshold value determined in
advance; changing this threshold, gives different compression ratios.
6. The output of the algorithm is a bit stream (0 and 1). This bit stream is used for
reconstructing signal after compression. From it and by going through inverse of SPIHT
algorithm, we compute a vector of N wavelet coefficients and using inverse wavelet
transform, we make the reconstructed N sample frame of ECG signal.
In (Pooyan et al., 2005), the above algorithm is tested with N=1024 samples, L=6 levels and
the DWT used is biorthogonal 9/7 (with symmetric filters h(n) with length 9 and g(n) with
length 7). The filters' coefficients are given in Table (1).
n
h(n)
g(n)
0
0,852699
0.788485
1
0,377403
0.418092
2
-0.11062
-0.04069
3
-0.023849
-0.064539
4
0.037829
www.intechopen.com
159
redundancy between adjacent heartbeats has been presented. The QRS complex in each
heartbeat is detected for slicing and aligning a 1-D ECG signal to a 2-D data array, and then
2-D wavelet transform is applied to the constructed 2-D data array. Consequently, a
modified SPIHT algorithm is applied to the resulting wavelet coefficients for further
compression. The way that the 2-D ECG algorithm presented in (Tai et al., 2005) differs from
other 2-D algorithms, (Reza et al., 2001; Ali et al., 2003), is that it not only utilizes the
interbeat correlation but also employs the correlation among coefficients in relative
subbands. More recently (Wang & Meng, 2008), a new 2-D wavelet-based ECG data
compression algorithm has been presented. In this algorithm a 1-D ECG data is first
segmented and aligned to a 2-D data array, thus the two kinds of correlation of heartbeat
signals can be fully utilized. And then 2-D wavelet transform is applied to the constructed 2D ECG data array. The resulting wavelet coefficients are quantized using a modified vector
quantization (VQ). This modified VQ algorithm constructs a new tree vector which well
utilizing the characteristics of the wavelet coefficients. Experimental results show that this
method is suitable for various morphologies of ECG data, and that it achieves higher
compression ratio with the characteristic features well preserved.
6.4 Hybrid ECG signal compression methods
Hybrids ECG signal compression methods are constructed from more than time and/or
frequency domain techniques (Ahmed et al., 2007). These include Modified Discrete Cosine
Transform (MDCT) and DWT; linear prediction coding and DWT. By studying the ECG
waveforms, it can be concluded that the ECG signals generally show two types of
correlation, namely correlation between adjacent samples within each ECG cycles (intrabeat
correlation) and correlation between adjacent heartbeats (interbeat correlation) (Xingyuan &
Juan, 2009). However, most existing ECG compression techniques did not utilize such
correlation between adjacent heartbeats. Hybrid compression methods of ECG signals are
discussed in this section, which fully utilizes the interbeat correlation and thus can further
improve the compression efficiency.
6.4.1 ECG signal compression based on combined MDCT and DWT
In (Ahmed et al., 2008), a hybrid two-stage electrocardiogram (ECG) signals compression
method based on the MDCT and DWT has been proposed. The ECG signal is partitioned
into blocks and the MDCT is applied to each block to decorrelate the spectral information.
Then, the DWT is applied to the resulting MDCT coefficients. The resulting wavelet
coefficients are then threshold and compressed using energy packing and binary-significant
map coding technique for storage space saving. MDCT is a linear orthogonal lapped
transform, based on the idea of time domain aliasing cancellation (TDAC). It is designed to
be performed on consecutive blocks of a larger dataset, where subsequent blocks are
overlapped so that the last half of one block coincides with the first half of the next block.
This overlapping, in addition to the energy-compaction qualities of the DCT, makes the
MDCT especially attractive for signal compression applications. Thus, it helps to avoid
artifacts stemming from the block boundaries (Britanak & Rao, 2002; Nikolajevic & Fettweis,
2003). MDCT is critically sampled, which means that though it is 50% overlapped, a
sequence data after MDCT has the same number of coefficients as samples before the
transform (after overlap-and-add). This means that, a single block of IMDCT data does not
correspond to the original block on which the MDCT was performed. When subsequent
www.intechopen.com
160
blocks of inverse transformed data are added, the errors introduced by the transform cancel
out TDAC. The MDCT is defined as (Nikolajevic & Fettweis, 2003):
XC ( k ) =
N 1
n =0
k = 0, 1, . . . M 1
(24)
where, x(n), n=0, 1, 2, , N-1 is the sequence to be transformed, N=2M is the window length
and M is the number of transform coefficients. The computation burden can be reduced if
the transform coefficients given by equation (24) are rewritten in the following recursive
form
Where,
and
k = k + 1
2M
(25)
(26)
(27)
The MDCT computation algorithm of a data sequence x(n) can be summarized in the
following:
1. Partition the data sequence in Nb consecutive blocks, each one with N=64 samples.
2. Recursively generate the Vm from the input sequence x(n) according to (26) and (27).
3. Calculate the MDCT coefficients for each block by evaluating the k-th MDCT coefficient
using (25) at the N-th step.
In the decompression stage, the inverse MDCT, that is termed IMDCT, is adopted. Because
there are different numbers of inputs and outputs, at first glance it might seem that the
MDCT should not be invertible. However, perfect invertability is achieved by adding the
overlapped IMDCTs of subsequent overlapping blocks, causing the errors to cancel and the
original data to be retrieved. The IMDCT transforms the M real coefficients, XC (0), XC (1),
, XC (M-1), into N=2M real numbers, x(0), x(1), .. , x(N-1), according to the formula:
x(n) =
XC (k)cos n + M2+1 k + 21 M ,
M 1
k =0
n = 0, 1, . . . N 1
(28)
Again, the computation burden of x(n) can be reduced considerably if equation (28) is
rewritten in the following recursive form
3
x(n) = XC (0) cos n + V1 cos n V2 cos n
2
2
2
Where,
www.intechopen.com
and n = n +
M +1
2 M
(29)
(30)
161
6.4.2 ECG signal compression based on the linear prediction of DWT coefficients
In (Abo-Zahhad et al., 2000; Ahmed & Abo-Zahhad, 2001), a new hybrid algorithm for ECG
compression based on the compression of the linearly predicted residuals of the wavelet
coefficients is presented. The main goal of the algorithm is to reduce the bit rate while
keeping the reconstructed signal distortion at a clinically acceptable level. In this algorithm,
the input signal is divided into blocks and each block goes through a discrete wavelet
transform; then the resulting wavelet coefficients are linearly predicted. In this way, a set of
uncorrelated transform domain signals is obtained. These signals are compressed using
various coding methods, including modified run-length and Huffman coding techniques.
The error corresponding to the difference between the wavelet coefficients and the predicted
coefficients is minimized in order to get the best predictor.
www.intechopen.com
162
length algorithm is the need of two words for the representation of each group of repeated
samples: one for the repeated value and the other for the number of repetitions. In this
section a more efficient coding algorithm, a modified run-length algorithm, is presented for
dealing with this situation. The algorithm is based on representing each significant
coefficient by bS+1 bits. The insignificant coefficients (of value zero) are manipulated in a
different manner. First, the repeated groups of zeros are counted and the resulting count is
represented by bS+1 bits. Then the train of coefficients representing the ECG signal is
transformed to another train of numbers. Some of these numbers represent the significant
coefficients and the rest are the numbers representing the repeated group of zeros (K1, K2,
., KM). Here, M denotes the number of these groups. The problem here is how to
differentiate between the coefficients and the numbers representing the group of zeros. For
example, the number 18 may be found twice in the new train of numbers, where the first 18
may be a significant coefficient and the second one may indicate 18 repeated zeros. To
overcome this problem, the first bit in the representation of each number is used as a control
bit. In case of the significant coefficient this bit is set to one and in case of repeated zeros it is
reset to zero.
bS bits
bS bits
www.intechopen.com
163
distortion of the reconstructed signal. This has been performed by thresholding the wavelet
coefficients of the approximation and details subbands with different threshold levels.
As it can be deduced from the above discussion, the approximation band is the smallest
band in size and it includes high amplitude approximation coefficients. The wavelet
coefficients other than these included in the approximation band, detail coefficients, have
small magnitudes. Most of the energy is captured by these coefficients of the lowest
resolution band. This can be seen from the decomposition of 4096-sample ECG signal up to
the fifth level. The total energy of the signal is 94393.5. About 99.73% of this energy is
concentrated in the 136 approximation coefficients and only 0.27% of the energy is
concentrated in the remaining 3960 detail coefficients. Here, threshold levels are defined
according to the energy packing efficiencies of the signal for all subbands. EPE for a set of
coefficients in the ith subband is defined as the ratio of the energy captured by the subband
coefficients and the energy captured by the whole number of coefficients.
( c( n ) )
L
EPE = nL= 1
i
( c( n ) )
n=1
x 100
(31)
Where Li and L are the number of coefficients in the ith subband and the whole number of
coefficients respectively. A large threshold could attain high data reduction but poor signal
fidelity and a small threshold would produce low data reduction but high signal fidelity. To
explore the effect of threshold level () selection and the coefficients representation on the
compression ratio and PRD, the following thresholding rule is set:
Keep all the wavelet coefficients in the approximation subband without thresholding and calculate the
threshold value for each details subband separately by preserving the higher amplitude wavelet
coefficients in the ith details subband that contribute to i % of the energy in that subband.
One important feature of this rule is that the integer part of the wavelet coefficients in each
subband is represented by different number of bits.
8.2 Binary significant map coding algorithm
The coding algorithm adopted here is based on grouping the significant coefficients in one
vector and the locations of the insignificant coefficients in another vector. The significant
coefficients are arranged from high scale coefficients to low scale coefficients. Each
significant coefficient is decomposed into integer part and fractional part, where M-bits are
assigned to represent the integer part (signed representation) and N-bits represent the
fractional part; i.e. each coefficient is represented by N+M bits. A binary significant map is
used as flags to indicate if the coefficient is significant or not. This binary stream is
compressed further as will be shown in the following:
1. Threshold the wavelet coefficients, c(n) , to produce the threshold coefficients c (n) .
The threshold level () is determined by using the above-mentioned rule such that the
distortion in the reconstructed signal xi is acceptable. The distortion is measured using
PRD and/or visual inspection. The optimal non-orthogonal wavelet transform
developed in (Ahmed et al., 2000) may be used to minimize the PRD in least mean
square sense. Here, the threshold is determined such that the PRD is less or equal to a
prescribed acceptable value defined by a cardiologist.
www.intechopen.com
164
2.
3.
4.
5.
6.
Search the vector c (n) to isolate the significant coefficient in another vector C S ( m) .
Use finite word length representation to represent the integer and fractional parts of the
coefficients, C S ( m) . The number of bits used to represent these coefficients is
determined as follows:
3.1 Search the vector C S ( m) to find the maximum coefficient (in absolute value) and
determine the number of bits that represents this coefficient. This can be done by
finding k = Int max|C (m)| where Int . denotes the integer part. Then convert
S
k to a binary number and count the number of bits, M.
3.2 Similarly, find the number of bits, N, that represent the minimum value of the
fractional part of each significant coefficient in such a way to keep the distortion
within acceptable limits.
Generate a binary stream, b(n), of 1s and 0s that encodes the zero-locations in c (n) .
This is done by coding each significant coefficient in c (n) by a binary 1. The length of
the binary stream equals n1, where n1 designates the index value of the last significant
coefficients in c (n) . Hence, there is no need to encode the zeros for n > n1. The value of
n1 need not be stored because it can be determined as the length of the vector b(n) in the
decoding process.
Compress the binary stream using run length encoding of 0s and 1s as follows:
5.1 Set i = 1, Run-type= b(i), and set the run length Z to 1;
If b(i) b(i+1) increment i by Z. Else, while b(i+1) = b(i), increment i by 1 and Z
by 1 end; end.
5.2 From Table (2), find the inequality that Z satisfies. Then output the symbol that
specifies the run type followed by the number Z. i.e., code = [code Z] , where
designates concatenation operator.
5.3 If index < n1 set Z=1 and go to step (5.1).
Represent the obtained run length code in binary format. There are 16 different symbols
that can be generated from step 5. These are the digits 0-9 and the letters A-F. Hence, 4
bits can be used to represent each symbol.
Symbol
A
B
C
Run Type
0
0
0
100 Z 999
10 Z 99
Range
2Z 9
Symbol
D
E
F
Run Type
1
1
1
Range
100 Z 999
10 Z 99
2Z 9
9. Conclusion
In literature, numerous ECG compression methods have been developed. They may be
defined either as reversible methods (offering low compression ratios but guaranteeing an
exact or near-lossless signal reconstruction), irreversible methods (designed for higher
compression ratios at the cost of a quality loss that must be controlled and characterized), or
scalable methods (fully adapted to data transmission purposes and enabling lossy
reconstruction). Choosing one method mainly depends on the use of the ECG signal. In the
case of the needs of a first diagnosis, a reversible compression would be most suitable.
www.intechopen.com
165
10. References
Jalaleddine S. M. S., Hutchens C. G., Strattan R. D., & Coberly W. A. (1990). ECG data
compression techniques-A unified approach, IEEE Trans Biomed. Eng., vol. 37,
329343.
Addison P. S. (2005). Wavelet transforms and the ECG: a review. Institute Of Physics
Publishing Physiological Measurement, vol. 26, R155R199.
Padma T., Latha M. M., and Ahmed A. (2009). ECG compression and labview
implementation, J. Biomedical Science and Engineering, vol. 3, 177-183.
Moody G. (1992). MIT-BIH Arrhythmia Database, Overview. Massachusetts Institute of
Technology, Cambridge, 1992.
Dipersio D. A. and Barr R. C. (1985). Evaluation of the fan method of adaptive sampling on
human electrocardiograms, Med. Biol. Eng. Comput., 401410.
Abenstein J. and Tompkins W., (1982). New data-reduction algorithm for real-time ECG
analysis. IEEE Trans. Biomed. Eng., vol. BME-29, 4348, Jan. 1982.
Cox J., Noelle F., Fozzard H., and Oliver G. (1968). AZTEC: A preprocessing program for
real-time ECG rhythm analysis. IEEE Trans. Biomed. Eng., BME-15, 128129, Apr.
1968.
Mueller W., (1978). Arrhythmia detection program for an ambulatory ECG monitor.
Biomed. Sci. Instrument, vol. 14, 8185, 1978.
Moody G. B., Mark R. G., and Goldberger A. L., (1989). Evaluation of the TRIM ECG data
compressor. Proc. Of Comput. Cardiol., 1989, 167170.
Haugland D., Heber J., and Husy J., (1997). Optimization algorithms for ECG data
compression. Med. Biol. Eng. Comput, vol. 35, 420424, July 1997.
Olmos S., Milln M., Garca J., and Laguna P., (1996). ECG data compression with the
Karhunen-Love transform. Proc. Comput. Cardiol. , Indianapolis, 253256, Sept.
1996.
Reddy B. R. S., and Murthy I. S. N., (1986). ECG data compression using Fourier
descriptions. IEEE Trans. Biomed. Eng., vol. 33, 428434, Apr. 1986.
Ahmed N., Milne P. J., and Harris S. G., (1975). Electrocardiographic data compression via
orthogonal transforms. IEEE Trans. Biomed. Eng., vol. BME-22, 484487, Nov. 1975.
Husy J. H. and Gjerde T., (1996). Computationally efficient subband coding of ECG
signals, Med. Eng. Phys., vol. 18, 132142, Mar. 1996.
Mammen C. P. and Ramamurthi B., (1990). Vector quantization for compression of
multichannel ECG. IEEE Trans. Biomed. Eng., vol. 37, 821825, Sept. 1990.
Chen J., Itoh S., and Hashimoto T., (1993). ECG data compression by using wavelet
transform. IEICE Trans. Inform. Syst., vol. E76-D, 14541461, Dec. 1993.
Miaou S. G., Yen H. L. and Lin C.L., (2002). Wavelet-based ECG compression using dynamic
vector quantization with tree codevectors in single codebook. IEEE Trans. Biomed.
Eng., vol. 49, 671680, 2002.
www.intechopen.com
166
Nygaard R., Melnikov G., and Katsaggelos A. K., (1999). Rate distortion optimal ECG signal
compression. in Proc. Int. Conf. Image Processing, 348351, Oct. 1999, Kobe, Japan.
Zigel Y., Cohen A., and Katz A., (2000). The Weighted Diagnostic Distortion (WDD)
Measure for ECG Signal Compression. IEEE Trans. Biomed. Eng., 47, 1422-1430,
2000.
Zou H. and Tewfik A. H., (1993). Parameterization of compactly supported orthonormal
wavelets. IEEE Trans. on Signal Processing, vol. 41, no. 3, 1428-1431, March 1993.
Ahmed S. M., Al-Shrouf A. and Abo-Zahhad M., (2000). ECG data compression using
optimal non-orthogonal wavelet transform. Med. Eng. Phys. 22, 3946, 2000.
Javaid R., Besar R., Abas F. S., (2008). Performance Evaluation of Percent Root Mean Square
Difference for ECG Signals Compression. Signal Processing: An International
Journal (SPIJ): 19, April 2008.
Benzid R., Marir F., Boussaad A., Benyoucef M., and Arar D., (2003). Fixed percentage of
wavelet coefficients to be zeroed for ECG compression. Electronics Letters, vol. 39,
830831, 2003.
Blanco-Velasco M., Cruz-Roldan F., Godino-Llorente J. I., and Barner K. E., (2004). ECG
compression with retrieved quality guaranteed. Electronics Letters, vol. 40, no. 23,
900901, 2004.
Al-Fahoum A. S., (2006). Quality assessment of ECG compression techniques using a
wavelet-based diagnostic measure. IEEE Trans. in Biomedicine, vol. 10, 182-191,
2006.
Thakor N. V., Sun Y. C., Rix H. and Caminal P., (1993). Multiwave: a wavelet-based ECG
data compression algorithm. IEICE Trans. Inf. Syst. E76D 14629, 1993.
Chen J. and Itoh S., (1998). A wavelet transform-base ECG compression method
guaranteeing desired signal quality. IEEE Trans. Biomed. Eng. 45, 14141419, 1998.
Miaou S. G. and Lin H. L., (2000). Quality driven gold washing adaptive vector quantization
and its application to ECG data compression. IEEE Trans. Biomed. Eng., 47 209
218, 2000.
Miaou S. G. and Lin C. L. (2002). A quality-on-demand algorithm for wavelet-based
compression of electrocardiogram signals. IEEE Trans. Biomed. Eng. 49, 233239,
2002.
Bradie B., (1996). Wavelet packet-based compression of single lead ECG. IEEE Trans.
Biomed. Eng. 43, 493501, 1996.
Ramakrishnan A. G. and Saha S., (1997). ECG coding by wavelet-based linear prediction.
IEEE Trans. Biomed. Eng., vol. 44, 12531261, 1997.
Lu Z., Kim D. Y. and Pearlman W. A., (2000). Wavelet compression of ECG signals by the set
partitioning in hierarchical trees algorithm. IEEE Trans. Biomed. Eng., 47, 849855,
2000.
Daubechies I., (1998). Orthonormal bases of compactly supported wavelets. Communication
on Pure and Applied Mathematics, vol. 41, no. 7, 909-996, Nov. 1998.
Donoho D. L., and Johnstone I. M., (1998). Minimax estimation via wavelet shrinkage. Ann.
Statist., vol. 26, 879921, 1998.
Vaidyanathan P. P., (1993). Multirate digital filters, filter banks, polyphase networks and
applications: A tutorial review. Proceedings of the IEEE, vol. 41, 3463-3479, Dec.
1993.
www.intechopen.com
167
Xie H. and Morris J. M., (1994). Design of orthonormal wavelets with better time-frequency
resolution. Proc. Of SPIE, Wavelet Applications, 878-997, Orlando, Florida, 1994.
Maitrot A., Lucas M. F., Doncarli C., and Farina D., (2005). Signal-dependent wavelet for
electromyogram classification. Med. Biol. Eng. Computers., vol. 43, 48792, 2005.
Shapiro J. M., (1993). Embedded Image Coding Using Zero trees of Wavelet Coefficients.
IEEE Trans. Signal Processing, vol. 41, no. 12, 3445-3462, Dec. 1993.
Said A., and Pearlman W. A., (1996). A New, Fast and Efficient Image Codec Based on Set
Partitioning in Hierarchical Trees. IEEE Trans. Circuits & Systems, vol. 6, 243-250,
1996.
Lu Z., Kim D. Y., Pearlman W. A., (2000). Wavelet Compression of ECG Signals by the Set
Partitioning in Hierarchical Trees Algorithm. IEEE Trans. Biomed. Eng., vol. 47, no.
7, 849-856, July 2000.
Pooyan M., Taheri A., Moazami-Goudarzi M., and Saboori I., (2005). Wavelet Compression
of ECG Signals Using SPIHT Algorithm. World Academy of Science, Engineering
and Technology, vol. 2, 212-215, 2005.
Reza A., Moghaddam A., and Nayebi K., (2001). A two dimensional wavelet packet
approach for ECG compression. Proc. Int. Symp. Signal Processing Applications,
226229, Aug. 2001.
Ali B., Marcellin M.W., and Altbach M. I., (2003). Compression of electrocardiogram signals
using JPEG2000. IEEE Trans. Consumer Electronics, vol. 49, no. 4, Nov. 2003.
Tai S. C., Sun C. C., and Yan W. C., (2005). A 2-D ECG compression method based on
wavelet transform and modified SPIHT. IEEE Trans. Biomed. Eng., 52, 9991008,
2005.
Wang X., and Meng J., (2008). A 2-D ECG compression algorithm based on wavelet
transform and vector quantization. Digital Signal Processing vol. 18, 179188, 2008.
Ahmed S. M., Al-Zoubi Q., and Abo-Zahhad M., (2007). A hybrid ECG compression
algorithm based on singular value decomposition and discrete wavelet transform.
J. Med. Eng. Technology, vol. 31, 54-61, 2007.
Xingyuan W. and Juan M., (2009). Wavelet-based hybrid ECG compression technique",
Analog Integrated Circuits Signal Processing, vol. 59, 301308, 2009.
Ahmed S. M., Al-Ajlouni A. F., Abo-Zahhad M., and Harb B., (2008). ECG signal
compression using combined modified discrete-cosine and discrete-wavelet
transforms. 2008.
Britanak V. and Rao K. R., (2002). A new fast algorithm for the unified forward and inverse
MDCT/MDST computation. Signal Processing 82, 433-459, 2002.
Nikolajevic V. and Fettweis G., (2003). A new Recursive Algorithm for the Unified Forward
and Inverse MIDCT/MIDST. Journal of VLSI Signal Processing, vol. 9, 203-208,
2003.
Abo-Zahhad M., Ahmed S. M., and Al-Shrouf A., (2000). Electrocardiogram data
compression algorithm based on the linear prediction of the wavelet coefficients.
Proc. of 7th IEEE Int. Conf., Electronics, Circuits and Systems, Lebanon, 599603,
Dec. 2000.
Ahmed S. M., and Abo-Zahhad M., (2001). A new hybrid algorithm for ECG signal
compression based on the wavelet transformation. Medical Engineering and
Physics, vol. 24, no. 3, 50-66, 2001.
www.intechopen.com
168
Abo-Zahhad M., and Rajoub B. A., (2001). ECG compression algorithm based on coding and
energy compaction of the wavelet coefficients. The 8th IEEE International Conf. On
Electronics, Circuits and Systems, Malta, 441-444, Sept. 2001.
Abo-Zahhad M., and Rajoub B. A., (2002). An effective coding technique for the compression
of one-dimensional signals using wavelets. Med. Eng. and Phy., vol. 24, 185-199,
2002.
www.intechopen.com
ISBN 978-953-307-185-5
Hard cover, 256 pages
Publisher InTech
How to reference
In order to correctly reference this scholarly work, feel free to copy and paste the following:
Mohammed Abo-Zahhad (2011). ECG Signal Compression Using Discrete Wavelet Transform, Discrete
Wavelet Transforms - Theory and Applications, Dr. Juuso T. Olkkonen (Ed.), ISBN: 978-953-307-185-5,
InTech, Available from: http://www.intechopen.com/books/discrete-wavelet-transforms-theory-andapplications/ecg-signal-compression-using-discrete-wavelet-transform
InTech Europe
InTech China