Sie sind auf Seite 1von 32

c 



 

The progress in desktop and portable computing in the past decade has provided the means
with the PC or customized microcomputer-based instrumentation to develop solutions to
biomedical problems that could not be approached before. One of our personal interests has
been the design portable instruments that are light, compact, and battery powered. A typical
instruments of this type is truly a personal since it is programmed to monitor signals from
transducers or electrodes mounted on the person who is carrying it around. 

     


 

One example of a portable device is the portable arrhythmia monitor which monitors a
patient¶s electrocardiogram from chest electrodes and analyzers it in real time to determine if
there are any heart rhythm abnormalities. We designed a prototype of such a device more
than a decade ago. Because of the technology available of the time, this device was primitive
compared with modern commercially portable arrhythmia monitors. The evolution of the
technology also permits us to think of even more extensions that we can make. Instead of just
assigning a heart monitoring device to follow a patient after discharge from the hospital, we
can now think of designing a device that would help diagnose the heart abnormality when the
patient arrives in the emergency room. With a careful design, the same device might go with
the patient to monitor the cardiac problem during surgery in the operating room, continuously
learning the unique characteristics of the patient¶s heart rhythms. The device could follow the
patient¶s throughout the hospital stay, alerting the hospital staff to possible problems in the
intensive care unit, in the regular hospital room, and even in the hallways as the patient walks
to the cafeteria. The device could them accompany the patient home, providing continuous
monitoring that is not now practical to do, during the critical times following open heart
surgery.

There are many other examples of portable biomedical instruments in the marketplace and in
the research lab. One other microcomputers-based device that we contributed to developing is
a calculator size product called the CALTRAC that uses a miniature accelerometer to monitor
the motion of the body. It then converts this activity measurement to the equivalent number
of calories and display the cumulative result on an LCD display.

c
 
The economy of mass production has led to
the use of the desktop PC as the central computer for many types of biomedical application.
Many companies use PCs for such application as sampling and analysing physiological
signals, maintaining equipment databases in the clinical engineering department of hospitals,
and simulation and modeling of physiological system. 

c 
    
The electrocardiogram (ECG) is a graphicalrepresentation of the electrical activity of the
heart and isobtained by connecting specially designed electrodes to thesurface of the body
[1]. It has been in use as a diagnostic toolfor over a century and is extremely helpful in
identifyingcardiac disorders non-invasively. The detection of cardiacdiseases using ECG has
benefited from the advent of thecomputer and algorithms for machine identification of
thesecardiac disorders.




 !   

A new dimension byintroducing the concept of vectors to represent the ECGvoltages. He is


also the first individual to standardize theelectrode locations for collecting ECG signals as
right arm(RA), left arm (LA) and left leg (LL), and these locations areknown after him as the
standard leads of Einthoven or limbleads, as shown in Figure 1. The limb leads consist of
sixunipolar chest leads, starting from lead V1 until V6 in anelectrocardiogram.


 ! "   !  
   
Most of the cardiac disease classification algorithms beginwith the separation or delineation
of the individual ECG signalcomponents. The ECG signal comprises of the QRS complex,P
and T waves as shown in Figure 3. Occasionally a U-wavemay also be present which lies
after the T-wave. The QRScomplex is the most distinguishable component in the
ECGbecause of its spiked nature and high amplitude as it indicatesdepolarization of the
ventricles of the heart which have greatermuscle mass and therefore process more electrical
activity.Detection of the QRS complex is one of vital importance in response to the
subsequent processing of the ECG signal suchas calculation of the RR interval, definition of
search windowsfor detection of the P and T waves and etc. In terms of diseaseclassification,
the QRS complex is of pathological importanceand its detection serves as an entry point for
almost allautomated ECG analysis algorithms.

#
 !c$


Due to its importance and extensive contribution inhealthcare, ECG amount in hospital has
increasedtremendously. Normally, ECG has to be printed on a thermalpaper for further
physical inspection by medical doctor.Therefore, a reasonable physical storage space in the
hospitalfor this storage of records is essentially required. Also, theconventional visual
analyses to inspect the ECG signals areabsolutely not effective and time consuming,
especially inhospitals that are highly patient load. Retrieving the ECGrecord from the
hospital archive is another equally timeconsuming and laborious. For that reason, efforts have
beenmade by numerous investigators worldwide to try to find anapproach for accurate and
fast ECG digital time series signalextraction. The benefit of converting these ECG records
into adigital time series are not only reduces the physical storagespaces, it also enable for
some automatic computerizedalgorithms for important information extraction in rapid
andprecise way.

 
The prototype of the system was made with a portable ECGmonitor.The results show
thatmodern smart phones might capable for this kind of tasks.Thus, with very good
networking and data processingcapabilities, they might be a potential part of the
futurewireless health care systems. When requested, the applicationalso displays the ECG
signal and heart rate on the phonescreen. The view the received ECG signals on the
phonescreen along with the measured heart rate are illustrated. In addition, an informative
Short Message Service(SMS) - message is delivered to the mobile phone of a selectedperson
if so chosen. The main tasks of the different parts of the system. However, due to the limits
ofelectronics support and processing unit within the mobilephone, the overall performance is
hardly operated in an idealcondition. The display screen of mobile phone is smaller than.

An ECG signal, according to the American Heart Association, must consist of 3 individual
leads, each recording 10 bits per sample, and 500 samples per second. Some ECG signals,
may require 12 leads, 11 bits per second, 1000 samples per second, and last 24 hours. When
converted to a digital format, this single ECG record requires a total of 1.36 gigabytes of
computer storage! Considering the 10 million ECGs annually recorded for the purposes of
comparison and analysis in the United States alone, the necessity for effective ECG data
compression techniques is becoming increasingly important. Further more, the growing need
for transmission of ECGs for remote analysis is hindered by capacity of the average analog
telephone line and mobile radio .

 

%& '!! 
(')

Data compression techniques are categorized as those in which the compressed data is
reconstructed to form the original signal and techniques in which higher compression ratios
can be achieved by introducing some error in the reconstructed signal. The effectiveness of
an ECG compression technique is described in terms of compression ratio (CR), a ratio of the
size of the compressed data to the original data; execution time, the computer processing time
required for compression and reconstruction of ECG data; and a measure of error loss, often
measured as the percent mean-square difference (PRD). The PRD is calculated as follows:

where ORG is the original signal and REC is the reconstructed signal. The lower the PRD,
the closer the reconstructed signal is to the original ECG data.

There are several exact-reconstruction techniques including null suppression, run-length


encoding, diatomic encoding, pattern substitution, differencing, facsimile techniques, and
statistical encoding. Null suppression is a data-compression technique that searches for
strings of empty, or null, data points and replaces them with an indicator and a number
representing the length of the null sequence. Run-length encoding is a modification of null
suppression, where the process used to compress null data points is applied to any repeating
data sequence. For instance a character sequence:

WGAQQQQQQRBCCCCCHZY

may be compressed as:WGAQ*6RBC*5HZY,


a savings of 5 characters. While null suppression and run-length compression usually do not
create very high compression ratios, in certain cases of very long strings or repeated
characters, these compression techniques are very simple to program and are quickly
reconstructed.

Diatomic encoding and pattern substitution are a second family of data compression
techniques. In many cases, a series of data points contains pairs of data that frequently
reoccur and can be replaced by a single symbol. In compressing text files, for instance, the
combination and  often appear and can be replaced by a special letter. Expanding on
this application of text files, pattern substitution becomes a variation of diatomic encoding.
As indicated in its name, pattern substitution locates repeated patterns and substitutes them
with a short code. Common words such as "and", "the", and "that" can be replaced by *#, *$,
and*&.

Differencing and facsimile techniques are better adapted to ECG compression. Differencing
assumes that an individual data sample will be almost the same as the previous sample. It
uses this idea to form the following algorithm: the first data sample is recorded exactly and
each sequential sample is replaced by the difference from the previous sample. In a sequence
{1100, 1101, 1103, 1099, 1096}, the five four digit numbers can be shortened to one four
digit number and four one digit numbers {1100, 1, 2, -4, -3}. Facsimile techniques subtract
entire lines of data from the previous one. This can be used in ECG compression, where each
10 or 11 bit sample of heart beat.is reduced to a few bits corresponding to the relative change
from the previous heart beat.

Many types of statistical encoding techniques exist. In statistical encoding, data samples are
replaced by specially chosen codes. The frequencies and probabilities of occurrence of single
samples are used to create codes in which short codes represent frequently occurring samples,
while longer codes represent rare occurrences. One of the first statistical encoding techniques
is the familiar Morse code, in which a single dot or dash replaces the most common English
letters  and . Huffman coding is one of the most used statistical compression methods since
it contains the shortest average code length. In Huffman coding, the most frequently
occurring data sample is replaced by a simple binary code. Each following data sample, in the
order of occurrence, is replaced by a different code, equal to or greater in length than the
previous code. Huffman coding assumes that the average code length will be shorter than the
average original data sample. In ECG data compression, Huffman coding is often used as a
final compression method, after compression techniques that introduce error have been
applied since Huffman coding results in no further error.

Analysis of ECG data does not require exact reconstruction; only certain features of the
ECG signal are actually important. Assuming the P, Q, R, S, and T waves are retained, the
subtleties of the ECG data may be sacrificed for higher compression ratios. Thus, many types
of compression technique that introduce some error have been applied to ECG data.
Polynomial predictors including zero-order and first-order predictors, polynomial
interpolators such as the zero-order and first-order interpolators, AZTEC, TP, CORTES, and
average beat subtraction techniques are commonly applied to ECG records. More complex
techniques such as the use of wavelet packets, neural networks, and adaptive Fourier
coefficients are currently being explored with the expectations that they will result in higher
compression ratios but longer processing time for compression and reconstruction.

 *+!  
  .

Polynomial predictors are a data compression technique in which a polynomial of order R is


fit through previously known data samples and then extrapolated to predict future ones. The
polynomial predictor is in the form:

y'n = yn-1 + Dyn-1 + D2 yn-1 + ... + Dk yn-1

where

y'n = predicted sample point at time tn

yn-1 = sample value at one sample period prior to tn

Dyn-1 = yn-1 - yn-2

Dk yn-1 = Dk-1 yn-1 - Dk-1 yn-2.

The polynomial predictor with R = 0 is known as the Zero-Order Predictor (ZOP). With the
ZOP, each data point is predicted to be the same as the previous one, resulting in the
equation:

y'n = yn-1

Most applications using the ZOP, use a form known as a floating aperture, or step method.
This algorithm records a single data sample and deletes each successive sample that lies
within a tolerance band U e, whose center lies on the saved sample, and replaces them with a
horizontal line. When a sample is outside the tolerance band, the new sample is saved and the
process continues.
 #  +.

The first-order predictor (FOP) is the use of a polynomial predictor with R = 1. It requires the
knowledge of the two previous points, yielding the equation:

y'n = 2yn-1 + yn-2

Similar to the ZOP, its difference lies in the way the predicting line is drawn. Rather than a
horizontal line, the two previous points are used to formulate a starting point and a slope for
the prediction. A tolerance band is still applied, and when a data sample lies outside the
tolerance band, a new FOP. is formulated .

Polynomial interpolators differ from polynomial predictors in that previous and future data
samples are used to create the predicting polynomial. The zero-order interpolator (ZOI)
modifies the ZOP by allowing the horizontal line to have a height corresponding to the
average of a set of data rather than simply that of the first point. Although both the ZOI and
the ZOP ensure that all data samples lie within a tolerance band around the reconstructed
data, the ZOI results in higher compression since the saved data points are better chosen.

 , *+ 

The first-order interpolator (FOI) is similar to the FOP in that two points are used to
formulate a line and a slope, but it uses the idea of the ZOI in choosing the two data samples
that will optimize the compression ratio of the data. The FOP with two degrees of freedom
(FOI-2DF), also known as the two point projection method, is often found to be the most
successful of the FOI's. It works by recording two successive data samples and creating a line
connecting the points. If altering the line to pass through the third data point rather than the
second still retains the second data point within a tolerance bound around the line, a new line
is drawn through from the first point to the fourth rather than to the third. This continues to
the lth sample, when data points between the first and the lth lie outside the tolerance bound
around the line. When this occurs, the line connecting the first and ( l-1)th sample is assumed
to be the best approximation and is saved. However, in practice, the information that is
actually saved is simply a height and a distance to the next saved sample. When
decompressed, the line is drawn through the saved height and the next saved height, using
this new height as the starting point of the next line.

The AZTEC, TP, and CORTES ECG compression techniques are becoming popular
schemes in ECG data compression. The amplitude zone time epoch coding algorithm
(AZTEC) converts the original ECG data into horizontal lines (plateaus) and slopes. Plateaus
use a ZOI algorithm to compress the data, where an amplitude and a length are saved. Slopes
are formed when the length of a plateau is less than three. The information saved from a slope
is the length of the slope and its final amplitude. Although the AZTEC algorithm creates a
compression ratio of around 10:1, the step-like reconstruction of the ECG signal is
unacceptable for accurate analysis by the cardiologist, especially in the P and T portions of
the ECG cycle.

 -  + ' 

The turning point technique (TP) always produces a 2:1 compression ratio and retains the
important features of the ECG signal. It accomplishes this by replacing every three data
points with the two that best represent the slope of the original three points. The second of the
two saved points is used in the calculation of the next two points. The coordinate reduction
time encoding system (CORTES) combines the high compression ratios of the AZTEC
system and the high accuracy of the TP algorithm. The slopes of the AZTEC technique,
which occur mostly in the QRS complex, are replaced by TP compression, and long plateaus
that occur in an ECG signal are compressed using AZTEC compression. The result is
compression ratios only slightly lower than AZTEC, but much less error in the reconstructed
signal.

Finally, average beat subtraction has been applied with success to ECG data. In this
algorithm, it is assumed that the locations of the heart beats are known and the original ECG
signal has been segmented into vectors, each corresponding to a beat. Since beats vary in
length, the longest beat will be used to determine the length of each vector. The additional
vector elements in shorter beats are then filled by the use of various methods. Average beat
subtraction then uses the assumption that each beat will have a similar pattern and averages
the vectors to create a new beat that should be very similar to all the original vectors. Once
this vector is saved, it is subtracted from each of the other vectors. The remaining data,
known as the residuals, is then compressed using one of the previously mentioned techniques.

Thus, the purpose of this investigation is twofold. First, several existing and originally
designed ECG data compression techniques will be compared for compression ratios,
execution times, and data loss. Second, a computer program will be designed that will
incorporate these data compression techniques in user-friendly software that will enable the
operator to easily compress and reconstruct ECG data through a simple, graphic interface.

#" 
'

Several ECG compression techniques will be written in the PASCAL computer language and
tested on single-lead ECG records stored on the MIT-BIH Arrhythmia Database. The
database is a Massachusetts Institute of Technology created CD-ROM collection of ninety
two-hour ECG recordings with beats, rhythms, and signal quality annotations. The source of
the ECGs is a set of over 4000 long-term Holter recordings from the Beth Israel Hospital
Laboratory over a period from 1975 through 1979. The subjects who produced the ECG
signals are from a group of 25 men aged 32 to 89 years and 22 women aged 23 to 89 years.
The original analog recordings of the ECG signals are performed using nine Del Mar
Avionics model 445 two-channel recorders.

The digitization is done while playing back the analog data on a Del Mar Avionics model
660 unit. The digitization creates filtered signals at 360 Hz and an 11-bit resolution over a U5
mV range. Of importance to data compression is that this method of digitization results in
360 samples per second, with each sample corresponding to an integer ranging from 0 to
2047 inclusive. Besides the normal noise attributed to ECG recordings, such as muscle
contraction and electrical interference, the process of recording and digitizing creates
additional noise at frequencies of 0.042 Hz, 0.083 Hz, 0.090 Hz, and 0.167 Hz. Further more,
the take-up and supply reels of the analog recordings produce a 0.18 Hz 0.10 Hz and a 0.20
Hz 0.36 Hz noise, respectively.

Following collection of the raw ECG data, the computer program that will be written will
utilize existing compression techniques to filter noise and compress the data. Original
compression techniques will modify and combine existing techniques in hope that higher
compression ratios and less error will be achieved. In addition, a Macintosh computer
interface will be created so that a cardiologist will be able to graphically compare the original
ECG signal to a sample result of each of several compression techniques. This will allow the
operator to choose which algorithm best obtains the highest compression ratio while retaining
the needed ECG information. The interface will allow the user to complete this task without
experienced knowledge of the mathematical details of the compression technique.
"  

 .%!  c$c  


    
  

c$
( )
  
  
( )/  
  + ' 
  

Preliminary results include a development version of the ECGCompression program and


tests of the FOI-2DF, average beat subtraction, and first-order differencing. Use of these
techniques have resulted in compression ratios of 10:1 and excellent reconstruction in the
best cases. This is achieved by using a combination of the three algorithms. Use of the
AZTEC, TP, Cortes, and Fourier coefficients algorithms will hopefully increase the
compression ratios. A variation of one or more of these techniques will likely produce an
optimal algorithm, and the created program will be used to verify the results.

,0


Compression techniques have been around for many years. However, there is still a continual
need for the advancement of algorithms adapted for ECG data compression. The necessity of
better ECG data compression methods is even greater today than just a few years ago for
several reasons. The quantity of ECG records is increasing by the millions each year, and
previous records cannot be deleted since one of the most important uses of ECG data is in the
comparison of records obtained over a long range period of time. The ECG data compression
techniques are limited to the amount of time required for compression and reconstruction, the
noise embedded in the raw ECG signal, and the need for accurate reconstruction of the P, Q,
R, S, and T waves. The results of this research will likely provide an improvement on
existing compression techniques, and the original computer program will provide a simple
interface so that the cardiologist can use ECG data compression techniques without
knowledge of the specific details and mathematics behind the algorithms.
c #

#'  

&
A typical computerized medical signal processing system acquires a large amount of data that
is difficult to store and transmit. We need a way to reduce the data storage space while
preserving the significant clinical content for signal reconstruction. In some applications, the
process of reduction and reconstruction requires real-time performance.

A data reduction algorithm seeks to minimize the number of code bits stored by reducing the
redundancy present in the original signal. We obtain the reduction ratio by dividing the
number of bits of the original signal by the number saved in the compressed signal. We
generally desire a high reduction ratio but caution against using this parameter as the sole
basis of comparison among data reduction algorithms. Factors such as bandwidth, sampling
frequency, and precision of the original data generally have considerable effect on the
reduction ratio.
A data reduction algorithm must also represent the data with acceptable fidelity. In
biomedical data reduction, we usually determine the clinical acceptability of the
reconstructed signal through visual inspection. We may also measure the residual,that is, the
difference between the reconstructed signal and the original signal.Such a numerical measure
is the percentroot-mean-square difference, PRD, given by

where„ is the number of samples and and are samples of the originaland
reconstructed data sequences.
A  data reduction algorithm produces zero residual, and the reconstructedsignal
exactly replicates the original signal. However, clinically acceptable qualityis neither
guaranteed by a low nonzero residual nor ruled out by a high numerical residual.
For example, a data reduction algorithm for an ECGrecording may eliminate small-
amplitude baseline drift. In this case, the residualcontains negligible clinical information. The
reconstructed ECG signal can thus bequite clinically acceptable despite a high residual.
In this chapter we discuss two classes of data reduction techniques for the ECG.The first
class, significant-point-extraction, includes the turning point (TP)algorithm, AZTEC
(Amplitude Zone Time Epoch Coding), and the Fan algorithm.These techniques generally
retain samples that contain important information aboutthe signal and discard the rest. Since
they produce nonzero residuals, they are  algorithms. In the second class of techniques
based on Huffman coding, variablelengthcode words are assigned to a given quantized data
sequence according tofrequency of occurrence. A predictive algorithm is normally used
together withHuffman coding to further reduce data redundancy by examining a successive
number of neighboring samples.

#

 
  
The original motivation for the turning point (TP) algorithm was to reduce thesampling
frequency of an ECG signal from 200 to 100 samples/s .The algorithm developed from the
observation that, except for QRS complexeswith large amplitudes and slopes, a sampling rate
of 100 samples/s is adequate.
TP is based on the concept that ECG signals are normally oversampled at four orfive times
faster than the highest frequency present. For example, an ECG used inmonitoring may have
a bandwidth of 50 Hz and be sampled at 200 sps in order toeasily visualize the higher
frequency attributes of the QRS complex. Sampling theorytells us that we can sample such a
signal at 100 sps. TP provides a way to reducethe effective sampling rate by half to 100 sps
by selectively saving importantsignal points (i.e., the peaks and valleys or turning points).
The algorithm processes three data points at a time. It stores the first samplepoint and assigns
it as the reference point ß0. The next two consecutive points becomeß1 and ß2. The
algorithm retains either ß1 or ß2, depending on which pointpreserves the turning point (i.e.,
slope change) of the original signal.
Figure 10.1(a) shows all the possible configurations of three consecutive samplepoints. In
each frame, the solid point preserves the slope of the original threepoints. The algorithm
saves this point and makes it the reference point ß0 for thenext iteration. It then samples the
next two points, assigns them to ß1 and ß2, andrepeats the process.
We use a simple mathematical criterion to determine the saved point. Firstconsider a 
„()
operation



We then obtain 1 = 
„(ß1 ß0) and 2 = 
„(ß2 ß1), where (ß1 ß0) and(ß ß1) are
the slopes of the two pairs of consecutive points. If a slope is zero,this operator produces a
zero result. For positive or negative slopes, it yields +1 or±1 respectively. A turning point
occurs only when a slope changes from positive tonegative or vice versa.
We use the logical Boolean operators, NOT and OR, as implemented in the Clanguage to
make the final judgment of when a turning point occurs. In the Clanguage, NOT() = 1 if  =
0; otherwise NOT() = 0. Also logical OR means that( OR ) = 0 only if and are both 0.
Thus, we retain ß1 only if {NOT(1) OR(1 + 2)} is zero, and save ß2 otherwise. In this
expression, (1 + 2) is the arithmeticsum of the signs produced by the 
„ function. The
final effect of this processingis a Boolean decision whether to save ß1 or ß2. Point ß1 is
saved onlywhen the slope changes from positive to negative or vice versa. This
computationcould be easily done arithmetically, but the Boolean operation is
computationallymuch faster.



  #
 " !   
 !      () + 
 10! 

   23'% v  !
 
(
"')()
  

 !  
  
 !       
     -4-./ ' 5
6678
The TP algorithm is simple and fast, producing a fixed reduction ratio of 2:1.After selectively
discarding exactly half the sampled data, we can restore the originalresolution by
interpolating between pairs of saved data points.
A second application of the algorithm to the already reduced data increases thereduction ratio
to 4:1. Using data acquired at a 200-sps rate, this produces compresseddata with a 50-sps
effective sampling rate. If the bandwidth of the acquiredECG is 50 Hz, this approach violates
sampling theory since the effective samplingrate is less than twice the highest frequency
present in the signal. The resulting reconstructedsignal typically has a widened QRS complex
and sharp edges that reduceits clinical acceptability. Another disadvantage of this algorithm
is that thesaved points do not represent equally spaced time intervals. This introduces
shorttermtime distortion. However, this localized distortion is not visible when the
reconstructedsignal is viewed on the standard clinical monitors and paper recorders.


##9   


Originally developed to preprocess ECGs for rhythm analysis, the AZTEC(Amplitude Zone
Time Epoch Coding) data reduction algorithm decomposes rawECG sample points into
plateaus and slopes. It provides a sequenceof line segments that form a piecewise-linear
approximation to the ECG.

#,'  

Figure 3.2 shows the complete flowchart for the AZTEC algorithm using C-
languagenotation. The algorithm consists of two parts²line detection and line processing.
Figure 3.2(a) shows the line detection operation which makes use of zero-orderinterpolation
(ZOI) to produce horizontal lines. Two variables ' and ' „alwaysreflect the highest and
lowest elevations of the current line. Variable
„ „keepstrack of the number of samples
examined. We store a plateau if either the differencebetween ' 
and ' „
is greater than a
predetermined threshold 'or if
„ „is greater than 50. The stored values are the length
(
„ „± 1) and theaverage amplitude of the plateau (' + ' „)/2.
Figure 10.4(b) shows the line processing algorithm which either produces aplateau or a slope
depending on the value of the variable
„. We initialize
„to _PLATEAU in
order to begin by producing a plateau. The productionof an AZTEC slope begins when the
number of samples needed to form a plateauis less than three. Setting
„to _SLOPE
indicates that we have enteredslope production mode. We then determine the direction or 

of the currentslope by subtracting the previous line amplitude '1 from the current amplitude
'
.
We also reset the length of the slope 
. The variable '
records the current lineamplitude so
that any change in the direction of the slope can be tracked. Note that' 
and ' „
are
always updated to the latest sample before line detection begins.This forces ZOI to begin
from the value of the latest sample.





 ##()  1 !  
  
   
 ! *c   

 ##()  1  ! 
 
   
 ! *c   

When we reenter line processing with


„equal to _SLOPE, we eithersave or update
the slope. The slope is saved either when a plateau of more thanthree samples can be formed
or when a change in direction is detected. If we detecta new plateau of more than three
samples, we store the current slope and the newplateau. For the slope, the stored values are its
length 
and its final elevation '1.
Note that 
is multiplied by ±1 to differentiate a slope from a plateau (i.e., theminus sign
serves as a flag to indicate a slope). We also store the length and theamplitude of the new
plateau, then reset all parameters and return to plateau production.
If a change in direction is detected in the slope, we first save the parameters forthe current
slope and then reset 
„, '
, 
, ' 
, and ' „
to produce a newAZTEC slope. Now the
algorithm returns to line detection but remains in slopeproduction mode. When there is no
new plateau or change of direction, we simplyupdate the slope¶s parameters, 
and '
, and
return to line detection with
„remaining set to _SLOPE.
AZTEC does not produce a constant data reduction ratio. The ratio is frequentlyas great as 10
or more, depending on the nature of the signal and the value of theempirically determined
threshold.


#-' 
  

The data array produced by the AZTEC algorithm is an alternating sequence ofdurations and
amplitudes. A sample AZTEC-encoded data array is


We reconstruct the AZTEC data by expanding the plateaus and slopes into discretedata
points. For this particular example, the first two points represent a line 18sample periods long
at an amplitude of 77. The second set of two points representsanother line segment 4 samples
long at an amplitude of 101. The first value in thethird set of two points is negative. Since this
represents the length of a line segment,and we know that length must be positive, we
recognize that this minus signis the flag indicating that this particular set of points represents
a line segment withnonzero slope. This line is five samples long beginning at the end of the
previousline segment (i.e., amplitude of 101) and ending at an amplitude of ±235. The nextset
of points is also a line with nonzero slope beginning at an amplitude of ±235and ending 4
sample periods later at an amplitude of 141.
This reconstruction process produces an ECG signal with steplike quantization,which is not
clinically acceptable. The AZTEC-encoded signal needs postprocessingwith a curve
smoothing algorithm or a low-pass filter to remove its jagged appearanceand produce more
acceptable output.
The least square polynomial smoothing filter described in Chapter 5 is an easyand fast
method for smoothing the signal. This family of filters fits a parabola to anodd number (2 +
1) of input data points. Taking = 3, we obtain
swhere`Ris the new data point and Ris the expanded AZTEC data. Thesmoothing function
acts as a low-pass filter to reduce the discontinuities. Althoughthis produces more acceptable
output, it also introduces amplitude distortion.

 #, 1" ! *c   
c$.


  #," ! *c  
 () + 
 10!  
    
23'% v  !
 
(
"')()%   /  
   
5-4##/'5,,8():    /  
   5-4-#/'578
()% 
! ()/Ä 5#/'5.#8

#.c   
The CORTES (Coordinate Reduction Time Encoding System) algorithm is a hybridof the TP
and AZTEC algorithms. It attempts to exploit the strengths of each while sidesteppingthe
weaknesses. CORTES uses AZTEC to discard clinically insignificant data inthe isoelectric
region with a high reduction ratio and applies the TP algorithm tothe clinically significant
high-frequency regions (QRS complexes). It executes theAZTEC and TP algorithms in
parallel on the incoming ECG data.
Whenever an AZTEC line is produced, the CORTES algorithm decides, basedon the length
of the line, whether the AZTEC data or the TP data are to be saved. Ifthe line is longer than
an empirically determined threshold, it saves the AZTECline. Otherwise it saves the TP data
points. Since TP is used to encode the QRScomplexes, only AZTEC plateaus, not slopes, are
implemented.
The CORTES algorithm reconstructs the signal by expanding the AZTECplateaus and
interpolating between each pair of the TP data points. It then appliesparabolic smoothing to
the AZTEC portions to reduce discontinuities.


#6 
  
Originally used for ECG telemetry, the Fan algorithm draws lines between pairs ofstarting
and ending points so that all intermediate samples are within some specifiederror tolerance.
Figure 10.6 illustrates the principlesof the Fan algorithm. We start by accepting the first
sample ß0 as the nonredundantpermanent point. It functions as the origin and is also called
the originating point.We then take the second sample ß1 and draw two slopes {1, 1}. 1
passesthrough the point (ß0, ß1 M  ), and 1 passes through the point (ß0, ß1 ± ). If thethird
sample ß2 falls within the area bounded by the two slopes, we generate twonew slopes {2,
2} that pass through points (ß0, ß2 M ) and (ß0, ß2 ± ). Wecompare the two pairs of
slopes and retain the most converging (restrictive) slopes(i.e., {1, 2} in our example).
Next we assign the value of ß2 to ß1 and read thenext sample into ß2. As a result, ß2 always
holds the most recent sample and ß1holds the sample immediately preceding ß2. We repeat
the process by comparingß2 to the values of the most convergent slopes. If it falls outside
this area, we savethe length of the line and its final amplitude ß1 which then becomes the
neworiginating point ß0, and the process begins anew. The sketch of the slopes drawnfrom
the originating sample to future samples forms a set of radial lines similar to afan, giving this
algorithm its name.
When adapting the Fan algorithm to C-language implementation, we create thevariables,
ß1, ß 1, ß2 and ß 2 to determine the bounds of ß2. From Figure10.6(b), we can show
that

and


where =  ± 0.







 #.   
 !  
  ()2 
 1  (] 
 Ä) 
 1
1 
       
 
 ;
  ›/›/()"   

! ]
 Ä!  ]/ Ä/
 <

 #6 1 c
! 
  
  
  
 #7 1
" !  
   
c$
 

 #6 
 !c
  ! 
 
 !  
   



 #7" ! 
   
()+ 
10! 
  
23 '% v  !
 
 ( 
" ') () %  
/  

   5-4< ' 5 -.8 () :   
/  
    5 -4--/ ' 5
68()% 
! ()/Ä 5#/'57-8

We reconstruct the compressed data by expanding the lines into discrete points.The Fan
algorithm guarantees that the error between the line joining any two permanentsample points
and any actual (redundant) sample along the line is less thanor equal to the magnitude of the
preset error tolerance. The algorithm¶s reductionratio depends on the error tolerance. When
compared to the TP and AZTEC algorithms,the Fan algorithm produces better signal fidelity
for the same reductionratio.
Three algorithms based on Scan-Along Approximation (SAPA) techniquesclosely resemble
the Fan algorithm.
The SAPA-2algorithm produces the best results among all three algorithms. As in the
Fanalgorithm, SAPA-2 guarantees that the deviation between the straight lines(reconstructed
signal) and the original signal never exceeds a preset errortolerance.
In addition to the two slopes calculated in the Fan algorithm, SAPA-2 calculatesa third slope
called the center slope between the originating sample point and theactual future sample
point. Whenever the center slope value does not fall withinthe boundary of the two
converging slopes, the immediate preceding sample istaken as the originating point.
Therefore, the only apparent difference betweenSAPA-2 and the Fan algorithm is that the
SAPA-2 uses the center slope criterionbinstead of the actual sample value criterion.

#7 !!
c 

Huffman coding exploits the fact that discrete amplitudes of quantized signal donot occur
with equal probability. It assigns variable-length codewords to a given quantized data
sequence according to their frequency of occurrence.Data that occur frequently are assigned
shorter code words.

#7%   !!
c 

Figure 10.9 illustrates the principles of Huffman coding. As an example, assumethat we wish
to transmit the set of 28 data points


The set consists of seven distinct quantized levels, or  . For each symbol, 
,we
calculate its probability of occurrence 
by dividing its frequency of occurrenceby 28, the
total number of data points. Consequently, the construction of aHuffman code for this set
begins with seven nodes, one associated with each 
. Ateach step we sort the 
list in
descending order, breaking the ties arbitrarily. Thetwo nodes with smallest probability, 

and , are merged into a new node withprobability 


+ . This process continues until the
probability list contains a singlevalue, 1.0, as shown in Figure 10.9(a).



 #=   
 ! !!
 
()  / Ê   



 
  1  1 Ê   () 
   
 

  
()%  ! !!
 
!    

The process of merging nodes produces a binary tree as in Figure 10.9(b). Whenwe merge
two nodes with probability 
+ , we create a parent node with twochildren represented by

and . The root of the tree has probability 1.0. We obtainthe Huffman code of the
symbols by traversing down the tree, assigning 1 tothe left child and 0 to the right child. The
resulting code words have the `
`` (i.e., no code word is a proper prefix of any
other code word). This propertyensures that a coded message is uniquely decodable without
the need forlookahead. Figure 10.9(c) summarizes the results and shows the Huffman codes
forthe seven symbols. We enter these code word mappings into a translation table anduse the
table to pad the appropriate code word into the output bit stream in the reductionprocess.
The reduction ratio of Huffman coding depends on the distribution of the source symbols. In
our example, the original data requires three bits to represent the sevenquantized levels. After
Huffman coding, we can calculate the expected code wordlength.

where
represents the length of Huffman code for the symbols. This value is 2.65in our
example, resulting in an expected reduction ratio of 3:2.65.
The reconstruction process begins at the root of the tree. If bit 1 is received, wetraverse down
the left branch, otherwise the right branch. We continue traversinguntil we reach a node with
no child. We then output the symbol corresponding tothis node and begin traversal from the
root again.
The reconstruction process of Huffman coding perfectly recovers the originaldata. Therefore
it is a lossless algorithm. However, a transmission error of a single bit may result in more
than one decoding error. This propagation of transmissionerror is a consequence of all
algorithms that produce variable-length code words.

#7 ! !!


c 

The implementation of Huffman coding requires a translation table, where eachsource
symbol is mapped to a unique code word. If the original data werequantized into 16-bit
numbers, the table would need to contain 216 records. A tableof this size creates memory
problems and processing inefficiency.
In order to reduce the size of the translation table, the modified Huffman codingscheme
partitions the source symbols into a frequent set and an infrequent set. For all the symbols in
the frequent set, we form a Huffman code as in the staticscheme. We then use a special code
word as a prefix to indicate any symbol fromthe infrequent set and attach a suffix
corresponding to the ordinary binary encodingof the symbol.
Assume that we are given a data set similar to the one before. Assume also thatwe anticipate
quantized level 0 to appear in some future transmissions. We may decide to partition the
quantized levels {0, 7} into the infrequent set. We thenapply Huffman coding as before and
obtain the results in Figure 10.10. Note thatquantized levels in the infrequent set have codes
with prefix 0100, making theircode length much longer than those of the frequent set. It is
therefore important tokeep the probability of the infrequent set sufficiently small to achieve a
reasonablereduction ratio.
Some modified Huffman coding schemes group quantized levels centered about0 into the
frequent set and derive two prefix codes for symbols in the infrequentset. One prefix code
denotes large positive values and the other denotes largenegative values.


#= 0c 

Huffman coding requires a translation table for encoding and decoding. It isnecessary to
examine the entire data set or portions of it to determine the datastatistics. The translation
table must also be transmitted or stored for correctdecoding.
An adaptive coding scheme attempts to build the translation table as data arepresented. A
dynamically derived translation table is sensitive to the variation inlocal statistical
information. It can therefore alter its code words according to localstatistics to maximize the
reduction ratio. It also achieves extra space savingbecause there is no need for a static table.
An example of an adaptive scheme is the Lempel-Ziv-Welch (LZW) algorithm.
The LZW algorithm uses a fixed-size table. It initializes some positions of the tablefor some
chosen data sets. When it encounters new data, it uses the uninitializedpositions so that each
unique data word is assigned its own position. When thetable is full, the LZW algorithm
reinitializes the oldest or least-used positionaccording to the new data. During data
reconstruction, it incrementally rebuilds thetranslation table from the encoded data.


 #7  ! ! !!
 
>
90?</6@  


! &
 

#<'!! 


Typically, neighboring signal amplitudes are not statistically independent.Conceptually we
can decompose a sample value into a part that is correlated withpast samples and a part that is
uncorrelated. Since the intersample correlation correspondsto a value predicted using past
samples, it is redundant and removable.We are then left with the uncorrelated part which
represents the prediction error orresidual signal. Since the amplitude range of the residual
signal is smaller than thatof the original signal, it requires less bits for representation. We can
further reducethe data by applying Huffman coding to the residual signal. We briefly
ssdescribetwo ECG reduction algorithms that make use of residual differencing.
Ruttimann and Pipbergerapplied modified Huffman coding to residualsobtained from
prediction and interpolation. In prediction, sample values are obtainedby taking a linearly
weighted sum of an appropriate number of past samples


where(„ ) are the original data, („ ) are the predicted samples, and ` is thenumber of
samples employed in prediction. The parameters Rare chosen to minimizethe expected mean
squared error [( )2]. When ` = 1, we choose 1 = 1and say that we are taking the 


„ of the signal. Preliminary investigationson test ECG data showed that there was no
substantial improvement by usingpredictors higher than second order. In interpolation,
theestimator of the sample value consists of a linear combination of past and futuresamples.
The results for the predictor indicated a second-order estimator to be sufficient.Therefore, the
interpolator uses only one past and one future sample

where the coefficients and are determined by minimizing the expected meansquared error.
The residuals of prediction and interpolation are encoded using amodified Huffman coding
scheme, where the frequent set consists of somequantized levels centered about zero.
Encoding using residuals from interpolationresulted in higher reduction ratio of
approximately 7.8:1.
Hamilton and Tompkins exploited the fact that a typical ECGsignal is composed of a
repeating pattern of beats with little change from beat tobeat. The algorithm calculates and
updates an average beat estimate as data arepresented. When it detects a beat, it aligns and
subtracts the detected beat from theaverage beat. The residual signal is Huffman coded and
stored along with a recordof the beat locations. Finally, the algorithm uses the detected beat
to update theaverage beat estimate. In this scheme, the estimation of beat location and
quantizerlocation can significantly affect reduction performance.

#
:
 
 

Used extensively in the facsimile technology, run-length encoding exploits thehigh degree of
correlation that occurs in successive bits in the facsimile bit stream.A bit in the facsimile
output may either be 1 or 0, depending on whether it is ablack or white pixel. On a typical
document, there are clusters of black and whitepixels that give rise to this high correlation.
Run-length encoding simplytransforms the original bit stream into the string {O1, 1, O2, 2,
«} where O
are thevalues and 
are the lengths. The observant reader will quickly recognize
that bothAZTEC and the Fan algorithm are special cases of run-length encoding.
Take for example the output stream {1, 1, 1, 1, 1, 3, 3, 3, 3, 0, 0, 0} with 12 elements. The
output of run-length encoding {1, 5, 3, 4, 0, 3} contains only sixelements. Further data
reduction is possible by applying Huffman coding to theoutput of run-length encoding.

#:4c$'  
  
This lab explores the data reduction techniques reviewed in this chapter. Load UWDigiScope
according to the directions in Appendix D.

#

 
  
From the 
menu, select 
  and then (  . Theprogram
compresses the waveform displayed on the top channel using the TPalgorithm, then
decompresses, reconstructs using interpolation, and displays theresults on the bottom
channel. Perform the TP algorithm on two different ECGsread from files and on a sine wave
and a square wave. Observe

1. Quality of the reconstructed signal


2. Reduction ratio
3. Percent root-mean-square difference (PRD)
4. Power spectra of original and reconstructed signals.

Tabulate and summarize all your observations.

#9   


The AZTEC algorithm by selecting   from the
 menu. Using at least
three different threshold values (try 1%, 5%, and15% of the full-scale peak-to-peak value),
observe and comment on the items inthe list in section 10.5.1. In addition, summarize the
quality of the reconstructedsignals both before and after applying the smoothing filter.
Tabulate and summarizeall your observations.

## 
  
The Fan algorithm by selecting from the
menu. What can you deduce
from comparing the performance of the Fan algorithmwith that of the AZTEC algorithm?
Tabulate and summarize all your observations.

#, !!
c 

Select from the
 menu. Select in order to Huffman encodethe
signal that is displayed on the top channel. Do not use first differencing at this point in the
experiment. Record the reduction ratio. Note that this reduction ratiodoes not include the
space needed for the translation table which must be storedor transmitted. What can you
deduce from the PRD? Select   towrite the Huffman data into a file. You may
view the translation table later withthe DOS ! command after exiting from 
.
Load a new ECG waveform and repeat the steps above. When you select ,the program
uses the translation table derived previously to code the signal. Whatcan you deduce from the
reduction ratio? After deriving a new translation tableusing " from the menu, select
 again and comment on the new reductionratio.
Select " again and use first differencing to derive a new Huffman code. Isthere a
change in the reduction ratio using this newly derived code? Select  to write the
Huffman data into a file. Now reload the first ECGwaveform that you used. Without deriving
a new Huffman code, observe the reductionratio obtained. Comment on your observations.
Exit from the 
 program to look at the translation tables that you generated.What
comments can you make regarding the overhead involved in storing a translationtable?



















c ,
c+Ac:2% +A
The feeling of being in virtual contact with the health care professionals provides a sense of
safety to the subjects without the hassles of permanent monitoring. Offers a valuable tool for
easy measurement of ECG. Offers first hand help when ever patient requires immediate
medical attention.

The results achieved were quite satisfactory the DCT found to be compressed 90.43 with
PRD as 0.93. The signal analysis techniques using LABVIEW software where various
abnormalities are to be checked for and finally display the problem in ECG of a particular
patient was also given a positive indication, with this as the goal set the further
implementation in mat lab simulink work is also under the implementation stage.

The comparison table, the resultant compression techniques. This gives the choice to select
the best suitable compression method. Hence in this project the DCT found to be compressed
90.43 with PRD as 0.93.

c  
 !  
 
&

 +' c+%% +A + '

CORTES 4.8 3.75


TURNING POINT 5 3.20
AZTEC 10.37 2.42
FFT 89.57 1.16
DCT 90.43 0.93



c -
 Ac%
[1] S. Jalaleddine, C. Hutches, R. Stratan, and W.A.Coberly,(1990) ECG data compression
techniques-a unified approach, IEEE Trans.B iomed.Eng.,37,329-343.

[2] B.R.S.Reddy and I.S.N. Murthy.(1986) ECG Data Compression using Fourier descriptors.
IEEE Trans. Biomed.Eng.,BME-33,428-433

[3] D.C.Reddy, (2007) Biomedical signal processing-principles and techniques, 254-300,


Tata McGraw-Hill, Third reprint.

[4] Abenstein, J. P. and Tompkins, W. J. 1982. New data-reduction algorithm for real-time
ECGanalysis, m  „ 
  „, =: 43±48.

[5] Bohs, L. N. and Barr, R. C. 1988. Prototype for real-time adaptive sampling using the Fan
algorithm,   
 „   ` , .: 574±83.

[6] Cox, J. R., Nolle, F. M., Fozzard, H. A., and Oliver, G. C. Jr. 1968. AZTEC: a pre-
processingprogram for real-time ECG rhythm analysis. m  „ 
  „, -:
128±29.

[7] Huffman, D. A. 1952. A method for construction of minimum-redundancy codes.


m, ,<:1098±1101.

[8] Bousseljot, R.D., Kreiseler, D., ³ECG analysis by signal patterncomparison´. 


 
 
„
„
„ , Pages 156±157, 1998.

Das könnte Ihnen auch gefallen