Multitask coronary care unit—a distributed processing approach

Multitask coronary care unit—a distributed processing approach

Journal of Microcomputer Applications (1985) 8, 3 17-332 Multitask coronary care unit-a processing approach distributed V. N. Pande, H. K. Verma an...

1MB Sizes 0 Downloads 35 Views

Journal of Microcomputer Applications (1985) 8, 3 17-332

Multitask coronary care unit-a processing approach

distributed

V. N. Pande, H. K. Verma and P. Mukhopadhyay

Electrical Engineering Department, University of Roorkee, Roorkee-247 667, India Automated analysis of abnormal cardiac rhythms for use in the real time ECG monitoring in intensive coronary care units (ICUs) has gained widespread recognition. As more and more tasks are being assigned to these units, the system’s throughput requirements are increasing. Microprocessors with adequate computational power and intelligence have invaded the ICUs and are finding greater application. To meet the high throughput requirement, it is possible to integrate two or more microprocessors to work in parallel. One such approach as proposed and implemented is reported in this paper. The various tasks as assigned to the ICU are divided into two groups. The more basic task of continuous real time ECG monitoring is entrusted to the master processor of the master-slave configuration. The other jobs are then assigned to the slave. This approach helps to serve better the needs of the unibed coronary care. A major problem to which most researchers in this area have addressed themselves is the high rate of false positives (FPs) and false negatives (FNs) in the detection of QRScomplex of the ECG. Efforts are made here to design an algorithm for detecting QRScomplex with reduced FPs and FNs in the presence of noise and in spite of wide variations in the ECG.

1.

Introduction

Some rhythm changes occurring in the setting of acute myocardial infarction are known to be the harbinger of sudden cardiac death (Thomas, Clark, Mead, Ripley, Spencer & Oliver, 1979). Humans are poorly suited for the task of surveillance of these rhythm changes (Whiteman, Siegel & Breining, 1974). That is why monitoring of electrocardiographic data using automated systems gained widespread acceptance since last three decades or so. Initially these monitors were simple analogue circuits (Lawn, 1968), which still are in use but with increased sophistication (Rehak, 1981; Mason & Shoup, 1979). The era of computer technology changed the whole concept of coronary care and since then the ECG monitors are providing automated health care services with minimum role left for the attending staff to carry out. These developments helped in professional acceptance of automated management systems for the coronary care of the critically ill. However, computer applications envisaged large scale health care centres. Whereas when unibed coronary care units are thought of, these computer based systems become uneconomical. In the beginning of the seventies, microprocessors heralded the second industrial revolution of the twentieth century. The phenomenal growth in its application invaded the medical instrumentation area also. Programmable microprocessor based ECG monitoring and diagnostic units have now become a practical reality. For medium and small scale health care centres the significance of such units is unquestionable. Reid & Kenny (1984) reviewed the requirements of 317 074%7138/85/040317+

16 $03.00/O

0 1985 Academic Press Inc. (London) limited

3 18

V. N. Pande et al.

microprocessor based ICU monitors, which are summarized as (1) the microprocessor should perform ECG analysis in real time, (2) it should take diagnostic decisions following an arrythmia and issue alarms, (3) the monitor should print or record on a strip chart recorder ECG history for off-line analysis and documentation, (4) the system should be acceptable to the nursing staff and (5) it should assist in control and management of life support equipments, such as, pacemakers and defibrillators. Data processing requirements of such a multitask unit are that the various tasks be distributed amongst more than one processor. A distributed, two-processor approach is suggested in the present work, where one of the processors functions as a master and the other one as a slave. The master processor through bus arbitration and I/O protocol communicates with the slave for sharing of the various tasks. Electrocardiographic analysis for monitoring and diagnostic decisions, respiratory rate monitoring and management of the life support devices together forms a major ICU task. However a few more physiological parameters are required to be monitored but not continuously. These measurements can be assigned to the ICU system developed here and would need only minor additions to the hardware and software.

2.

Electrocardiographic

signal processing

Automated analysis of ECG in coronary care includes QRS detection, parameter estimation, feature extraction and diagnostic classification. Use of microprocessors for this purpose requires that the signal processing strategy adopted should be simple and straightforward because of their slow speed, limited memory and computational power. Depending on the purpose of the analysis and the signal quality, a large number of approaches are suggested in the literature. Majority of these approaches follow the logic of pattern recognition. In the present paper the objectives of the analysis of ECG are to perform real time monitoring in ICU and subsequently classify the arrhythmia. 2.1

QRS-complex detection

The first step in the processing of the ECG signal after it has been digitized and inputted to the microprocessor is the detection of QRS-complex. Recognition of the QRScomplex is helped by the characteristic steep up- and down-slopes of its R-component. However, presence of noise hampers the detection. Various analogue and digital techniques are available for QRS detection (Bolton & Coleman, 1983; Rehak, 1981; Thakor, Webster & Tompkins, 1983; Bryden, 1976; Fraden & Neuman, 1980; Holsinger. Kempner & Miller, 1971; Sandman, Hill & Wilcook, 1973). They apply a criterion by which either the amplitude or the slope of the R-wave (positive or negative) is compared against a predetermined threshold. Both these approaches fail in one or the other situation and result in wrong QRS-detection. Comparable noise amplitudes, base line drift, QRS-morphology changes, abrupt changes in R-wave amplitude and such other factors affect the detection process, in consequence the FPs and FNs increase in number. An algorithm is proposed here for QRS-detection. A function, identified as a central difference, is computed for each sample of the incoming signal and compared with the preselected upper and lower thresholds; mathematically. D(i) =

x(i+ 1) - x(i2

1) . . . (1)

Multitask coronary care unit

319

is the detection function, where x(i+ 1) is the (i+ 1)th sample and x(i- 1) is the (i- 1)th sample and O(i) the detection function as computed at the ith sample. Now a QRS-complex is detected if the relation at (1) is positive and

is satisfied, S,,, and SUTHbeing the predetermined lower and upper R-wave slope thresholds respectively. Positivity of the function D(i) and simultaneously satisfying of the relation (2) over five successive samples help to detect the complex even in the presence of noise of large amplitude and comparable slope. The bounds on D(i) i.e. S,,, and &,n when held fixed may not help in detecting the complex, if the R-wave peak amplitude varies drastically during the monitoring. To avoid this the slope thresholds are updated continuously on the basis of the moving average of the peak-to-peak value of the four previously detected QRS-complexes (Pande, Verma & Mukhopadyay, 1985). 2.1

R-peak location

After detecting QRS-complex the next step is to locate a stable fiducial point on the ECG wave which will serve as a time reference for all measurements. This reference point, which in the present work is the peak of the R-wave, is located by checking the occurrence of point of inflection on the R-wave while travelling from positive slope to the negative slope. For checking the point of inflection, the same detecting function, D(i) is used with the consideration that the sign of the function changes from positive to negative at the point of inflection, that is, D(i)= -

x(i+ l)-x(i2

1) . . . (3)

During the search of R-peak, it is likely that the presence of noise spikes on the R-wave up- and down-slope may create false inflection points and thus mislead the search. To overcome this problem, it is seen that the function D(i) remains negative for at least three consecutive samples after changing from positive to negative. The R-wave peak thus located differs from the actual R-peak only by one sampling interval on each side. 2.3

Baseline ident$cation

The baseline is the isopotential reference level on ECG to which all amplitude measurements are referred. In addition, the baseline provides a reference for recognizing the onset and end of the major wave segments (viz. P, and QRS) in the ECG cycle. This is necessary for delineating the wave segments. Baseline is identified as the region of least amplitude fluctuations lying in between the end of the P-wave and onset of the QRScomplex. This is accomplished by scanning the samples on the PQ-segment and computing their average. Identifying PQ-segment as the isopotential line rather than ST or TP segments has some advantage in the fact that this segment gets least affected due to signal distortions during rhythm changes and conduction disorders (Pande et al., 1985). 2.4

Parameter estimation and feature extraction

Parameters of interest in the process of monitoring and rhythm analysis are basically time-correlated intervals and durations on the ECG wave. Measurement of these

320

V. N. Pande et al.

parameters is simply counting the number of equidistant samples that occur between two well defined related points which are already identified. The features that are formed out of these parameters are average R-R interval, deviation from the average, first and second autocorrelation coefficients, patterns of R-R interval change, the ratio of number of P-waves to the number of R-waves per unit time, the proportions and percentages of the normals and such other relevant features needed for the diagnostic classifications. It is evident that the features are extracted by resorting to simple computations, an essential feature for microprocessor applications. 2.5

Arrhythmia classiJication and alarms

Monitoring of ECG for arrhythmia analysis requires well documented rules and a decision model that can be easily implemented on a microprocessor. Out of the various techniques available in the field of decision making, the decision table approach is found to be best suited for a microprocessor based system as (1) decision tables provide a clear and easy to assimilate pictorial representation of the complex diagnostic decision rules, (2) the long list of conditions to describe a symptom profile corresponding to ‘a disease can be easily divided into smaller groups and subsequently linked, (3) the decision process in this concise form is well suited for the implementation on a machine and at the same time can be readily appreciated by a physician, and (4) the clinical decision process is more a logical one than computational. For formulation of diagnostic decision model using decision tables, the most commonly occurring arrhythmias are grouped into three levels of severity. The first level includes catastrophic rhythm changes, the second, premonitory arrhythmias, and the third, the low risk types. In case of the first level group the decision rules are framed using small number of features, which are easily and speedily extracted from the ECG signal. Scanning of limited number of pertinent decision rules helps in reducing the time required to arrive at a decision on the type of arrhythm and subsequent triggering of the alarms. On the other hand the second and third level arrhythmia groups are diagnosed by scanning the decision tables through two stages and confirming the decision through a check of the non-ECG data i.e. the case history of the patient. This three-stage approach to the diagnosis is in principle similar to the one that is followed by physicians. Cardiac patients develop arrhythmias that frequently require the attention of the nursing staff. For indicating to the attending staff the onset of potentially dangerous arrhythmias, audiovisual alarms are provided. Abnormally high and low heart rates, ventricular fabrillation, sinus arrest and 3” AV-block are some of the conditions for which alarm is given. Visual alarms for low risk, intermittent audiovisual alarms for high risk and continuously sounded audio alarms along with visual flashing for potentially fatal arrhythmias, provide desired priority levels for inviting the attention of attending staff. Limits of alarms need to be set from outside by the operator.

3.

Control of life support devices

Coronary care patients suffering from potentially fatal arrhythmias and heart blocks of various degrees require external restorative/therapeutic measures other than the administration of drugs. The control and management of these life support devices using microprocessors in ICU will enhance the utility of this service for the benefit of critical

Multitask coronary care unit ill. In the present work an external pacemaker control and a d.c. cardiovertor task are assigned to the ICU monitor. 3.1

321

control

Restorative temporary external pacing

Heart block of 2” and 3”, atria1 fibrillation and other arrhythmias which are recurrent in nature can be reverted to normal cardiac status if the impaired heart is temporarily excited externally using a pacemaker. The pacemaker delivers periodically at an appropriate instant of the cardiac activity an electric pulse at the desired site on the myocardium. The pulse shape used for clinical efficacy is found to be an exponentially rising wave whose width is adjusted optimally on the basis of physiological safety and clinical efficiency. As the generation of the pace maker pulse is through digital circuits of the microprocessor, its stability is very high. Generation of pacemaker pulse of desired shape, amplitude and width is through retreiving from the memory the desired waveform and outputting it after reconstruction. The pacemaker control strategy has been developed on the following lines. (1) On receipt of service request select the proper mode of operation, (2) the appropriate mode having been selected the next step is to select the electrode configuration, viz. atrial, ventricular or double, (3) serve the respective mode-subroutine, which includes setting of adequate pacing rate, choosing the site of excitation, introduction of appropriate delays and outputting the properly shaped pulses, (4) withdraw the pacemaker service when normality is restored. 3.2

D.c. .cardioversion

In the event of ventricular fibrillation the unfortunate cardiac death may be avoided if an electrical countershock is delivered to the heart within a few minutes of its onset. The microprocessor system developed here executes this therapeutic measure with a minimum interaction from outside. Effective countershock is possible when electrical energy dose is approprioately selected for overcoming the defibrillating threshold. Electrical energy dose is the energy in joules expressed in relation to the patient’s body weight, age and sex. The program for d.c. cardioverter control is developed here to perform the following tasks. (1) Selection of an adequate energy dose from the table stored in the memory, (2) Selection of a voltage-tapcapacitor combination from the defibrillator circuit, (3) Charging of the capacitor to the desired voltage level, (4) Keeping ready the charged capacitor for discharging through the myocardium, in synchronism with the R-wave peak occurrence, and (5) on request from the operator provide measures for repeated shock delivery. These tasks are executed within very short period and thus an effective countershock is expected. The operator can terminate the therapy on positive response from the patient and also in case patient’s heart refuses to respond.

4.

Respiratory

rate monitoring

Cardiopulmonary disorders lead to respiratory rate changes and in turn further interfere with the process of restoration of normality. Monitoring of these respiratory rate changes would hopefully reduce the chances of complicating the already critical state of

322

V. N. Pande et al.

the cardiac patient. Various methods exist for monitoring the respiratory rate in the intensive care unit (ICU). However, the use of these methods becomes restricted because of certain shortcomings of each of them. One such weakness arises due to the difficulties in the application of transducer and another due to the requirement of second channel for data communication. In the present work the respiration rate is extracted by filtering out the respiratory signal from the modulated electrocardiogram. The respiratory cycle modulates the ECG especially as observed in the epicardial leads. For monitoring purposes the lead used is simulated limb lead and as such is analogous to the chest lead. By properly positioning the electrodes on the chest it becomes possible to enhance the modulating effect of the respiratory cycle on the ECG. Respiratory cycle is a very slowly varying physiological phenomenon taking 2-10 s to complete one phase of inspiration and expiration. To filter out such a slowly varying signal the low pass filter to be designed will require a very large capacitor, and the steep roll off desired would make the design complicated. On this background and with the highly developed digital signal processing techniques available it was decided to use a digital filter for this purpose. Using an S-bit microprocessor puts forth several problems in the implementation of a digital filter. One such problem is the representation of all coefficients and samples using 8 bits. This introduces a round-off error and requires that the samples and coefficients be properly scaled. Another problem is in relation to the time delay introduced between the input and the output, due to the large processing time. The said problems are dealt with effectively as described in Appendix.

5.

ECG retrieval

for off-line

processing

The corrective and preventive measures in case of recurrent arrhythmias depend on the knowledge of the conditions which prevailed before the arrhythmia had set in. These conditions can be studied by off-line processing of the ECG records which were stored in the memory loop. On the issuance of alarms and if required the memory loop contents can be outputted on the strip-chart recorder. The loop is designed to store a 15 s ECG history.

6.

Hardware

design

The multitask coronary care unit is built around two microprocessors, working in parallel in distributed-processing mode. The master-slave approach is the best suited configuration. For meeting the high throughput requirements of each of these processors a high speed Z80A CPU is used. The powerful instruction set of 280 enables a highly efficient software design. Figure 1 illustrates the complete hardware. 6.1

Analogue preprocessing circuitry

Acquisition of ECG signal and preprocessing it for improving its signal-to-noise ratio is through an analogue circuit consisting of a preamplifier, a 50Hz notch filter (for rejection of power line inteference) and a low pass filter with 3 dB cut-off at 80 Hz and a roll-off of 40 dB/decade (this ensures a maximally flat response from O-05Hz to 35 Hz). The ECG preamplifier is designed in conformity with the AHA (American Heart

Multitask

nn

coronary care unit

323

324

V. N. Pande et al.

Association) standard. The ECG signal so conditioned is now converted into a digital signal through an ADC, National’s ADC0809, at a sampling frequency of 250 samples/s and with a resolution of 8 bits. 6.2

Master processor

The Z80A CPU with 4 MHz clock and 8-bit word length is interfaced with the local I/O devices through Z8OA PIOs. The timing circuit Z80A-CTC provides the necessary external circuit synchronization signals. The I/O devices are the thumbwheel switches for limit settings of alarms, the seven segment VDU for heart rate display, and flashers and speakers for alarm annunciation. A RAM, Hitachi’s 6116x2, and a ROM, Intel’s 2732x2, are the memories used for data and program storage respectively. The Z80API0 chips also serve as parallel communication link from master processor to the slave. 6.3

Slave processor

Another Z80A serves as the slave processor with the I/O devices being served locally but under the command of the master. A set of relays to control the defibrillator switching, a strip chart recorder for recording of ECG history, a flasher-speaker combine for alarm and seven-segment LEDs for display of respiration rate and a microtip-electrode system for delivering the pacemaker pulse, are the output devices. A set of keys serves as an input device for the operator’s interaction with the system. A ROM and a RAM each of 4 kbyte, Intel’s 2732 and Hitachi’s 6116x2, suffice the memory requirements. 6.4

Master-slave communication

A common (global) memory of 4 kbyte wide (6116x2) is configured to serve as a 15 s buffer for ECG history storage. Figure 2 shows the bus arbitration logic. The tristate address and data bus buffers (74S126s (74LSl26A, 74LS367B), 74LS367s), parallel ports (8212S), address decoders (74LS138s), inverters, logic gates, flip-flops and Schmitt triggers provide the necessary hardware for bus arbitration logic. Bus arbitration is effected on the following lines. (a) The master processor accesses the common memory only for writing data into it. (b) The slave processor accesses the common memory only for reading data from it. (c) When the master is writing into the common memory the slave cannot have access to it. (d) If the ECG history recording (printing) is requested the master releases control over the buses and allows the slave to have the buses allotted to it for memory access. These logical requirements are effectively met through the hardware listed above and appropriate combination of the control signals from the master and the slave.

7.

Hardware software integration

The complete ICU management task is divided into two parts, one part assigned to the master and the other to the slave. Figures 3 and 4.show the flow charts of these two parts of software. A brief description of each follows.

A130 A140 A158

Do-

“7



r

Figure 2.

The master-slave

; X7432

communication:

IIII II II

bus arbitration

(a)

logic.

326

V. N. Pande et al.

I I

I

Initialize I/O ports, timers, counters and variables W Aquire and read ECG samples

I

Store two second record of ECG

1

Compute peak-to-

1

1

Update R-wave slope thresholds I

I

Aquire and read ECG samples

I Store the samples in

I

I

I

Allocate common buses to slave

Compute R-R interval and heart rate compare with limits

I

I

J ~~ Estimate parameters and extract features

I

lb Scan dicision tables

Figure 3.

The flow chart of the master’s program.

Multitask coronary care unit

Q Initialize

I

t

%

Acquire and read ECG samples

I

4

I

I

I/O ports, timers and counters,

Filter out respiratory

signal

I

G Display respiration rate and compare with limits

I

(a)

* Y(k) =a$7w+a,m(k

-1)I+a#k-2)

l--g(b) Figure 4 (a).

The flow chart of the slave’s program. (b) The digital filter subroutine.

328 7.1

V. N. Pande et al. Master’s software

When the power supply is made on the master starts executing its program by entering in the initialization phase (Figure 3). In this phase the I/O ports are appropriately configured, timers and counters are set/reset as required and the variables are initialized. Hereafter the data acquisition phase begins with starting the analogue-to-digital conversion and checking the validity of the acquired digital signal. This check is essential to ensure that the 2 s ECG record which is being stored for peak-to-peak amplitude computation is the valid ECG signal. When validity is established the digitized ECG samples covering the 2 s ECG trace are collected and stored in the RAM. These samples are scanned to find out the peak-to-peak value of the signal. On the basis of this value the slope thresholds for R-wave detection are scaled (initial values of these slope thresholds were computed on the basis of statistical data on ECG) and dynamically controlled during subsequent detection. The slope of the incoming signal for detection of the Rwave is computed by digitally differentiating the signal. Comparing the computed slope with the thresholds identifies the occurrence of R-wave. Before R-wave detection is taken up, the acquired sample is duplicated in the common memory for further use. This duplication is not effected when the printer service is being attended. Positive indentification of the R-wave having been completed the program takes up the R-peak location routine. R-peak location initiates the process of R-R-interval counting and baseline identification. Following this the other parameters are estimated. A set of appropriate features are extracted from these measured parameters and a feature file is created. This file helps in framing the diagnostic decision rules. For taking the requisite diagnostic decision the decision table approach is used. Here each table of diagnostic decisions is scanned to arrive at a decision. The tables are scanned every time a beat is detected and the feature file modified. After a decision is arrived at the master isssues alarms if the arrived decision calls for such action. The digital display of pertinent information completes the processing. These steps are repeated continuously until a service is needed by the patient. 7.2

Slave’s software

Figure 4(a) refers to the flow chart of the slave’s programme. The slave enters into its software at the same instant when master starts executing its program. The initialization phase having been completed the slave starts the ECG-processing for respiration rate monitoring. This is done by digitally filtering [Figure 4(b)] the respiratory signal and then measuring its frequency. If this falls below the set limit or if there is no respiration signal for more than 10 s the system sounds an alarm. The sampling of ECG for digital filtering is at 50 samples/s. In between two samples the extraction of respiratory signal consumers around 6OOus, for the remaining period the slave remains in a loop where it checks continuously the status of different service request flags. If no request flag is found to be set, the slave resumes its task of respiratory rate monitoring. In the event any one of the service request flags is set the processor attends that service and after doing the task returns to the primary task of respiratory rate monitoring.

8.

Summary

Electrocardiographic signal processing for on-line and real time cardiac monitoring of the critically ill using microprocessors is described here. In addition to the basic

Multitask coronary care unit

329

monitoring job this system recognizes the generally encountered arrhythmias and manages the life support devices. The variable nature of the signal and the presence of noise demand a very high standard of performance from the ICU system. This has been achieved by making the software to adapt itself to the signal variability and to be immune to the noise. The first stage in the signal processing is the detection of QRS-complex. Here the criterion for detection is a continuously variable set of relative parameters and the reference is the patients’ electrocardiographic data which makes the recognition of QRS-complex subjective and not objective. The next stage is the R-peak location, a stable reference point on each ECG cycle. As the outcome of the first stage influences that of the second, detecting R-wave positively will establish an accurate fiducial point. Identifying R-wave peak as the reference point assures accuracy and stability. Next in the line is the parameter measurement stage. All the parameters being in the time domain, establishing of a stable time reference means accurate parameter measurement. Accuracy of parameter measurement reflects in the diagnostic classification reliability and in the present work as all measurements are made to a very stable time reference, the diagnostic classification will be highly reliable. Furthermore the diagnostic decision table approach extensively checks up the decision rules logically and follows on the lines of the physicians’ classical approach and hence is more acceptable professionally. The ICU monitor with its ability of continuous and unerring surveillance of the electrocardiogram has to alert the attending staff of any impending cardiac emergency. This is accomplished here by providing a scrupulously triggered audiovisual alarm system. Selectively choosing an audio, visual or audiovisual alarm establishes a three level alarm system which enables the operator to distribute his services judiciously. Automated management of the pacemaker and the defibrillator is a great help to the physician. Also, it eliminates the personal factor of biased judgements, and as such a uniform standard practice in the management of life support services is achieved. The pacemaker therapy in the form of restorative prosthesis, with its wide range of administration can be effectively handled by a microprocessor. Manually preparing for the defibrillation therapy, after detecting the ventricular fibrillation run, may consume much of the previous time and thus may result in an exercise in futility. The microprocessor based automatic defibrillator control proposed here should make this life-saving therapy far more effective. Respiration rate monitoring and ECG history printing are the other jobs assigned to this system which meets its specific medical and functional requirements. The occurrence of minimum false positives and false negatives improves its reliability. Small amounts of adjustments and settings from outside make this unit attractive to the paramedical staff. Wide dynamic range of the monitoring system accommodates all the expected interpatient signal variations. The distributed processing approach in such an application is well suited functionally and economically. More functions may be added to this system with only minor additions in hardware and software.

References Bolton, M. P. & Coleman, J. D. 1983. Detection of QRS-complex in ECG signals and the evaluation of instanteous heart rate. In Changes in Health Care Instrumentation due to

330

V. N. Pande et al.

Microprocessor Technology (F. Pinciroli & J. Anderson,

eds), pp. 249356. Amsterdam: North Holland. Bryden, J. 1976. Automatic monitoring of cardiac arrhythmias. In IEE Medical Electronics Monograph 18-22 (D. W. Hill & B. W. Watson, eds), pp. 27-41. Stevenage. Peter Peregrinus. Fraden, J. & Neuman, M. R. 1980. QRS wave detection. Medical and Biological Engineering and Computing, 18, 125-132.

Holsinger, W. P., Kempner, K. M. & Miller, M. K. 1971. A QRS-preprocessor based on digital differentiation. IEEE Transactions on Biomedical Engineering, BME-18, 2 12-2 17. Lown, B. 1968. Intensive heart care. ScienttJk American, 219, 19-27. Nagle, H. T. & Nelson, V. P. 1981. Digital filter implementation on 16-bit microcomputers. IEEE MICRO, 23-41.

Pande, V. N., Verma, H. K. & Mukhopadhyay, P. 1985. Software detection of ECG baseline and QRS-complex for coronary intensive care. Journal of Microcomputer Applications, 8. Peled, A. & Liu, B. 1976. Digital Signal Processing. Theory Design and Implementation. Rehak, P. H. 1981. Three beat-to-beat cardiotachometer designs. Medical and Biological Engineering and Computing, 19, 75-82.

Reid, J. A. & Kenny, G. N. C. 1984. Data collection in the intensive care unit. Journal of Microcomputer Applications, 7, 257-269.

Sandman, A., Hill, D. W. & Wilcode, A. H. 1973. Analog preprocessor for the measurement by a digital computer of R-R intervals and R-widths. Medical and Biological Engineering and Computing, 11, 191-200. Thakor, N. V., Webster, J. G. & Tompkins, W. J. 1983. Optimal QRS detector. Medical and Biological Engineering and Computing, 21, 343-350.

Thomas, K. L., Clark, K. W., Mead, C. N., Ripley, K. L., Spencer, B. F. & Oliver, G. C. Jr 1979. Automated Cardiac dysrhythmia analysis. Proceedings of the IEEE, 67, 1322-1337. Whiteman, J. R., Siegel, F. A. & Breinig, J. B. 1974. A computer system for continuous real-time monitoring of electrocardiographic arrhythmias. In Computers in Biochemical Research (R. W. Stacy & B. D. Waxman, eds), Vol. 4, pp. 89-144. New York. Academic Press.

Appendix (i)

Filter specifications

Analogue cut-off frequency, f, Stop band edge frequency, f, Minimum attenuation in stop band Amplitude response in pass band Amplitude response in stop band Sampling frequency, F,

0.5 Hz 1.0 Hz 25 dB Maximally flat Maximally flat 50 Hz

(ii) Filter design (a) For the filter of above specification the order of the filter is decided by using the relation (Peled & Liu, 1976) 20 log,,( 1 + Ry)‘/* > 25.0 (Al) where S& is the stopband expression

frequency of the equivalent

a

=

analog filter, which is given by the

tan&P)

5 tan@,/2) where h, and h, are the digital cut-off and stopband edge frequencies respectively which are computed using the relation, (A3) h, = 27~_fZlF, and h, = 2x f,/r’, (A4)

Multitask coronary care unit

331

Now, for the given values off, andf,, h, = 0.0628 and h, = 0.125 and Q, = 2.0. For this value of R,, n=4 :. A Fourth order digital filter of Butterworth design is thus proposed for realization of the said low pass digital filter. (b) The design of the digital filter now takes the course outlined below. Write a transfer function of the fourth order Butterworth analogue low pass filter,

Ha(s)=(s2+0765~+ Using the bilinear transformation, transfer function.

&‘+

1.848s+ 1)

the analogue transfer function is converted into digital

W) where the transformation

is through the relation z-l S=czfl;

c being equal to ot(hJ2) which is 31.836 for the present case. Calculate a,, b, and c,, 4; the resulting fourth order transfer function H(z) is split into two second order functions using

ii H(z)=

(a,,+a,,z-‘+ai*2-~)

I=’

fI

I=1

(A? (1 +a,, z-l+ai4z-J

The splitting of the fourth order structure into two second order structures effected using equation (A7) is on the basis of a cascaded realization. (iii)

Microprocessor implementation

(a) Algorithm. Implementation

processing and output & Nelson, In stage

of the digital filter on microprocessor requires a time efficient algorithm. To save some of the processing time to reduce the delay between the input a strategy is adopted which breaks the total filter processing into two stages (Nagle 1981). One stage is the preprocessing stage and the other the output stage. 1, the algorithm computes the intermediate variable m(k) using the expression m(k) = X(k) - b,m(k - 1) - b,m(k - 2),

(A8)

where X(k) is the current sample, m(k- 1) is the intermediate variable with one time lag, m(k - 2) is the intermediate variable with two time lags, and b,, b, are the filter coefficients of the second order module. Stage II then computes the filtered output using the relation, y(k) = qm(k) + a,m(k - 1) + a,(k - 2)

649)

332

V. N. Pande et al.

where a,, a,, a, are the filter coefficients and m(k)s are the intermediate variables as defined above. This two stage processing saves much of the computation acquisition of the sample and getting its filtered form.

time required in between the

(b) Processing sequence. Referring to figure 4(b), the digital filter processing begins by acquiring the digitized sample of the modulated ECG signal. The next step is to compute y(k) the output sample and output it. A delay equal to one sampling interval is introduced here to produce the desired one time lag and then the preprocessing is taken up. (c) Representation of coeficients. Because of the limited word length and the use of two’s complement representation of numbers, it becomes necessary to store the coefficients which are appropriately scaled. K N. Pande graduated from Nagpur University in the year 1965 and received a Master’s degree in electrical engineering from University of Roorkee, Roorkee, India in 1977. He is working in the Department of Technical Education, Maharashtra State. Presently Shri Pande is on study leave under QIP at University of Roorkee. He has published a few papers on biomedical engineering. His research interests include Microprocessor application in biomedical instrumentation, biological signal processing and biosystems. H. K. Verma is a professor of electrical engineering at University of Roorkee, Roorkee, India. He obtained a BE degree in 1967 from the University of Jodhpur and an ME degree in 1969 and a PhD in 1977, both from University of Roorkee. For two years he worked as R and D manager, Power and Industrial Systems Division, Universal Electrics Ltd, Faridabad. Prof. Vet-ma is actively engaged in research on the application of microprocessors in power system protection and bioelectric signal analysis and measurements. He is a fellow of the Institution of Engineers (India), Institute of Electronics and Telecommunication Engineers and Institution of Instrumentation Scientists and Technologists.