A program for the processing of multiple-lead exercise ECGs in real time

A program for the processing of multiple-lead exercise ECGs in real time

Computer Programs in Biomedicine 14 ( ! 982) ! 33-144 133 Elsevier Biomedical Press A program for the processing of multiple-lead exercise ECGs in ...

1MB Sizes 3 Downloads 16 Views

Computer Programs in Biomedicine 14 ( ! 982) ! 33-144

133

Elsevier Biomedical Press

A program for the processing of multiple-lead exercise ECGs in real time K a r l - J o h a n S. Falk, J a n - E r i k A n g e l h e d a n d Thorvald I. Bjur6 * Department of Applied Electronics, Chalmers University of Technology, 412 96 Grteborg and * Department of Clinical Physiology, Sahlgren Hospital, 413 45 G6teborg, Sweden

A computer program for continuous recording and real-time processing of 8-channel exercise ECGs is presented. Current average ECG complexes and trends of various morphological and rhythmic parameters can be displayed on a I V monitor during the stress test. Average complexes compated every 10 s, the time of occurrence and 6 morphological coefficients of all detected tentative QRS complexes, and data manually entered by the operator are stored in a file on disk. The operational procedures and the principal signal processing are briefly presented. The main attention is gb, en to a description of the software structure, explaining the subdivision of the program into dedicated amcnomous sections and the system for the coordination of simultaneous activities of different priority. Computer program

Exercise ECG

Monitoring

Real-time processing

1. INTRODUCTION Exercise tests are used in several diagnostic ,;ituafions to examine the function of the heart during physical stress. An important area of application is the estimation of the ischemic reaction to an increased work load by an interpretation of the electrocardiogram (ECG) [1]. One common purpose is to determine if a chest pain is of cardiac origin. In cases of severe angina pectoris, the stress test has been found to be a valuable complement to angiography in the examination before possible bypass surgery [2,3]. The method is also a potential tool in the adjustment of medication and in the follow-up after surgical treatment. A typical stress test protocol includes measuremerits at rest, at several stages of increasing physical work load, and after exercise [1]. Blood pressure, heart rate, and one or more ECG leads are recorded. The ECG is usually visually interpreted from paper tracings, and the occurrence of arrhythmias and ST segment depression constitutes the information of main interest. Unforlunately, stable signals that are reasonably free 00 ! 0-468X/82/0000-0000/$02.75 © 1982 Elsevier Biomedical Press

from disturbances are not easily obtained. Noise originating in the electrical activity of the muscles and baseline variation arising at the skin-electrode interface due to breathing and physical motion impose a severe limitation upon the accuracy of the measurements. The signal quality can be improved by such measures as careful skin preparation and selection of proper electrode type and cabling. Furthermore, the placement of electrodes in the immediate vicinity of skeletal muscles or moving parts of the body can be avoided. The modified limb lead positions suggested by Mason and I.ikar are a well-known example [4]. In spite of these precautions, howeve,, a considerable amount of noise still remains at higher load levels. This noise overlaps in frequency content with the ECG and can therefore only partly be removed by means of analog filtering. Since the introduction of digital computers in exercise ECG ~esting, however, it has become possible to improve the signal quality substantially by the calculation of average ECG complexes, each composed of several superimposed consecutively recorded complexes [5,6].

134

Most systems for computerized processing of exercise ECG's record 1-3 leads [7,8]. This category comprises the whole range from simple procedures, primarily employed at the early stages of development [51, to the more sophisticated processing of recent date, including real-time presentation of measurements and automatic generation of clinical reports [9]. In programs designed for more extensive recording, the averaging process is started either by the operator or automatically initiated at regular time intervals of >~ i min [10-12]. Systems recording > 10 leads [13-16] tend to be cumbersome to operate, and therefore seem to be confined mainly to the controlled environment of the cardiovascular research laboratory. The recent development of exercise ECG measurement procedures is mainly connected v~ith research concerning non-i~vasive diagnosis of coronary artery disease. A number of lead systems, from single-lead to body surface mapping, are evaluated in combination with different sets of interpretative criteria. Many investigators believe that it is essential to record several leads in order to gain access to most of the diagnostically significant information available on the body surface [2.13-19]. As yet. however, probably only a small fraction of the potentially useful information has been extracted from the recorded :ignais. This paper present', a computer program for c o n t i n u o u s recording and real-time processing of 8 ECG leads during aa exercise test. Although intended for research purposes, it has been given features that make it reasonably simple to use in a clinical routine. After a brief presentation of the operational procedures and principal data processing, the following text is devoted to the organizing aspects of the software.

2. EQUIPMENT A N D OPERATIONAL PROCEDURES The hardware compositit3n of the recording system is shown in fig. !. In che examination room there is an electrically braked ergometer bicycle, which is controlled by the computer. A 6-channel ECG recorder (Mingograph 61, Siemens-F, lema), w,,~dified to accept 8 input channels and to allow

Fig. I. The recording and processing system.

edited plots containing ECG curves and text to be generated, is also connected to the computer. An alpha-numeric video terminal is used for control of the system, while feedback is provided via a TV monitor in the form of trends and other diagrams computed in real time from recorded data. The computer (PDP 11/40, Digital Equipment Corporation) is located in a separate room. It has a 28000 word primary memory and is furnished with two 2.5 megabyte disk drives, a magtape drive, and an electrostatic printer/plotter. The ECG i n p u t / o u t p u t is channeled through 12-bit A / D and D / A converters. At the beginning of a computerized exercise EC(; examination, administrative data are entered on the video terminal. These include patient ID, name of referring clinic, patient group ID and serial number, and name of the physician in charge of the examination. With the patient lying on a couch, the electrodes are attached and the recording program is started. It is initially running in a learning mode, during which the algorithms adapt themselves to the shape of the QRS complex and to the current heart rate. This process can be checked on the TV monitor. After ----1 rain, the operator starts the rec~rding mode. In the present application, 6 chest leads and limb leads I and II, from which the standard 12-lead system can be derived, are con-

135

of the heart rate or progression of the ST depression is displayed on the screen when requested by the operator. The trends of systolic and diastolic blood pressures are also available, as is the product of heart rate and systolic blood pressure. The heart rhythm can be checked at any time by inspection of the last 200 RR intervals a n d / o r values of any one of 6 parameters characterizing the morphology of the QRS complex. Information about the current load level or heart rate is printed on the terminal when requested. Six ECG channels are recorded on paper during the test, and the time and the load levels are indicated on the same tracing. Data recorded and computed during the stress test, such as representative ECG complexes, rhythm data, and manually registered data, are stored in a file on disk for later analysis and

tinuously recorded. The patient is lying down, sitting at rest on the ergometer bicycle, cycling, etc., according to the protocol applied. The load levels, are either manually controlled by commands on th'e terminal or automatically sequenced by the program. Systolic and diastolic blood pressures, subjective degree of physical effort, chest pain, and dyspnea are recorded by typing different codes followed by the quantifying numerical arguments. There is also a code for a general type of event with eligible arguments between 0 and 4095. This code can be used to represent other changes of the condition of the patient, new stages of the examination, or whatever the conductor of the exercise test wants to register. All 8 channels of a current representative ECG complex, computed as the average over 10 s, can be inspected on the TV monitor. The development

F-

.i:

"

t--

,---lJ --,,;1:4

t

~~,,~,,,,,~

,::..~~

.....

J...#~

~k_-.Zd- ~- II.i!, !, i,! "~ lit T~.~ A7 ,11.... i~ ~-i~

m~'IHl~iliiii~"

,

If-

!

t

i

t

'

:

?

,

*

"

r

l

'

ti:~

22~29"~,~J

0 E P IIEIb

I

(

'

i

i- 4-

I

'

IL: e> tqHTIqL 3 4

SNZl~

t

t

-

~:[4

'

'

'

¢ e.'44)

1

~

IqNTI~L 3 2

.

~:

~

.. _,

9

(

..-a_,

2:

2)

~_-,

f~ITP, L

2e

,

. . '. . I. . ,

1:15

~i-f

(

2:

"

2)

"

RHTRL

~-~

.....

;-~-

2~

30HH DE)lOT3

-'8,~I~

~;EL(~..LrH

Fig. 2. One page of a graphic presentation of average ECt3 complexes recorded at different stages during the stress test. The presentation is generated on the ECG recorder and includes ct,mplexcs of the standard 12-lead system. At each stage, the current load lev.:i, the start time of the averaging period, the heart rate, ar d the number of added complexes are indicated•

136

presentation. At the end of the examination, the recording mode is stopped. Data can still be inspected on the screen but a-e no longer updated. The program is subsequently halted, and preparation for graphic output is made. The reccrding system is operated by entering different mnemonic codes on the video terminal. These codes can be divided into 4categories according to their function, which is indicated by the first letter in the respective codes. 'CSTART', which initiates the recording mode, belongs to the family of control commands. A plot of the heart rate t~s time will be displayed on the monitor screen if "DHR" is typed. A 'Q' expresses a question and is exemplified by "QHR', which asks the system to write the current heart .:re on the terminal. When data are to b~. entelcd manually by the operator, the corresponding mnemonic code begins with an 'L' for log. 'LBPI20/9ff informs the computer that the present systolic and diastolic blood pressures are 120 and 96 mmHg, respectively. If a formally erroneous command is given, no action is taken and a warning is printed. After termination of the exercise test, various parameters computed from the recorded data can be presented as graphs on the electrost~ttic printer/plotter and on the modified ECG recorder. This is accomplished by invoking an automarie command procedure which, in turn, runs the desired set of generating programs, lr~ addition to the clinically required documentation, an extended ~et of graphs and tables is regularly gener,y.ted for research purposes. One of the plots is generated on the ECG recorder. It is composed of severa! pages a.M contains complexes of the standard 12-lead system, selected from different stages during the stress test (fig. 2). The development of heart rate and blood pressure as the work load varies with time is summarized in a table which is created on the printer/plotter. This table also contains information about degrees of effort, chest pain, and dyspnea, subjectively quantified by the patient. The ST amplitudes measured in different leads during the stress test are printed in a table or plotted as amplitude curves t~s time. A more convenient way to exhibit trends in the precordial leads, however, is to present the ST amplitude in the form of an

isopotential plot, where the independent coordinates consist of time and a s p a c e d i m e n s i o n o u t l i n e d by the standard chest electrode positions 1-6 (fig. 3) [20]. Another graph worth mentioning displays all R R intervals vs time of occurrence. In parallel with these, a parameter is plotted that a s s u m e s large values for aberrant QRS complexes, while normally being close to zero (fig. 4). This presentation provides a convenient survey of the distribution of different arrhythmias during the exercise test. TI~[

LORD

CHI

CH2

CH3

CH4

CH5

CHG

-10 W

48 u 50 W

,

/

7o w

~

t

/

--~

S.oe w - ~ ' . - --.' ; "- - ~ ' ~ "

~-f,i

_~. ~

"1.3

0.2

le-

. . . . . . D

-":l.a

-t,

-~~

0.~

- t.;'

-e.~---'~.g --o.4

__ 0 W

.,.

_,_:7 . . . . . .

0.3

Fig. 3. An isopotential pin: presenting the development of ST amplitude during the stress test. Time is indicated along the vertical axis while the horizontal axis represents a space dimen:,ion outlined by the standard c~lest electrode positions I-6. The lime periods of different load levels are demarcated by "~orizontal lines, - 1 0 W and 0 W denoting rest on the couch m d on the ~icycle, respectively. The isopotential lines indicate ST amplitude levels 0.05 mV apz:rt, where zero is represented by a thick line. Local extreme values are given for each channel.

137

QIRSMM

CHANNEL 3 ECG (MV) •

l~lt

,

,

;

I

'l



(SEC)

j

!

588

I)WD (UNITS) 1 '

TIM£ (MS)

TIME (MIN)

see "riM;" CMS)

CHANNEL 4 ECG (MV)

Fig. 4. A short se&ment of the rhythm survey plot. The QRS morphology measure (QRSMM) assumes large values for aberrant complexes, while normally being close to zero. About 1.5 rain before exercise is begun at 30 W, a strong transient disturbance causes a false detection. After 20 s there is a ventricular ectopic beat. This is characterized by a deviating QRS morphology and a compensatory pause in the succeeding RR interval.

A

!

kf

DWD(UHI~$)

588

71M£ (MS) ~ ~ ,

188

-"~"'--'--.7 -f



I

;'"~---'~~,~-'~ sea ~IM£ (MS)

CHANH£L 5 I:CG (MY)

3. SIGNAL PROCESSING In order to provide an understanding of the requirements on the program structure, the signal processing is presented briefly here. Eight ECC; signals are filtered and subsequently digitized at a rate of 500 samples/s. QRS complexes are cietected by estimating the current wave activity in the ECG. The estimation is based on a parameter which is defined for one channel and which is here denoted degree of wave deflection. It is calculated as the absolute value of a 6-point approximation of the integral over a symmetrical 60 ms interval, with a weight function proportional to the second-order Legendre polynomial. Tiffs digital filter is sensitive to peaks in normal, edopic, and patho!ogically deformed QRS complexes, whereas the influence of offset and slope due to the relatively slow baseline variation is diminished. The wave activity is then estimated as the sum of the maximal degrees of wave deflection in channels 3, 4, and 5, calculated at 6 ms intervals within a symmetrical 42 ms interval (fig. 5). When

I

DWI) (UNITS)

.~-/~-.

TIM£ (M$~

188

588 WRV£ A C T I V I T Y (UNITS)

TIME (MS)

580

580 TIME (MS)

Fig. 5. The calculation of Wave activity. Belew each ECG complex the computed degree of wave deflection (DWD) is drawn. The dotted curves indicate the maxim_al degrees of wave deflectlon within a symmet:'ical 42 ms interval. The sum of these curves constitutes the wave activity.

the wave activity exceeds a certain threshold, a preliminary estimate of the position of a tentative QRS complex has been found. This position is hereafter denoted a preliminary fiducial point. The algorithm is then deactivated for 120 ms before the search is continued. The detection threshold is recursively updated every second, and is thus permitted to follow changes in QRS morphology evolving slowly compared to the respiratory cycle. An average complex is calculated every 10s during the learning mode by adding mgments selected with respect to the preliminary fiducial points. In each of the channels 3-5 of the averaged QRS complex, the position of the point of the highest degree of wave deflection is located relative to the preliminary fiducial point. The time offset and the direction of the deflection are registered. The positions of the beginning and the end of QRS are also determined in each average complex by application of a standard procedure based on the sum of estimated absolute derivatives in 3 channels. During the recording mode, the fiducial points are adjusted by locating the maximum of an alignment parameter within a 152 ms interval at every preliminary fiduciai point. The alignment parameter is computed as the sum of 48 ms integrals of channels 3-5. These integrals are estimated by 6-point approximations with the second-order Legendre polynomiai as a weight function. The integration intervals are selected with re.,pect Io the time offsets and the integrals are multiplied by the sign variables computed during the last 10 s period of the learning mode (fig. 6). Ever3 detected tentative QRS complex is classified according to 6 morphology coefficients. These are defined a~ 2i point approximations of 84 ms integrals of the ECG channels 3 and 5, using wt;ight functions proportional to the Legendre pc4ynom als of orders 2, 3, and 4. The computed coefficients have the advantage of being influenced by the overall QRS morphology and at the same time being relatively insensitive to the slow baseline variation as well as to high-frequency noise components. A complex is accepted for averaging if and only :f all 6 QRS morphology coefficients lie within individually assigned intervals recursively adapted to the current mean amplitude and scattering of each coefficient cfig. 7). Thus,

'l

CHANNEl 3 ECG (MI/)

WEI GH't )(UNITS)

,/I

100 I

'[

CHANNEL 4 ECG (MV)

WEl GHT (UNITS)

/ 100

0

I -.5

'[

CHANNEL 5 ECG (~V.~

WEIGH"t (UNITS) .5

0

00

-,5

ALIGNMENT

PARAMETER

(UNITS)

"tIME (MS)

PFP-54

DFP

AP

PFP÷58

Fig. 6. The determination of definit.ive fiducial points. During the recording mode, an alignment parameter is computed within a 152 ms time interval at every detected preliminary fiducial point (PFP). The alignment parameter is at each considered point of time (AP) equal to the sum of filtered values of channels 3, 4, and 5. Six-point filters (crosses) are applied at time offsets (thick lines) and multiplied by signs determined during the learning mode. The location where the alignment parameter assumes its maximum is denoted the definitive fiducial point (DFP).

'39 COEFFICIENT ~PLI'IUDES - CM~O4EL 3

u l - , GNT TUI,~T I ONS

ECG

{ L3

SYSTEM

CLOCK

!

RECORDED EC,

/

/

t

PRELIMINARY FIDUCIAL POINT CRITERION

PRELIMINARY Y I D I J C I A L POINT IN RECORDED ECG coErrlCI£NT

-

AMPLITUDES

CHR~"4EL

.&

5

DEFINITIVE F I D U C I ~ L POINT CRITERION

D E Y I N I T l V E FIDUCIAL POINT IN RECORDED ECG RHYTHM AND MORPHOLOGICAL DATA

L-,

I

:

:"

:

;

:

:

:

:

:

-"

!

-"

MORPHOLOGY CHARACTERISTICS OF THE T E N T A T I V E O R S

! i1~ ( $ J

MORPHOLOGY CRITERION Wo;~ LOAD ~W~

I~

I~ " I'~"l5~"I~-"I~e'I 8~"i9 ~ q - ~ MORPHOLOGY CLASS

Fig. 7. O R S morphology cocfficicnts calculated during part of a stress tcst. The curves to the left show thc Legcndrc functions of orders 2 (L2), 3 (L3), and 4 (L4) which are used as wei&ht functions in the calculation of O R S morphology coefficients. Values computed for channels 3 and 5 are displayed to the right together with the corresponding adapted discriminant levels which appear as distinct edges above and below each band. The RR intervals and current load levels are indicated below. At ~ 200 s from the beginning of the record, there is a false detection followed by an ectopic beat of ventricular

OFFSET

BEGINNING OF O R S IN AVERAGE COMPLEX AND

AVERAGE RR INTERVAL

I SLOPE A N D O F F S E T CORRECTED ~ #VERAGE COMPLEX

ventricular ectopic beats and false detections are prevented from being included in the average complexes. However, premature beats of supraventricular origin are accepted, since restrictions on the corresponding preceding and succeeding RR intervals are not incorporated in the present version of :he program. The 8-dimensional average complexes computed every 10 s are 1000 ms long and have a time resolution of 4 ms. A diagram is shown in fig. 8 describing the ECG data :qow with the program in the recording

TO

END

I J J

MORPHOLOGY C H A R A C T E R I S T I C S OF THE AVERAGE COMPLEX

CORRENT

HEART RATE

Fig. 8. ECG data flow with the program in the reco:ding mode. The squares represent processors.

mode. A current average RR interval is estimated every 10 s on the basis of the determined fiducial points, using a non-linear recursive filter. The current heart rate is calculated as the inverse of this parameter. The beginning and end of QRS are assigned to locations at distances relative to the definitive fiducial point equal to those estimated in the learning mode. The average complexes are

140

linearly corrected for offset and slope before being used for real-time calculation of different morphological parameters_ An average complex is stored every 10 s in the disk file. Definitive fiducial points of time and the corresponding sets of the 6 morphological coefficients of all detected tentative beats are also saved. The load sequence, the systolic and diastolic blood pressures, and the degrees of effort, chest pain, dy spnea. and ‘arbitrary event’ are stored together with the times of registration.

4. SOFTWARE

STRUCTURE

The computer program is written in assembler code and executed under a single-job operating system (RTl 1 VO2C. Digital Equipment Corporation). In this way, the fast response and structural flexibility necessary to run several processes simultaneously in real time are achieved. By choosing algorithms based on simple integer arithmetic, rapid execution is accomplished. The program is divided into approximately 20 sections, each associated with a certain aspect of the processing. The activity is controlled by clocks and by the interaction between routines within sections and between sections. External stimuli are received from the operator terminal and, Indirectly, through the recorded ECG. When a routine is requested to perform a task, it becomes active. It then .remains in this state until the task is concluded and the routine returns to a passive state. The currently active routines are executed according to their respective degrees of urgency. High priorities are assigned to tasks which cannot wait and rnust be carried out immediately, whereas other, often more lengthy, prccesses are put on lower pricrity levels. If several routines on the same level are simultaneously active, they are attended to on a round-robin’ basis. When a routine 1s activated on a higher priority level than that of the currently serviced routine, attention is directed to the new task and is not returned until all activities on higher levels have been completed.

4.1. The arbitration routine The main activity of the processor is in the present program regulated by means of the socalled arbitration routine. This is invoked by the system cIock 500 times/s as an interrupt routine at priority level6. After an entry, all routines are called which are assigned to be operating on this level during the current program mode. The activated routines are serviced, while those that are not make immediate returns. Then the processor priority is lowered to 5 and the active routines on this level are attended to. In the same manner routines on successively lower priority levels are serviced down to and including level zero, after which an exit from the arbitration routine is ma!de. Often this descending process is not concluded in 2 ms, causing the arbitration routine to interrupt itself. In this case, the new entry is allowed to attend only to routines on priority levels higher than the level of the interrupted process. When finished, the old entry is resumed, proceeding down the priority scale. Device handler routines, invoked by external interrupts from, for example, disk or terminal, are serviced on the same priority levels as those assigned tc the corresponding interrupting

PRlOR17V LLVLL

-_.

3

h ____________I

2

_____

__..__

I

Fig. 9. Simulated indicate levels.

that

arbitration routines

Cuzrnt

first entry service

are

processing

of the arbitration

of the routines

active

of processor active routine

l-

level 2 is interrupted is interrupted

the next entry,

before

is resumed, routines

time interval

bemg

and

active displayed

activity. the

Dashed

respective by

thick

in the figure

lines.

concluded

processmg

in the figure.

by

processentry.

at level 4 and by

at level 3. Then the first

continues

on level 0 are not

The

is followed

by the succeeding

bv the terminal

lines

priority

on levels 6. 3 and 2. The

ing at priority in turn.

on

is represented

which,

The

_‘_____‘______

__---__-_.--_______-__--_~--_-_______~___---~~__-_~_-____

0

entry

_ .___.

_----_---_-______________

at levels 2 and

at tended

to during

I. the

141

devices. Thus, the arbitration routine, ~_he other device interrupt routines, and the ordinary subroutines can be nested in a single scheme (fig. 9). 4. 2. General characteristics of a program section

A p~ogram section performs tasks corresponding to a specific aspect of the total activity of the recording system. It can be subdivided into different functional units that are operating on ':he appropriate pridrity levels. Most sections contain an initiation routine, which is invoked when the program enters a new mode. This routine initiates counters, pointers, and flags and prepares data areas and computational parameters. The main functions of the section are carried out by one or several driver routines, invoked by the arbitration routine on their respective assigned priority levels. Their states of activity are regulated by the use of flags and clocks. Directly after the entry of a driver routine, a test is performed, and, if found passive, an immediate return is made. Certain functions are carried out with the assistance of specialized service sections. Thus, the reception of commands and the exchange of information with :he operator are handled by the terminal communication routines in ass~>:'iation with the terminal I / O section. A picture shown on the TV monitor is ordinarily composed of several superimposed subpictures, each of which is based on data processed by a specific section. A subpicture is first drawn on the basis of the information that was available at the time of the request and, as more data are recorded, new information is added regularly to the picture. These tasks are carried out by the display initiation and updating routines, as coordinated by the display section. Recorded and computed data are temporarily stored in buffers and tables in the primary memory., and some of these are subsequently to be copied to the disk file. A transfer is achieved, by calling the transfer request routine of the section which prepares the record and, subsequently, issues a request to the transfer section. 4. 3. The control and service sections

The structure of the control section differs from that of an ordinary section, i',s principal functions

being to implement the different program modes of operation and to coordinate the activity of the other sections by means of the arbitration routine. Communication with the operator is maintained through thc terminal I / O section~ which is functioning on priority level I. Requests for the display of pictures on the TV monitor are serviced by the display section. The creation of images is performed on priorhy level 0 and is supported by a set of subroutines for plotting points, vectors, curves, coordinate axes, etc. Transportation of data to the disk file is carried out by the transfer section, operating on priority level 3. 4. 4. Organization of the data processing

Eight ECG signals are digitized every 2 ms, and the sample vectors are stored in a circular buffer. This operation is performed by the first driver routine to be serviced on priority level 6. On the ~,ame level, the preliminary fiducial point section continuously scans the circular buffer for new QRS complexes as data are recorded. The adaptation of the detection tlireshold is performed by the same driver routine. The definitive fiducial point section is active on priority level 3, adjusting the fiducial points in the detected tentative beats. The sections maintaining up-to-date values of the RR interval and heart rate operate on the priority levels 3 and 2, respectively. The calculation of QRS morphology coefficients and classification of complexes are carried out on priority level 3, as is the updating of the acceptance criterion. Average complexes are created 1 every l0 s on priority 2 and are subsequently fetched by the morphology computation section to a separate buffer where the further processing and analysis take place on level 1. During the learning mode, the definitive fiducial point criterion is adapted to the QRS complex, and the beginning and end of QRS are located. Commands and physiological data manually entered by the operator are processed by the terminal communication routines of the sections concerned as invoked by the terminal I / O section on priority level 1. If the automatic load sequence has been activated, a driver routine operating with the same priority increments the load level regu-

142

larl~. TiJe printing of time and current load on the ECG tracing is performed by the paper text section on level 3. 4.5. The data preserved after a stress test

Data recorded and processed during the exercise test are transferred to a file on disk. This file begins with a file identification block, followed by the patient and examination identification block. Next, there is a directory containing entries, each of which corresponds to a data record in the file, specifying the type of data, the time of transfer, and the storage address. The directory is succeeded by the start block containing the starting time of the recording mode and indicating the beginning of the data area of the file. The data records are transferred to disk and stored in sequential order as the corresponding data buffers in primary memory are filled during the recording. Apart from the recorded data, each record contains a header, informing about its contents, length. time of transfer, etc. After the last data record, an end trailer marks the end of the data file. The computation of graphs and tables is supported by a set of subroutines for fetching data from a random access data file of the format described. This is complemented by routines for thc generation of curves and text on the ECG recorder and for the creation of picture elements and diagrams on the printer/plotter.

one record, the morphology of the ECG caused double detection to occur on several hundred complexes during rest. Of 159 ventficular extrasystoles present, 74% were detected. One record containing 130 ectopic beats of almost identical morphologies was excluded from this calculation (10 were missed by the algorithm). Note that a detected beat has to be classified as normal before being accepted for averaging. The jitter in the determination of definitive fiducial points due to a non-zero sampling interval and noise can be estimated under the assumption that: (a) it is uncorrelated at different beats; (b) it is largest at maximal work loads; and (c) its amplitude is independent of the present extent of variations in the QRS morphology due to respiration. By measuring the total RR variability during maximal exercise on records devoid of a dominant respiratory component, an upper limit of the jitter under normal conditions was found to be -+-2ms. In the examination of the 40 records mentioned above, all 137 detected ventricular ectopic beats and 15 false detections were rejected by the selection algorithm. With the present adjustment of the discrimination intervals, however, many normal complexes end up outside the acceptance region. This happens particularly during transient noisy periods and when sudden large deviations of QRS morphology occur m connection with changes of posture. Consequently, 5-10% o;" the total number of detected beats are excluded from the computation of average complexes.

5. EVALUATION OF THE SIGNAL PROCESSING

6. DISCUSSION

The performance of the detection algorithm v, as investigated on 40 exercise ECG records. Twei~ty patients suffering from severe angina pectoris and 20 young men on a 3-year check-up after a previous infarction reached on the average 92 W and ',53 W. respectively, following a 10 W / m i n escalation protocol. Cut of a total number of approximately 1000~ beats, 15 QRS complexes of normal morphology were not detected. There were 15 false detections, of which ,'1 were due to hea,~¢ disturbances in connection with transfers between the couch and the ergometer bicycle. On

This paper describes a computer program for the recording and real-time processing of exercise ECGs applied at the Laboratory of Clinical Physiology, Sahlgren Hospital, Grteborg. It was designed as part of a research project investigating the relationship between coronary artery disease and the ECG [3,12,20]. The purpo~;e of the system is to make measurements on several leads during exercise with high resolution in ampliT,,dz and time. These properties are essential in attempts to estimate the debut and development of different electrophysiological reactions ari.,,ing during ex-

143

ercise. The capacity for extensive real-time processing provides a basis for an enhanced surveillance and a more sophisticated control of the stress test in future applications. The procedures for the operation of the recording system and the generation of graphs and tables after the examination have been adjusted to the requirements of simplicity in the clinical routine as well as flexibility in research applications. In most recording systems representative ECG complexes are computed from 10-20 s records. If the recording periods are scarce, or if computalions can be performed after the stress test has been completed, there is time to form several clusters of complexes. However, in systems recording continuously and generating representative complexes at short time intervals, the limitations in processor speed and available primary memory preclude any methods that require access in real time to earlier recorded,:complexes. The present system generates average" complexes every 10 s in real time. The length of this period was chosen as a compromise between having a high resolution in time of morphological measurements and keeping the arrount of generated data on a manageable level, here typically on the order of 0.7 megabytes/stress test. The detection of QRS complexes, the adjustments of fiducial points, and the calculation of morphology parameters are confined to the same 3 ECG channels. One or more of the 5 remaining channels can therefore freely be utilized to record other signals synchronized with the periodicity of the ECG, or slowly varying in comparison with the 10 s averaging period. The preliminary assessment of the detection, alignment, and selection mechanisms indicates satisfactory performances in the present context. Furthermore, the frequent computation of average complexes makes it possible to detect and discard measurements affected by excessive perturbations of the S - Q segments. The principal function of the software ~tructure is to service several tasks simultaneously active at different priority levels. As the program was written in assembler code and designed to operate in accord with the function of the operating system, it must be considered equivalent to a stand-alone system. The formal structure can probably be de-

veloped further, thus providing a more sophisticated interface between the processing sections on the one hand and the control and service sections on the other. However, the 'oresent form of the program allows new activities to be introduced and modifications to be performed in a simple way, without interference with the overall structure or scheduling of the total operation. Tbi~ is an important property, since future research findings probably will justify real-time estimation of several new variables that have proved to be vital in the supervision and control of the exercise test.

ACKNOWLEDGEMENTS The authors wish to express their gratitude to Robert Magnusson and Arne Carlsten, Heads of the two collaborating departments, for their support of this project. We would also like to thank Holger Broman and Torsten Olsson for valuable comments in the preparation of this manuscript.

REFERENCES

{I] N.J. Fortuin and J.L. Weiss, Exercise stress testing, Ctrculation 56 (1977) 699-712. [2] K. Fox, A. Selwyn and J. Shillingford. Precordial electrocardiographic mapping after exercise in the diagnosIs of coronary artery, disease, Am. J. Cardiol. 43 (I 979) 541-546. [3] J. Ejdeb~ick, J.-E. Angelhed, T.I. Bjur~3, K.-J. Falk, D. Schlossman and E. Warnauskas, Computerized exercise ECG in the diagnosis of critical coronary, lesions, Cardiology (1982) in press. [4] R.E. Mason and I. Likar, A new system of multiple-lead exercise electrecardiography, Am. Heart J. 71 (1966) 190-2O5. [5] G. Blomqvist, The Frank lead exercise electrocardiogram. A quantitative stt, dy based on averaging technioue and digital computer analysis, Acta Med. Scand. 178 suppl. 440 (1965) 5. [6] J.E. Ribei"o, A. Caprihan, A. Gianella Neto, N.G. Wiederehecker and A.F.C. Infantosi, Theoretical analysis of error during signal averaging for detection of His-bundle activity, IEEE Trans. Biomed. Eng. 27 (1980p 473-476. [7] K. Watanabe, V. Bhargavaand V. Froelicl',er, Computer analysis of the exercise ECG: A review, Prog. Card. Diseases 22 (1980) 423-446. [8] L.T. Sheffield, Survey of exercise ECG analysis methods,

1.4.4

in: Trends in Computer-processed Electrocardiograms. eds. J.H. van Bemmel and J.L. ~'iUems. pp. 373-382, (NorthHolIand, Amsterdam, 1977). [9] R.V.H. Vinke, W.A.H, Engelese, T. Hooghout, S. Meij, M.L. Simocas. P. Top arid C. Zeclenberg. Implementation and clinical e~z.luation of computer-assisted analysis of exercise ECGs, in: Computers in Cardiology 1977, eds. H.(;. Ostrow and K.L. Ripley, pp. 345-354 (IEEE Catalog no. 77CH1254-2C, IEEE Computer Societs, 5855 Naples [~laza, Suite 301, Long Beach. CA 90803, 19"/'7). [101 ~.K. Wolf and P.M. RauL:,.mqu, An on-line program for acquisition and analysis c f resting and exerc:,se electrocardiograms, in: Xhh International Symposium on ¢ectorcardiography, Ne~ York. 1970, ed. I. Hoffman. pp. 23 i-236 ~North-t'Iolla ,d, Amsterdam, ~970), [! I] L. Jansson, K. J~Zansson, B, Jonson, L.-G. Olsson, O. Werner and H ~estling. Computer assistan~,e in the ECG laboralorv-A new look. Scand. J. Ciin. Lab. Invest. suppl. 145 (1976) 7-20. [12 ! J.-E. Angelhed. T.I. B]urO and K.-J. Falk, A computerized system for recording, processing, and presentation of exerci~ ECG data. Techn~cal Report 1:78, (Research Laboratory of Medical Electronics, Chalmers University of Technology, Gi~teborg, 1978). [13] V. Bhargava and K. Watanabe, Computer techniques for assessing serial changes in the ECG/VCG response to exercise testing and training, in: Computers in Cardiolog¢ 1979, eds. H.G Ostrow and K.L. Ripley, pp. 335-a'~7 ~IEEE Catalog no. 79CHI462-2C. IEEE Computer Society, 5855 Naples Plaza, Suite 301, Long Bea,:h, CA 90S03. 1979} [I'I] D.M Mirvis, F.V. Keller Jr, J.W. Cox Jr., D.G. Set-

tergren. I~.F. Doxdie, and R.E. ldeker. Left precordial isopotential mapping during supine exercise, Circulation 56 (19771 2,t5-252. [I 5] R. Hinsen, R. yon Hessen, J. Silny, G. Rau, J.D. MeyerErkelenz, W. Merx and S. Effert, EKG-mapping unter Belastung zur Diagnose der koronaren Herzkrankung, Bioreed. Tech. 25 (1980) 285-292. [16] P. Block, J. Tiberghien, I. Raad~helders E. Coussaert, A. Lenaers, R. Bourgain and F. Kornreich, Diagnostic value of surface mapping recordings registered at rest and during exercise, in: Computers in Cardiology 1977, eds. H.G. Ostrow and K.L. Ripley, pp. 89-9:1 (IEEE Catalog no. 77CH1254-2C, IEEE Computer Society, 5855 Naples Plaza, Suite 301, Long Beach, CA 90803, 1977). 117] B.R. Chaitman, M.G. Bourassa, P. Wagniart, F. Corbara and R.J. Ferguson, Improved efficiency of treadmill exercise testing using a multiple lead ECG system and basic hemodynamic exercise response. Circulation 57 ( i 978) 71 78. [I 8] R.E. Mason, I. Likar, R.O. Biern and R.S. Ross, Multiplelead exercise electrocardiography. Experience in 107 normal subjects and 67 patients with angina pectoris, and comparison witF coronary cinearteriography in 84 patients, Circulation 36 (1967) 517. [19] B.P. Phibbs and L.J. Buchles, Comparative yield of ECG leads in multistage stress testing, Am Heart J. 90 (1975) 275. [20] T.I. Bjur6, K.-J. Falk and J.-E. Angelhed, The isopotential plot--A new method for the assessment of ST amplitude changes provoked by an exercise test, European Heart J. 1 (1980) 213-223.