consists of two oneâshot (monostable multivibrator) circuits to determine the pulse width of the clock pulse coming from PC (D6). The first one-shot circuit is used ...
Design and Implementation of PC-Based 12 Lead ECG Acquisition Systems Thamer M.Jamel*, Sabah N. Hussein**, Alaa J. Saed * University of Technology –Department of Electrical and Electronic EngineeringBaghdad –Iraq ** Electrical Techniques College / Baghdad- Iraq.: Keywords: ECG acquisition system, PC based ECG, 12 lead ECG systems. Abstract: This paper is focused in design, and implementation (hardware and software) of a personal computer based ECG processing, and analyzing system that assist the physicians in heart disease diagnosis. Special consideration is given to avoid all known classical ECG instrument problems encountered in previous designs. Moreover, additional developments are made to attenuate power frequency noise and noise that produce from patient's body. The hardware system incorporates with three basic units: transduction and signal-conditioning unit, interfacing unit and processing unit. The software program that is written in Visual Basic performs data acquisition and several tasks such as QRS detection, calculate heart rate, determine the cardiac axis, and calculate the ECG segment intervals that is necessary in heart diseases diagnosis. 1. Introduction The generated biopotentials by the muscles of the heart result in the electrocardiogram (ECG). Diagnostic ECG recording requires a bandwidth of (0.05150Hz). ECG potential levels are very low in voltage, peak amplitudes ranging from (0.01 to 5 mV), so, to detect the ECG signal from the surface of the patient's body, some form of electrode was used. In 12 lead ECG recording, ten electrodes are connected to the patient: Four of them are connected to the patient's limbs and the others are connected to the patient's chest. The ECG recorder compares the detected electrical activity in the different electrodes, and the electrical picture so obtained is called a lead. There are three types of leads: The Bipolar Limb Leads (I, II, and III), The Unipolar Limb Leads (AVR, AVL, and AVF), and the Unipolar chest leads (V1, V2, V3, V4, V5, and v6). The ECG waveform varies from lead to another depending on from which direction a lead looks at the heart. Therefore, each lead conveys a certain amount of unique information that is not available in the other leads. The use of computers for the clinical analysis of the electrocardiogram (ECG) has developed over the span of many years [1]. There are several reasons for this. First, ECG potentials are relatively easy to measure. Second, the ECG is an extremely useful indicator for both screening and diagnosis of cardiac abnormalities. In addition, certain abnormalities of the ECG are quite well defined and can be readily identified. Introducing the ECG into a digital computer requires that analog ECG signals be converted into a digital form. However, before that some attempts must be made to eliminate high frequency variation in the signal that might otherwise be mistaken for features of the ECG. Once inside the computer, the ECG signals can be displayed and analyzed. The block diagram of the general computerized biomedical instrument is shown in Fig.1. The basic components of this system are essentially the same as in any biomedical instrumentation system. The only real difference is in the nature of the signal that must be detected, recorded and analyzed.
1
Data Acquisition Card
Patient
Signal Conditioning Equipment
Electrodes
PC
A/D
Control Circuit
Fig.1 the block diagram of the general PC based biomedical system The main advantage of the proposed system is to assist the physician in performing several approaches, such as automatic 12 lead selections and reading ECG data. This not only results in a substantial saving of time and effort, but also reduces a number of errors in data, reduce the noise produced in a hot stylus was used in classical ECG recording systems, Fast and easy display, storage, and analysis of the biomedical signal. 2. The Hardware Design The biomedical system design arrangement is given which consists of two parts:, Analog part and Digital part as follows:2.1 Analog Part: This part includes the transduction and signal - conditioning unit that consists of electrodes, Wilson resistor network, lead selection unit, instrumentation amplifier, and filters as shown in Fig.2. The transduction unit is used to acquire the input signal (biopotential) ready for conversion to electrical signal. The conditioning unit provides differential inputs, linear amplification, and filtering to obtain acceptable signal to the next unit.
ECG Wilson Resister networ k
Lead Selection Unit
Instrumentat ion Amplifier
Filters
Output
Fig.2 Block diagram of analog part a. Electrodes: Two types of ECG electrodes are used to acquire the ECG signal, first the plate electrode that is used to connect a patient's extremities to the ECG data acquisition system. It consists of a bonding post attached to a 3cmx5cm metallic plate. The plate is attached and held in place against the patient's skin by a rubber strap surrounding the extremity and the second is the suction cup. b. Wilson Resistor Network: A number of equal resistors are used to configure unipolar leads, which were introduced by Wilson [2]. The electrocardiogram is recorded between a single exploratory electrode and the central terminal. This central terminal is obtained by connecting the three active limb electrodes together through resistors of equal size. In the unipolar limb leads (AVR, AVL, and AVF) one of the limb electrodes is used as an exploratory electrode while the other two limbs are used to obtain the central terminal. For the unipolar chest leads (V1 through V6), all three active limb electrodes are used to obtain the
2
central terminal, while a separate chest electrode is used as an exploratory electrode. c. Lead Selection Unit: This unit is used to select one lead from 12-lead at a time to enter instrumentation amplifier. As illustrated previously, the lead potential is measured with respect to a reference (central terminal for unipolar leads and other limb for bipolar limb leads), therefore, two analog multiplexers (CD4067BMS) are used. One of them is used to select one from twelve exploratory electrodes while the other selects one from twelve- lead references. The CD4067BMS is a 16 channel multiplexer with four binary control inputs, A, B, C, and D, and an inhibit input, so digitally controlled via software to form 12-leads. d. Instrumentation Amplifier: The features as High input impedance, high accuracy, low noise, and high common mode rejection ratio (CMRR) make the programmable instrumentation amplifier (AD524) very suitable for use in this data acquisition system. For this system, high common-mode rejection ratio (CMRR) 110db for (gain=100) is very suitable especially when dealing with biomedical signal (ECG has amplitude between (1-5mV)).The first analog part consisting of Wilson resister network, lead selection unit (LSU), and Instrumentation Amplifier is shown in fig.3. e. Filters: The used of filters is essential especially when dealing with naturally very weak of the ECG signal (0.1-0.5mV) which is affected by many types of noise such as 50Hz power line interference, EMG signal interference, and 35Hz when patient suffers from somatic tremor. I. 50HZ Notch Filter Notch filters remove or lessen the 50Hz AC power line interference by attenuating the entire content within a narrow frequency range. Three stages of second order notch filter are used. The notch filter is designed to have quality factor equal to (6.5) and bandwidth equal (7.769Hz). II. 35HZ Notch Filter The 35Hz notch filter is used to remove the interference signals from muscles when patients suffer from somatic tremor, therefore this filter is connected through a switch to the rest of the system. The switch is closed only when patients infected with this disease. The 35Hz notch filter is designed to have bandwidth equal (49Hz) and quality factor equal to (0.864). -5
LA
10k?
+5
24
9
12
I 8 20k?
RA
20k?
20k?
II
10k?
7
III
6
20k?
AVR
5
20k? 20k?
AVL
4
20k? 20k?
IC2
AVF
3
V1
2 23
20k?
OUT
V2
V3 22 V4 21 V5 20 V6
LL 10k?
+12 10k? 8 AB C D -5 24
+5
4 5
12 3
12 AB C D
I II
47k? 1
10
IC4
47k? 2
9
Output Single
6 7
III AVR
+12
AVL
V1 V2 V3 V4 V5 V6
AVF
10k?
V1
10k?
V2
10k?
IC3 OUT
V3
10k?
V4
10k?
V5
10k?
V6
IC1 1 4 10 13 14
RL
2 5 12 9
From Computer
7
+ 5V
Fig. 3.9 A first analog part of the propose system design consists of: 1- Wilson resister network 2- Lead selection unit (LSU) 3- Instrumentation amplifier
IC1=74LS126 IC2, IC3=CD4067 IC4=AD524
Fig.3 the first analog part of the proposed system
3
Passive Filter-- Most informative wave of the ECG lies between 0.05-150 Hz, therefore, the passive filters are used to determine the ECG bandwidth as follows:I. High Pass Filter: A high pass filter (HPF) with cutoff frequency (Fc) equal to (0.05HZ) was used to remove the base line wander. In this work, passive filter is used; this filter attenuates signals below low cutoff frequency. II. Low Pass Filter: The next type of filters is a low pass filter with a cutoff frequency equal to (150Hz) to minimize the high frequency distortion that is generated by muscle activity that falls in a range of (30-2000Hz). f.Gain Amplifier: Gain amplifier is used as a second stage of amplification (gain equal 2.5). The use of such amplifier is very important for ECG data acquisition circuit (DAC). At this stage, the total gain must be calculated by taking into consideration the range of amplitude of ADC, and then the amplitude of signal after amplification must not exceed ±9.5V. On this basis, the total gain of the proposed system is calculated. Table (1) describes the gain in each of system stages and the total gain. Table (1) gain of the proposed system stage Value of gain Instrumentation amplifier 100 Three stages of 50Hznotch filter One stage 35Hz notch filter
1.268*1.719*1.9 23=4.191 1.421
Gain amplifier
2.5
Total gain of proposed system
100*4.191*1.42 1*2.5=1488.85
2.2 Digital Part: It includes the interfacing unit and processing unit. The interfacing unit takes the samples from an analog input signal selected at a time, converts them into a digital output, and feed them to the Pc using printer port. The processing unit is responsible for data acquisition, analysis, and storage of the input data. The block diagram of the digital part is shown in Fig.4. a. Interfacing unit-- In this unit, the biomedical signals (analog) are converted digitally. It consists of sample and hold circuit, analog to digital converter, and various digital components. Analog Input
S/H Circuit
A/D Conver ter
Control circuit
Latch
Buffer
Pc
Fig.4 The block diagram of the digital part I. Sample and Hold Circuit (S/H) -- A circuit called sample and hold (S/H) is used in order to obtain high accuracy A/D conversion. IC type LF398 is used in the design
4
the capacitance value of Ch (hold capacitor) can be determined, which depends on "high state" or sample period of the sampling clock signal, where, sample period must be larger or equal to acquisition time. In this circuit design, the sample period is proposed to equal (12µsec), so if Ch is chosen equal to (0.0068µf), then the acquisition time is (10.5µsec) which is less then 12µsec[5]. II. Analog to Digital Converter (A/D) -- IC AD574 is used as A/D converter for this system design. In this design the bipolar connection for this IC is chosen, because the input signal is of bipolar form (output of the S/H circuit). This IC can be used as 8 or 12 bit A/D converter, depending on its control lines connection "12/8ֿ, A0, R/C־, CE, and CSֿ" [6]. The conversion time for this A/D is (10-17) µsec . III. Latch-- In order to reduce the probability of missing the output data from AD574, the output data are latched using octal latch (74HC374). V. Buffer-- To allow the printer (centronic) port read eight-bit data (the A/D output data), IC type 74LS241 octal buffer must be used. The 74LS241 has eight buffers divided into two groups of four buffers each. The groups can be selected using data selection line (DSL) which is controlled by PC via printer port. Therefore, the eight-bit input data is loaded into a PC in two consecutive readings. IV. Control Circuit-- The control circuit used in the proposed system in this work consists of two one–shot (monostable multivibrator) circuits to determine the pulse width of the clock pulse coming from PC (D6). The first one-shot circuit is used to determine the pulse width needed to initiate the sampling process; the capacitor value used is equal to (7800pf). The second one-shot is used to determine the pulse width needed to initiate the conversion process and then read operation (2µsec) by using capacitor value equal to (2200pf). Fig.5 shows the complete digital part circuit diagram of the proposed system. b. Processing Unit-- The processing unit includes an IBM-PC, based on Pentium 4 µP and equipped with 40 MB hard disk for storage of data and programs, 128 MB RAM, floppy disk, and printer.
+12V -12V
+5V
+5V
+12V -12V 7 1 INPUT 3 4 IC7 SIGNAL 8 7 C15
11 20 D4 21 D5 22 D6 23 D7 24 D8 25 D9 26 D10 27 D11
14 Vin
+5V
OV
1 Vcc 2 12/8 4 A 6 CE
IC8
10Refin 3 Refout 12Bipof R/C
20 3 D0 4 D1 7 D2 8 D3 13 D4 14 D5 17 D6 18 D7
STS CNDCS
IC9
IC10
IC12
R37
1
IC12
11IC11105
1IC112 2
C16
C17
OV
13 12 10 11
R33 R34 R35
10
Ana OV 3 4 GND IC11
5
R32
18 16 14 12 9 7 5 3
OEAOEB
CPCNDOE 11 10 1
9 8 IC11
1
PIN No.
20 2 4 6 A 8 11 13 15 B 17
OV
0=LSB'S(A) 1=MSBs(B)
Ds
7
16
5 OV
OV
R37
CLOCKFORPERIODICSTART
FOR
Ds
6
CENTRONIC BUS
5
2 O0 5 O1 6 O2 9 O3 12 O4 15 O5 16 O6 19 O7
2 3
Fig.5 the complete digital part circuit diagram of the proposed system
5
3.Software Implementation The software was implemented using Visual Basic consists of two parts: main program (data acquisition program), which performs the data acquisition of the biomedical signal, and several algorithms and techniques that perform many tasks as display patient data, display 12 lead ECG signal, calculate heart rate, calculate ECG segment intervals, and the cardiac axis. The idea behind Visual Basic is to allow programmers to take advantage of Basic programming, and at the same time, develop a graphical user interface (GUI) without needing to delve into the complex coding for developing such as with Q Basic. Visual Basic is very fast and easy tool for developing applications with high degree of user friendliness, but it lacks some important functionality's like direct access to hardware (does not have any functions or support to access parallel port directly)[7]. The flowchart of data acquisition program is shown in Fig.6. The main window must be appearing as shown in Fig.7. 4 . Results of The Proposed System The system results that are taken from five cases (people) are given here to demonstrate the system capability achieved in this paper. The 12 signals are recorded for each one and appear as two consecutive six signals. The appearance of each six signals group is depended on pressing the tabs that are appeared in the window bottom. In addition to the appearance of 12 signals of each case, the result of heart rate algorithm can be shown only if the H.R tab is pressed. The value of heart rate (in beat per minute) is appeared in the field besides the tab. This algorithm is applied only to lead I because the heart rate constant in all leads for the same person. The main measured features of the ECG signals of the twelve standard leads are appeared in consecutive values. These features represent the intervals of the PR, QRS complex, and QT waves of the signals, these intervals can be displayed by pressing the tabs PR, QRS, and QT respectively. The intervals are measured in milliseconds. Pressing the CA tab will give the result of the cardiac axis algorithm the result is represented using estimation word.The 'normal' word is appear in the text field beside the CA tab to refer to the normal cardiac axis, 'left' to refer to the left axis deviation, and 'right' to refer to the right axis deviation. Figures 8 and 9 shows the results of the ECG software algorithms of the one case. Figure 10 shows the proposed system laboratory which was implemented in the E&E Engineering department . 5. Conclusions As shown from the result above, these practical results prove the validity of the present work. The ECG signal was acquired, processed and display. The interference in the results is attributed to various types of noise: movement of patient's body during recording, and the noise that produce due to unavailability of resistors that match these calculated (using trimmers). The ECG signals are filtered using several type of active and passive filter; the 50Hz notch filter is designed to suppress the power line interference. Therefore the results that are obtained from people using the proposed system are disappeared the power line interference. But this is not prevent from using the higher order of notch filter in such system. The acquired ECG signals bandwidth is determined using high and low pass filters, these filters are prevent the high frequency noise (EMG signal) from appearance in the recording ECG signals. ECG diagnosis algorithms such as the heart rate algorithm and cardiac axis algorithm depended primarily on the QRS- complex detection and its interval. Therefore, the heart rate algorithm result (in beat per minute) is calculated by count the samples between two consecutive QRS complex in ECG signal (lead I) and multiply the result with sample time, thereafter is divided by sixty to obtain the result in minute. The
6
results of other ECG intervals algorithms (QT and PR algorithm) are accepted for a given heart rate for each person. The cardiac axis algorithm result that is depend on QRS detection algorithm is normal for the case above and this prove the positively of the given result because the person has no infection with left or right axis deviation.
Start
Initialization the data bus equal (10)h
Initialize the counter to (00)h, which it refers to the address of the input lead D
Set the number of samples of each input lead equal to 1500 B
Select the input lead address which equal to the counter number Give a low state to the system clock input to start the conversion, i.e data bus equal (00)h Delay ≈0.333msec
Read the Read the first nibble of the A/D output data (S4-S7) Out 20h on the data bus
Read the second nibble of the A/D output data (S4-S7)
Delay ≈0.333 msec
Sample = sample-1 B
A
No
Is Sample=00
Yes Counter = counter +1 C
No
Is Counter =12
Yes End
Fig.6 The flowchart of Data acquisition program
7
Fig.7 The main window of ECG test program
Fig.8 The first six signals
Fig.9. the second six signals 6. References
Fig.10. The proposed system laboratory
[1] Leslie Cromwell, Fred J. Weibell and Erich A. Pfeiffer, "biomedical instrumentation and measurements ", Prentice-Hall Inc., Englewood nd Cliffs, 2 ed., 1980. [2] Joseph J. Carr and John M. Brown, "Introduction to Biomedical Equipment Technology", John Wiley and Sons. Inc., New York, Chihester, Brisbane, Toronto, Singapore, 1981. [3] Jacob Milliman and Arvin Grabel, "microelectronics", Mc Graw Hill Company limited 1989. [4] www.datasheetcatalog.com/datasheet-pdf/A/D/5/2/AD524.shtml [5] www.national.com/pf/lf/lf398.html [6] www.alldatasheet.com/datasheet-pdf/ df/48078/AD/AD574.html [7] "Parallel port interfacing tutorial" is available in http://www.logix4u.net/
8