Simple ECG and MCG Devices for Biomedical Engineering Students Gregor Geršak1, Samo Beguš2 Univerza v Ljubljani, Fakulteta za elektrotehniko, Tržaška 25, 1000 Ljubljana, Slovenija 1E-pošta: gregor.gersak@fe.uni-lj. si 2E-pošta: samo. begus@fe. uni-lj.si Abstract. The paper presents a simple electrocardiograph (ECG) and a simple magnetocardiograph (MCG) device designed and built for teaching the undergraduate engineering students the basics of the ECG method. The ECG device is composed of two simple copper electrodes (sensors), common computer sound card (data acquisition), audio-recording software and open source real-time spectrum analysing software. Matlab is used for off-line data processing and generation of the heart activity in a spatial domain over the human's chest area. The MCG device consists of two fluxgate magnetometers and uses the ECG signal for digital signal conditioning. The two simple devices prove to be a valuable tool for teaching the students the basics of electromagnetism of the human heart activity, voltage and magnetic measurements, extraneous electromagnetic noise reduction, and filtering and processing of physiological signals. Keywords: Magnetocardiogram, Electrocardiogram, Fluxgate magnetometer, Computer sound card, Human heat magnetic mapping. Preprosti napravi EKG in MKG za študente biomedicinske tehnike V prispevku sta opisani preprosti izvedbi elektrokardiografa (EKG) in magnetokardiografa (MKG). Namen prispevka je prikaz načrtovanja in izdelave orodja za učenje študentov tehniških ved osnov metode EKG. Zgrajeni merilnik EKG je sestavljen iz preprostih bakrenih elektrod (senzor), računalniške zvočne kartice (zajemanje podatkov), brezplačnega programa za obdelavo podatkov in za spektralno analizo signalov v realnem času. Za dodatno procesiranje in generiranje srčne aktivnosti v prostorski domeni je bil uporabljen program, napisan v Matlabu. Poleg EKG smo načrtovali in zgradili tudi preprosti MKG, sestavljen iz dveh Foersterjevih magnetometrov. Obe napravi sta se izkazali kot uporabni orodji za učenje osnov elektromagnetike človeške srčne mišice, merjenja električne napetosti in gostote magnetnega pretoka, za prikaz zmanjševanja elektromagnetnih motenj, filtriranja in obdelave fizioloških signalov za študente tehnike. 1 INTRODUCTION The electrocardiography (ECG) is a measuring method used to detect and record the electric potential generated by the heart electrical activity over a period of time (Figure 1). ECG, dating from the beginning of the twentieth century, is one of the oldest diagnostic tools used in medicine today. With the advances in instrumentation, ECG has become and remained a widely used clinical tool in the field of cardiac abnormalities evaluation, for being highly accurate and easy to interpret. The method is considered a golden standard for measuring the human heart rate (HR). It uses conductive (usually Ag/AgCl) electrodes attached to the human's body in a prescribed standardized fashion. R - R interval <-> Figure 1. Typical parameters of the ECG method - interbeat interval (IBI) or R-R interval, an interval between the QRS complexes of a normal sinus depolarization. Typically, in biomedical engineering laboratory exercises, a 12-lead ECG device is used for the students to learn about the measuring method itself, standardised positioning and attachment of electrodes, etc. In simplified versions a smaller number of leads is used; usually the Lead II ECG method (electrodes on both arms and a leg). The simplest is Lead I ECG method with only two electrodes attached to the human's body. The Lead I ECG method is used in this paper. 1.1 The ECG device Our simple and low-cost contact Lead I ECG recording device is composed of two electrodes and a data-acquisition device. The measurements are made with two identical electrodes connected to a symmetrical input of a personal computer's sound card, as shown in Figure 2. As the sound card has high-impedance (1 MQ) inputs, no preamplifier is needed. The electrodes are made from copper-clad laminate boards with a surface area of 50 cm2 (10 cm x 5 cm) each and an overall thickness of 1.5 mm. A common quality personalcomputer sound card (E-MU 0404 USB by the E-MU Systems) is used as a data acquisition device with a bandwidth of up to 96 kHz and sampling frequency of up to 192 kHz [1]. Figure 2. Schematics of our ECG device (electrodes connected to symmetrical inputs of the right channel of the sound card, the ground terminal is unconnected). Prior to the measurements, the ECG device is evaluated. Evaluation was performed by comparing it ot a commercial ECG monitor (Biopac ECG100C by the Biopac Systems Inc.) (Figure 3.). Signal conditioning and filtering are performed as listed in Table 1. Table 1. Results of a comparison between our ECG device (ecg) and the Lead II ECG device (Biopac). ecg hr / bpm Biopac hr / bpm Error / bpm Max 84.45 84.39 0.14 Min 63.58 63.56 -0.20 St.dev. 3.40 3.40 0.05 > E CS o - 0 -5 -10 ■x. E o -10 0 X (cm) 10 3 Results In order to get reliable measurement results, the humans are in a relaxed state with their heart activity stable. The physiological stability of their heart activity is assessed by calculating HR in beats per minute (bpm). Figure 8 shows some statistics of 25 measurements taken during the experiment. The average value of the differences between the maximal and minimal HR values in each measurement is 17.5 bpm with a standard deviation of 3.2 bpm (n=25). The average HR value in each measurement is 55.9 bpm with a standard deviation of 2.5 bpm. 80 70 Œ .a 60 50 40 S Ü ÏÏ hr min hr max hr # 0 5 10 15 20 25 Measurement Figure 8. Statistics of the HR measurements during our experiment (hr - mean HR, min hr - minimal value and max hr - maximal value of the HR, bpm - beats per minute) Signal processing of the raw physiological signals is made using filtering from Table 2. The R-peaks of the ECG signals are searched using the peak-detection function [10] and their location indices are stored for a further use with the MCG signal averaging. Using the stored indices of the Q-peaks in the ECG signal, averaging the MCG signal is performed by summing a 2-second signal window with a reference to the R-peak of the ECG signal. Figure 9 shows a typical form of the raw and filtered ECG and MCG signals in the time and frequency domain. Figure 7. 25 MCG measurement points marked with an asterisk over the human's chest area. By smoothing the averaged MCG signal it was possible to produce a short video showing the two-dimensional magnetic field over the chest area changing over the time (Figure 10). 1000 S? -1000L 247 247.5 248 248.5 249 249.5 Time (s) p 200 T3