Next Article in Journal
Radio Frequency Database Construction and Modulation Recognition in Wireless Sensor Networks
Next Article in Special Issue
Evaluating the Reliability of a Shape Capturing Process for Transradial Residual Limb Using a Non-Contact Scanner
Previous Article in Journal
Fluorescence Assay for Detecting Four Organophosphorus Pesticides Using Fluorescently Labeled Aptamer
Previous Article in Special Issue
Comparison of Deep Learning Algorithms in Predicting Expert Assessments of Pain Scores during Surgical Operations Using Analgesia Nociception Index
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

ECG Patient Simulator Based on Mathematical Models

by
Mario Alan Quiroz-Juárez
1,*,†,
Juan Alberto Rosales-Juárez
2,†,
Omar Jiménez-Ramírez
2,
Rubén Vázquez-Medina
3 and
José Luis Aragón
1
1
Centro de Física Aplicada y Tecnología Avanzada, Universidad Nacional Autónoma de México, Boulevard Juriquilla 3001, Queretaro 76230, Mexico
2
Instituto Politécnico Nacional, Escuela Superior de Ingeniería Mecánica y Eléctrica, Santa Ana 1000, San Francisco Culhuacán, Mexico City 04430, Mexico
3
Instituto Politécnico Nacional, Centro de Investigación en Ciencia Aplicada y Tecnología Avanzada, Cerro Blanco 141, Colinas del Cimatario, Queretaro 76090, Mexico
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Sensors 2022, 22(15), 5714; https://doi.org/10.3390/s22155714
Submission received: 16 June 2022 / Revised: 25 July 2022 / Accepted: 27 July 2022 / Published: 30 July 2022
(This article belongs to the Collection Biomedical Imaging and Sensing)

Abstract

:
In this work, we propose a versatile, low-cost, and tunable electronic device to generate realistic electrocardiogram (ECG) waveforms, capable of simulating ECG of patients within a wide range of possibilities. A visual analysis of the clinical ECG register provides the cardiologist with vital physiological information to determine the patient’s heart condition. Because of its clinical significance, there is a strong interest in algorithms and medical ECG measuring devices that acquire, preserve, and process ECG recordings with high fidelity. Bearing this in mind, the proposed electronic device is based on four different mathematical models describing macroscopic heartbeat dynamics with ordinary differential equations. Firstly, we produce full 12-lead ECG profiles by implementing a model comprising a network of heterogeneous oscillators. Then, we implement a discretized reaction–diffusion model in our electronic device to reproduce ECG waveforms from various rhythm disorders. Finally, in order to show the versatility and capabilities of our system, we include two additional models, a ring of three coupled oscillators and a model based on a quasiperiodic motion, which can reproduce a wide range of pathological conditions. With this, the proposed device can reproduce around thirty-two cardiac rhythms with the possibility of exploring different parameter values to simulate new arrhythmias with the same hardware. Our system, which is a hybrid analog–digital circuit, generates realistic ECG signals through digital-to-analog converters whose amplitudes and waveforms are controlled through an interactive and friendly graphic interface. Our ECG patient simulator arises as a promising platform for assessing the performance of electrocardiograph equipment and ECG signal processing software in clinical trials. Additionally the produced 12-lead profiles can be tested in patient monitoring systems.

1. Introduction

In the cardiac cycle, the so-called systolic and diastolic phases refer to the state of contraction and relaxation in the heart, respectively. Electrical impulses arising from transmembrane ionic currents governs these phases [1,2,3]. As a consequence of this bioelectrical activity, variations in the skin’s electrical potential are produced, which can be measured with highly sensitive instruments known as electrocardiographs and electrodes placed at predefined points on the skin surface [4,5,6]. The recording of these potential differences is known as an electrocardiogram (ECG) and represents a clinical tool widely used by cardiologists in routine medical evaluations to determine the pathophysiological conditions of the patient [7,8,9,10,11].
Because of the great significance of ECG waveforms in the diagnosis of cardiovascular diseases, there has been a significant amount of research effort for ensuring that medical electrocardiogram measuring devices [12,13] and biomedical signal processing algorithms [14,15,16] acquire, preserve, and process ECG recordings with high fidelity. In this context, the synthetic ECG patient simulators have emerged as useful tools to test, evaluate, and calibrate electrocardiograph equipment and ECG signal processing software [17,18,19,20,21,22,23,24,25]. In fact, ECG simulators have been proposed not only as a worthwhile tool for equipment and algorithm testing but also as a powerful instrument to assist in the teaching of ECG diagnosis. With its help, ECG interpretation skills of undergraduate medical students can be improved, mainly because a low performances of this medical skill has been reported between students, residents, and physicians [26,27]. Of course, ECG misinterpretations can expose the patient to improper prescription and delays in the right treatment [28,29].
Hitherto, unfortunately, ECG simulators do not fulfill all desirable features of a universal simulator because they show shortcomings in amplitudes, waveforms, and time-intervals of the produced signals. Additionally, most ECG simulators need an internal database of sampled healthy and pathological ECG waveforms. The main disadvantage of these implementations is that the variety of ECG waveforms they produce is limited by the device’s storing capability, so they are not a useful tool for a dynamic interpretation of abnormalities in the heart.
In order to overcome these shortcomings, and in light of the importance of mathematical modeling on the understanding of complex biological processes involved in the cardiac conduction system [30,31,32,33,34,35,36], in this work, we propose an ECG patient simulator that implements four different mathematical models to generate realistic ECG waveforms within a broad range of possibilities. Our ECG patient simulator is an electronic device that comprises a hybrid analog–digital circuit formed by 32-bit microcontrollers, digital-to-analog converters (DACs), and general-purpose operational amplifiers (OPAMPs), with the possibility of controlling the amplitudes, waveforms, and parameters of the mathematical models through an interactive and friendly graphic interface. Additionally, the used mathematical models in our electronic device have the advantage of allowing us to explore different parameter conditions to simulate new arrhythmias with the same hardware.
To mimic clinical 12-lead ECG waveforms, we implement an extended heterogeneous oscillator model of the cardiac conduction system [37], whose heart rate can be driven via software. We also implement a discretized reaction–diffusion model [38], a ring of three coupled oscillators [39], and a model based on quasiperiodic motions [40] for reproducing ECG with a great variety of rhythm disorders. Given this, we consider that our electronic device is a useful tool for research, medical education, and clinical testing purposes. In particular, the proposed simulator can be used to assess the performance of electrocardiograph equipment and ECG signal processing software in clinical trials.

2. Materials and Methods

As already mentioned, most ECG patient simulators use, as a core generator, an internal database comprising sampled healthy and pathological ECG waveforms, which are then analogically played back by a digital-to-analog converter. To avoid this, we implement four different models describing macroscopic heartbeat dynamics with a set of ordinary differential equations, all of them capable of reproducing synthetic ECG waveforms under normal and pathological conditions. In what follows, we briefly review each of the models implemented in the proposed ECG patient simulator.

2.1. The Models

2.1.1. Heterogeneous Nonlinear Oscillators

A general and useful model to reproduce full 12-lead ECG waveforms is the extended heterogeneous oscillator model of the cardiac conduction system [37]. The first version of this model was proposed by [41], and later, it was applied to simulate the appearance of ventricular fibrillation as an instance of chaos [42]. The model consists of main natural pacemakers represented by modified Van der Pol oscillators [43,44,45], and electrical response of atrial and ventricular muscles (depolarization and repolarization processes) modeled by modified FitzHugh–Nagumo equations [46,47,48].
Natural pacemakers, namely, sinoatrial (SA) node, atrioventricular (AV) node, and His–Purkinje (HP) system, are given by the following sets of ordinary differential equations:
x ˙ i = y i , y ˙ i = a i x i 2 u y i f i x i ( x i + d ) ( x i + e i ) + K n o d e y i 1 τ n o d e y i ,
where x i stand for action potentials, i = 1 , 2 , 3 corresponds to SA, AV and HP nodes, respectively. K n o d e denotes the particular coupling constant for each pacemaker, y i τ node = y i ( t τ n o d e ) are the time-delayed coupling components, and τ node is the corresponding coupling time delay. The terms a i , f i , u, d, and e i are the parameters of each oscillator.
The description of the electrical responses of AT and VN muscles are described by:
z ˙ j = k j c j z j z j w j 1 z j w j 2 b j v j g j v j z j + I j , v ˙ j = k j h j z j v j ,
with j = 1 , , 4 , which refers to the P-wave, Ta-wave, QRS complex, and T-wave, respectively.
The magnitude of the stimulation current that couples the SA and HP pacemaker to AT and VN muscles are, respectively, I j = C j Y j H ( Y j ) , where C j are the corresponding coupling coefficients, H ( Y ) is the step function, and Y 1 = y 1 , Y 2 = y 1 , Y 3 = y 3 , and Y 4 = y 3 from (1). The parameters k j , c j , w j 1 , w j 2 , b j , h j , and g j control the rest state, the excitability, the duration of the action potential, the excitation threshold, and the excited state of each oscillator.
The net E C G ( t ) waveform is calculated as a composition of muscle electrical responses in the following way:
E C G ( t ) = z 0 + α 1 z 1 α 2 z 2 + α 3 z 3 + α 4 z 4 ,
where z 0 is the baseline value of E C G ( t ) , and α 1 α 4 are the weighting coefficients for each lead, which are given in [37].
It is worth saying that this model can reproduce several well-known rhythm disorders, such as tachycardia, bradycardia, complete SA–AV block, and AV–HP block, by implementing the parameter values reported in [41].

2.1.2. Reaction–Diffusion Model Spatially Discretized

Recently, a model based on a discretized reaction–diffusion system to reproduce electrocardiograms from healthy hearts and various rhythm disorders was introduced [38]. Since the model presents chaotic behavior, it was associated with ventricular fibrillation, which arises from a normal rhythm through the so-called Ruelle–Takens–Newhouse scenario [49], as experimental studies suggest [50,51].
The model comprises a set of three nonlinear oscillators obtained from the spatial discretization of the BVAM model [52], whose variables simulate the main pacemakers in the heart. The model consists of the following ordinary differential equations:
x ˙ 1 = x 1 x 2 C x 1 x 2 x 1 x 2 2 , x ˙ 2 = H x 1 3 x 2 + C x 1 x 2 + x 1 x 2 2 + β ( x 4 x 2 ) , x ˙ 3 = x 3 x 4 C x 3 x 4 x 3 x 4 2 , x ˙ 4 = H x 3 3 x 4 + C x 3 x 4 + x 3 x 4 2 + 2 β ( x 2 x 4 ) .
Here, H and C are parameters controlling the network’s dynamical behavior, and β is the local interaction between oscillators. ECG waveforms can be generated by a linear mixing of the variables x i , as follows:
E C G t = K 1 x 1 + K 2 x 2 + K 3 x 3 + K 4 x 4 .
Sinus rhythm, sinus/ventricular tachycardia, atrial/ventricular flutter, and ventricular fibrillation can be reproduced by varying the parameters H, C, and K i as described in [38].

2.1.3. Ring of Three-Coupled Oscillators

A relatively old idea was to consider the heart as a system of nonlinear coupled oscillators. One of the pioneering studies was developed by Van der Pol (VdP) and Van der Mark (VdM) [53]. In [39], a model is proposed consisting of three modified VdP oscillators [43,44,45] that represent the main pacemakers in the heart. This model consists of six ordinary differential equations coupled with time delays:
x 1 ˙ = x 2 , x 2 ˙ = a S A x 2 x 1 w S A 1 x 1 w S A 2 + ρ S A sin ω S A t x 1 x 1 d S A x 1 e S A k S A A V x 1 x 3 τ S A A V k S A H P x 1 x 5 τ S A H P , x 3 ˙ = x 4 , x 4 ˙ = a A V x 4 x 3 w A V 1 x 3 w A V 2 + ρ A V sin ω A V t x 3 x 3 d A V x 3 e A V k A V S A x 3 x 1 τ A V S A k A V H P x 3 x 5 τ A V H P , x 5 ˙ = x 6 , x 6 ˙ = a H P x 6 x 5 w H P 1 x 5 w H P 2 + ρ H P sin ω H P t x 5 x 5 d H P x 5 e H P k H P S A x 5 x 1 τ H P S A k H P A V x 5 x 3 τ H P A V .
The terms a n o d e , w n o d e i , d n o d e , and e n o d e are the parameters of each oscillator, where the index i = 1 , 2 and n o d e corresponds to S A , A V , and H P nodes. k S A A V , k S A H P , k A V S A , k A V H P , k H P S A , and k H P A V denote the particular coupling constant for each pacemaker. The transport delay terms are given by τ S A A V , τ S A H P , τ A V S A , τ A V H P , τ H P S A , and τ H P A V . The amplitudes and frequencies of the periodic driving terms are ρ S A , ρ A V , ρ H P and ω S A , ω A V , ω H P , respectively.
The ECG waveforms are obtained from a linear combination of the variables:
E C G ( t ) = α 0 + α 1 x 1 + α 3 x 3 + α 5 x 5 β G ,
where β G is a scaling factor
The parameter values used as reference for reproducing sinus rhythm, ventricular flutter, bradycardia and ventricular fibrillation are suggested in [39].

2.1.4. Extended Dynamical Model Based on a Quasi-Periodic Motion

Sayadi et al. [40] developed a Gaussian wave-based state-space to reproduce the temporal dynamics of the ECG waveform, based on a modification of the model proposed in [54]. They showed that their model may be effectively used for generating synthetic ECG waveforms, as well as characteristic waves, such as the atrial and ventricular complexes, i.e., P, QRS, and T.
Assuming the presence of three distinct characteristic waves corresponding to the P wave, Q R S complex, and T wave, the ECG waveform is divided into three coupled components, each related to a specific portion of the heart cycle. The proposed mathematical model is:
x ˙ = α x ω y , y ˙ = α y ω x , P ˙ = i P , P + a i Δ θ i e Δ θ i 2 2 b i 2 P P 0 , C ˙ = i Q , R , S a i Δ θ i e Δ θ i 2 2 b i 2 C C 0 , T ˙ = i T , T + a i Δ θ i e Δ θ i 2 2 b i 2 T T 0 ,
where a i , b i and θ i are the parameters of the Gaussian kernels for each characteristic waveform. P, C, and T represent the P-wave, the QRS complex, and the T-wave, respectively, and the + / superscripts in P and T denote the two Gaussian waves used to handle asymmetries. P 0 , C 0 , and T 0 are the baseline values, which are assumed to be coupled to the respiratory frequency f r , using:
P 0 ( t ) = C 0 ( t ) = T 0 ( t ) = A sin 2 π f r t ,
The model has seven events ( P , P + , Q, R, S, T , T + ), that act as push–pulls in the z-direction as the corresponding trajectory passes around the unit limit cycle in the ( x , y ) plane. To simulate the quasi-periodicity of the cardiac cycle, the time dependent angular frequency of motion around the limit cycle is obtained by applying the same spectral estimation strategy as in [54], where, in that reference, a i were replaced by a i = α i b i 2 . Finally, the synthetic ECG is obtained as follows:
E C G ( t ) = P ( t ) + C ( t ) + T ( t ) .
Since the model (8) has a large number of free parameters, it is possible to control the morphological features of the synthetic ECG as described in [40]. This feature allows abnormal morphological changes and several pathological conditions.
In what follows, the main components of the proposed ECG patient simulator are described, that is, the electronic circuits (hardware) and the main algorithms used to solve the mathematical models and display results (software).

2.2. Hardware

The proposed electronic circuit of the ECG patient simulator is shown in Figure 1. The hardware comprises two 32-bit microcontrollers (MCU), manufactured by ST Electronics with series STM32F401CCU6 and STM32F103C8T6; digital-to-analog converters (DAC) MCP4921; general-purpose operational amplifiers (OPAMP) LF353; and a Wye resistor network.
The STM32F401CCU6 is a low-cost, high-performance microcontroller of the family ARM Cortex-M4 Cores, which operates at 84 MHz and includes standard communication peripherals, such as SPI, I2C, USB, USART, and CAN. It also incorporates a single-precision floating-point unit, useful for performing calculations in short timing, a set of digital signal processing instructions, and two analog-to-digital converters. This microcontroller is the central core of the proposed ECG patient simulator, responsible for numerically solving, in real-time, the mathematical models and for interfacing via SPI protocol with nine 12-bit DACs, as shown in Figure 1a. These DACS are used to produce a full 12-lead ECG profile, i.e., precordial leads and bipolar and augmented limb leads. We configure the DACs to operate with an external voltage reference and a clock frequency up to 20 MHz provided by the MCU. A stabilized DC power supply provides the required external voltage reference ( + 5 V) to the DACs.
Our ECG patient simulator implements a 320 × 240-pixel color TFT LCD touch screen, which provides a friendly graphical user interface (GUI) to select mathematical models, cardiac rhythms, and parameters. By using a microcontroller STMF103C8T6 operating at 72MHz and belonging to the ARM Cortex-M3 Core family, we can control the pixels on the LCD screen and scan messages from the touch screen through a parallel bus and two resistive terminals, respectively (see Figure 1b). Information scanned from the TFT touch screen by the slave MCU (STMF103C8T6) is sent to the master MCU (STM32F401CCU6) via SPI protocol. These data allow us to specify the mathematical model and cardiac rhythm that will be solved numerically in the master MCU. The output ECG waveforms are converted to a quasi-analog signal by using DACs. Since the DAC operates voltages on the order of millivolts, the internal noise may adversely affect its performance. To aleviate this, we first include a bypass capacitor to minimize the effect of noise sources on signal integrity, and second, we generate ECG waveforms with amplitudes ten times greater than real ECG amplitudes, including offset levels that simulate baselines. In addition, to simulate ECG waveforms with physiologically consistent amplitudes, the output signals of the converters are passed through a non-inverting amplifier stage, encompassing general-purpose operational amplifiers and resistors (R 1 , R 2 , R g , and R f ) for producing a differential output signal, as described in Figure 1c. This amplifier provides low offset voltage and low noise. With this design, we can produce ECG waveforms within the range of 0.5 mV to 4 mV with low noise and minimum offset effects.
While the discretized reaction–diffusion model [38], the ring of three coupled oscillators [39], and the model based on a quasiperiodic motion [40] can reproduce only standard Einthoven lead II, the network of heterogeneous oscillators [37] can produce a realistic 12-lead ECG profile. Typically, cardiologists place six electrodes on the patient’s chest and four on the limbs to obtain a 12-lead electrocardiogram, including three bipolar limb leads (Lead I, I I , and I I I ), three augmented limb leads ( a V L , a V F , and a V R ), and six precordial leads (V1–V6) ([3], Chapter 12).
The electrodes placed on the right arm ( R A ), left arm ( L A ), and left leg ( L L ) form an equilateral triangle known as Einthoven’s triangle and give place to the bipolar limb leads. The three bipolar limb leads in Einthoven’s triangle, denoted by I , I I and I I I , can be obtained by Equation (11) and satisfy the relationship I I = I + I I I :
I = L A R A , I I = L L R A , I I I = L L L A .
The augmented limb leads and precordial leads are the electrical potential differences between physical and virtual electrodes [55]. For the augmented limb leads a V F , a V L , and a V R , the physical electrodes correspond to R A , L A , and L L , and the virtual electrode is the so-called Goldberger’s central terminal, whose potential is the mean voltage of two limb electrodes that remain when an electrode is selected. In this way, augmented limb leads can be written as functions of the physical electrodes R A , L A , and L L as follows:
a V R = R A 1 2 ( L A + L L ) , a V L = L A 1 2 ( R A + L L ) , a V F = L L 1 2 ( R A + L A ) .
Typically, patient monitoring systems, such as electrocardiographs, derive the bipolar and augmented limb leads from the limb electrodes. In this regard, our ECG patient simulator solely generates these three ground-referenced electrical potentials to obtain the six first leads: I, I I , I I I , a V L , a V R , and a V F . As shown in Figure 1d, we implement a Wye resistor network to satisfy Equations (11) and (12). The voltages of each terminal in the Wye connection are supplied by three DACs with series MCP4921.
Precordial leads, labeled by V1, V2,…,V6, are unipolar potentials referenced to a common electrode known as the Wilson central terminal. This terminal is a theoretical point computed by the mean voltage of the limb electrodes. By Kirchhoff’s laws, the sum of the electrical potentials in the limb electrodes is zero. So, the Wilson terminal works as the reference point for the six electrodes placed on the chest. In our electronic device, the Wilson center was set to zero, allowing us to directly reproduce the precordial leads by using ground-referenced DACs.
The described ECG patient simulator cannot only generate a full 12lLead profile by numerically integrating the extended heterogeneous oscillator model of the cardiac conduction system but it can also produce a single lead, specifically the standard Einthoven lead II. The user can select the mathematical model in order to specify the arrhythmia through the TFT touch LCD display.

2.3. Software

The algorithms embedded in the STM32F401CCU6 and STM32F103C8T6 microcontrollers are described in what follows. Figure 2i shows the flowchart for both microcontrollers. For an easy configuration of the STM32F401CCU6 and STM32F103C8T6 microcontrollers, we use STM32 Cube MX and STM32 Cube IDE as integrated development environments (IDE). Both of them include a graphical tool that allows setting peripherals, clock, and general-purpose inputs/outputs.
The STM32F103C8T6 manages the user interface (shown in Figure 2ii) in the TFT LCD Screen via an 8-bit parallel protocol and reads the LCD’s resistive touch panel using two analog-to-digital channels. This MCU generates a configuration word from the data introduced by users through the GUI shown in Figure 2ii, whose screens are related to: (a) model selection, (b) arrhythmia selection, and (e) parameter settings. It should be noted that we have preloaded the parameter values for each rhythm so that the user does not have to introduce parameters one by one. This allows them to easily choose a particular ECG waveform through the graphic interface (model selection and arrhythmia selection menus). However, the proposed system can be set by individually changing the parameter values to explore different conditions through the parameter settings menu. The graphical interface also includes some controls to play or pause the generation of ECG waveforms, as displayed in Figure 2ii(c,d). To interface with the LCD display, bits A8–A15 from port A and bits B3–B5 and B12–B15 from port B are configured as push–pull outputs at maximum speed. The STM32F401CCU6 and STM32F103C8T6 microcontrollers communicate with each other via the SPI peripheral. Here, the STM32F401CCU6 microcontroller is a slave transmitter, whose bits A7, A5, and B4 from port A and port B are reserved for MOSI, SCK, and MISO signals, respectively. While Channels IN0 and IN1 from analog-to-digital converter 1 are configured to read V x and V y from the touch interface, bit A6 from port A is set as a push–pull output at maximum speed for the play/pause instruction.
The STM32F401CCU6 microcontroller receives and initializes the user-defined model parameters, which are encoded in the configuration bits provided by the STM32F103C8T6 microcontroller. From this information, STM32F401CCU6 solves the selected mathematical model through the fourth-order Runge–Kutta (RK4) method. We have included the numerical method within a looping function, which checks, in each iteration, the state of the play/pause bit coming from the STM32F103C8T6 microcontroller. The integration step used for solving each model is obtained by measuring the computing time of one iteration plus the time that the MCU takes to send data to the DAC via the SPI peripheral. It is important to say that two of the four models integrated into the ECG patient simulator include time delays in the coupling, which requires solving a set of delayed differential equations. To overcome this issue, we create an array that buffers a certain number of samples from the delayed signal. The amount of samples depends on the ratio of the transport delay terms and the integration step.
Finally, to individually control each MCP4921 DAC’s, Bits A8–A15 from port A and bits B12–B15 from port B are configured as chip select and bit A6 as the latch. The STM32F401CCU6 microcontroller implements an SPI1 peripheral that works as a half-duplex master at 18 MBits/s. To do this, the APB2 Bus is set to 36 MHz, reserving bits A7, A5, and B4 from A and B ports for the MOSI, SCK, and MISO signals, respectively. Bit A8 from port A is configured as an input for the play/pause instruction.

3. Results

The microcontroller and passive electronic components were mounted on a two-layered printed circuit board (PCB) to avoid faulty contacts and poor stability. The whole PCB was designed in EasyEDA Software. The ECG patient simulator implemented in the PCB is presented in Figure 3i. The microcontrollers that manage the communication protocol with the TFT LCD touch screen (red square) and the generation of ECG waveforms are indicated with cyan and gray squares, respectively. The green and orange squares indicate the digital-to-analog conversion stage and the output amplifiers, respectively. In the same Figure, the synthetic ECG waveforms are provided through the connector marked with a purple square. Figure 3ii shows the whole electronic circuit, i.e., the core for the generation of ECG signals and the TFT LCD touch screen.
Normal synthetic ECG signals generated by the proposed ECG patient simulator are presented in Figure 3iii. Table 1 shows the parameter values for reproduce these cardiac rhythms. We obtain a full 12-lead ECG profile by integrating the heterogeneous oscillator model of the cardiac conduction system as shown in Figure 3iii(a). An ECG waveform (standard Einthoven lead II) generated with the discretized BVAM model is shown in Figure 3iii(b). The normal ECG waveforms produced by the model based on a ring of three coupled oscillators and the model based on a quasiperiodic motion are shown in Figure 3iii(c,d), respectively. Notably, the ECG signals presented in Figure 3iii(b,d) exhibit the characteristic peaks and troughs of the ECG waveform, i.e., the P wave, QRS complex, and T wave. These events are associated with the successive atrial depolarization/repolarization and ventricular depolarization/repolarization, which occurs with every heartbeat. It should be said that the discretized reaction–diffusion model and the ring of three coupled oscillators can only reproduce general features of the normal ECG, though they are capable of generating different arrhythmias effectively. On the contrary, the network of heterogeneous oscillators and the model based on a quasiperiodic motion incorporate substantial details in the simulated signals that lead to realistic ECG waveforms, but the complexity of the models increases.
Since the network of heterogeneous oscillators is the sole model that reproduces a full 12-lead ECG profile, we assess it in a commercial electrocardiograph, which is a monitoring device consisting of an interpretive 12-channel electrocardiogram machine, with series CardioCare 2000. The monitoring equipment recognizes the synthetic ECG signals effectively, as shown in Figure 4.

3.1. Rhythm Disorders

In what follows, we show different arrhythmia that the proposed system can reproduce. We would like to emphasize that in most models, the parameter values for the arrhythmias are the same as for the normal state. So, in the subsequent sections, we will only specify those parameters that change.

3.1.1. Network of Heterogeneous Oscillators

To validate the proposed ECG simulator, we first reproduce two well-known rhythm disorders, complete SA–AV and AV–HP blocks, by integrating the heterogeneous oscillator model of the cardiac conduction system (3). The results are shown in Figure 5. A complete SA–AV block indicates the loss of communication between the SA node and the AV node. Here, the SA node cannot control the heart rate, leading to a lack of coordination of the depolarization/repolarization processes in the atria and ventricles. We reproduced the complete SA–AV block by setting the coupling constant K S A A V = 0 . In contrast, for the complete AV–HP block ( K A V H P = 0 ), the HP complex acts independently at its own rate and the SA and AV nodes operate coupled at a normal rhythm. Consequently, atria work normally, and ventricles take action at a slow rate.

3.1.2. Reaction–Diffusion Model Spatially Discretized

Figure 6 shows four arrhythmias generated by the discretized reaction–diffusion model: (a) sinus tachycardia, (b) atrial flutter, (c) ventricular tachycardia, and (d) ventricular flutter. The corresponding parameter values are presented in Table 2. Sinus tachycardia is a cardiac rhythm characterized by a faster-than-usual heartbeat. Similarly, atrial flutter refers to a condition in which the upper chambers beat too quickly. However, the former condition is generally not dangerous, but the second one produces insufficient blood pumping, which can lead to heart failure [56,57]. Lethal cardiac arrhythmias frequently result from reentry mechanisms; specifically, ventricular tachycardia and ventricular flutter are re-entrant ventricular tachyarrhythmias that can progress to ventricular fibrillation. Ventricular tachycardia occurs when the lower chamber of the heart (ventricles) beats faster than 120 beats/min, whereas ventricular flutter is a rapid organized rhythm, between 250 and 300 beats/min, characterized by a sine wave pattern on the electrocardiogram without any identifiable QRS complexes or T waves [58,59].

3.1.3. Ring of Three-Coupled Oscillators

By integrating the model (6) in the proposed device, we reproduce three pathological rhythms: sinus bradycardia, atrial flutter, and ventricular fibrillation, which are shown in Figure 7. Sinus bradycardia is a common heart rhythm defined by a slow, regular heartbeat of fewer than 60 beats/min [56]. In contrast, ventricular fibrillation is a severe and totally disorganized rhythm that leads to death if no immediate medical attention is provided [59]. Interestingly, ventricular fibrillation has been associated with chaotic behavior; this fact has motivated the investigation and development of new devices to control it. In this context, ECG simulators have provided a significant tool to design and test these devices [60,61,62]. The parameter values corresponding to the three pathologies are shown in Table 3.

3.1.4. Extended Dynamical Model Based on a Quasi-Periodic Motion

In Figure 8, arrhythmias generated with the extended dynamical model based on a quasi-periodic motion are shown. These include sinus bradycardia, sinus tachycardia, ventricular flutter, atrial fibrillation, and ventricular tachycardia. The corresponding parameter values are presented in Table 4. As mentioned above, sinus bradycardia and sinus tachycardia are not serious arrhythmias, in fact, they often do not require treatment. However, there are abnormalities of cardiac rhythm that are potentially dangerous. For example, atrial fibrillation causes irregular heartbeats that begin in the upper chambers and can produce blood clots, limiting the ability to pump blood into the body.
We would like to stress that the proposed ECG simulator can generate a wide range of pathological conditions, so it provides a promising platform not only to train arrhythmia classifiers and detectors [63,64] but also to assess ECG signal processing software. Signal denoising is a remarkable example where synthetic waveforms can help attenuate the noise of real ECG signals by providing a reference profile to wave detector [65].

4. Discussion

In the last years, synthetic ECG patient simulators have been developed to test, calibrate, and assess electrocardiograph equipment and ECG waveform processing software. Most of these simulators have shortcomings in the amplitudes, range, waveforms, and time-intervals of the produced signals. To overcome these shortcomings, and in light of the importance of mathematical modeling for the understanding of complex biological processes involved in the cardiac conduction system, we introduced a versatile, low-cost, and tunable electronic device implementing an ECG patient simulator based on four mathematical models to generate realistic ECG waveforms within a broad range of possibilities. It is worth mentioning that the ECG profiles generated by the models incorporated in our ECG patient simulator were already compared with clinical registers in the corresponding works where they were published. In particular, the network of heterogeneous oscillators and the model based on a quasiperiodic motion incorporate substantial details in the simulated ECG signals that lead to realistic waveforms. Furthermore, the discretized reaction–diffusion model and the ring of three coupled oscillators can generate different arrhythmias effectively by changing a few parameters. One of the most significant features of our ECG patient simulator is the possibility of controlling parameters of the mathematical models through an interactive and friendly graphic interface. In addition, the proposed ECG patient simulator is able to produce a full 12-lead ECG profile, which can be tested in patient monitoring systems. We are certain that our proposal constitutes a promising platform for testing medical equipment and biological signal processing algorithms, as well as a powerful tool for medical education and academic research. The proposed system can be considered as an alternative to calibrate, test, and certify ECG devices in order to confirm the level of confidence in the manufacturers’ specifications. Future research directions could be the training and evaluation of automated diagnosis systems and the development of a cardiac defibrillator to control, in an efficient way, irregular and chaotic heartbeats associated with ventricular fibrillation.

Author Contributions

Conceptualization, J.L.A., R.V.-M. and M.A.Q.-J.; methodology, M.A.Q.-J. and J.A.R.-J.; software, M.A.Q.-J. and J.A.R.-J.; validation, all authors; formal analysis, all authors; investigation, all authors; resources, all authors; data curation, M.A.Q.-J. and J.A.R.-J.; writing—original draft preparation, M.A.Q.-J. and J.A.R.-J.; writing—review and editing, all authors; visualization, M.A.Q.-J. and J.A.R.-J.; supervision, J.L.A. and R.V.-M.; project administration, M.A.Q.-J.; funding acquisition, J.L.A., R.V.-M. and O.J.-R. All authors have read and agreed to the published version of the manuscript.

Funding

M.A.Q.-J., O.J.-R., R.V.-M. and J.L.A. were supported by CONACYT through grant A1-S-8317. R.V.-M. and O.J.-R. thank the financial support from Instituto Politécnico Nacional (IPN-México), through grants SIP-IPN 20220531 and SIP-IPN 20220572, respectively.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data underlying the results presented in this paper are not publicly available at this time but may be obtained from the authors upon reasonable request.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ECGElectrocardiogram
RK4Fourth-order Runge-Kutta
DACDigital-to-analog converter
OPAMPOperational amplifier
SASinoatrial
AVAtrioventricular
HPHis–Purkinje
BVAMBarrio–Varea–Aragon–Maini
VdPVan der Pol
VdMVan der Mark
MCUMicrocontrollers
GUIGraphical user interface
USBUniversal serial bus
SPISerial peripheral interface
I2CInter-integrated circuit
USARTUniversal synchronous and asynchronous serial receiver and transmitter
CANController area network
TFT LCDThin-film-transistor liquid-crystal display
DCDirect current
SCKSerial clock
MOSIMaster out slave in
MISOMaster in slave out
PCBPrinted circuit board

References

  1. Beuter, A.; Glass, L.; Mackey, M.C.; Titcombe, M.S. Nonlinear Dynamics in Physiology and Medicine; Springer: New York, NY, USA, 2003. [Google Scholar]
  2. Ottesen, J.T.; Olufsen, M.S.; Larsen, J.K. Applied Mathematical Models in Human Physiology; SIAM: Philadelphia, PA, USA, 2004. [Google Scholar]
  3. Keener, J.P.; Sneyd, J. Mathematical Physiology. II: Systems Physiology; Springer: New York, NY, USA, 2008. [Google Scholar]
  4. Francis, J. ECG monitoring leads and special leads. Indian Pacing Electrophysiol. J. 2016, 16, 92–95. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  5. Soroudi, A.; Hernández, N.; Berglin, L.; Nierstrasz, V. Electrode placement in electrocardiography smart garments: A review. J. Electrocardiol. 2019, 57, 27–30. [Google Scholar] [CrossRef] [PubMed]
  6. Gregory, P.; Lodge, S.; Kilner, T.; Paget, S. Accuracy of ECG Chest Electrode Placements by Paramedics; an observational study. medRxiv 2019. [Google Scholar] [CrossRef] [PubMed]
  7. Chattha, I.S.; Sy, R.W.; Yee, R.; Gula, L.J.; Skanes, A.C.; Klein, G.J.; Bennett, M.T.; Krahn, A.D. Utility of the recovery electrocardiogram after exercise: A novel indicator for the diagnosis and genotyping of long QT syndrome? Heart Rhythm. 2010, 7, 906–911. [Google Scholar] [CrossRef]
  8. Sideris, G.; Voicu, S.; Dillinger, J.G.; Stratiev, V.; Logeart, D.; Broche, C.; Vivien, B.; Brun, P.Y.; Deye, N.; Capan, D.; et al. Value of post-resuscitation electrocardiogram in the diagnosis of acute myocardial infarction in out-of-hospital cardiac arrest patients. Resuscitation 2011, 82, 1148–1153. [Google Scholar] [CrossRef]
  9. Simard, C.; Schwartz, B.C. An Electrocardiogram-Based Diagnosis of Coma. Am. J. Med. 2019, 132, e735–e736. [Google Scholar] [CrossRef]
  10. Ma, Y.; Sun, S.; Zhang, M.; Guo, D.; Liu, A.R.; Wei, Y.; Peng, C.K. Electrocardiogram-based sleep analysis for sleep apnea screening and diagnosis. Sleep Breath. 2020, 24, 231–240. [Google Scholar] [CrossRef]
  11. Finocchiaro, G.; Merlo, M.; Sheikh, N.; De Angelis, G.; Papadakis, M.; Olivotto, I.; Rapezzi, C.; Carr-White, G.; Sharma, S.; Mestroni, L.; et al. The electrocardiogram in the diagnosis and management of patients with dilated cardiomyopathy. Eur. J. Heart Fail. 2020. [Google Scholar] [CrossRef]
  12. Tayler, D.; Vincent, R.; Jolley, B. The importance of assessing the fidelity of electrocardiographs by using a simple calibration signal. J. Med. Eng. Technol. 2008, 32, 365–370. [Google Scholar] [CrossRef]
  13. Yang, S.; Lam, B.; Ng, C.M. Calibration of Electrocardiograph (ECG) Simulators. NCSLI Meas. 2018, 12, 46–53. [Google Scholar] [CrossRef]
  14. da S. Luz, E.J.; Schwartz, W.R.; Cámara-Chávez, G.; Menotti, D. ECG-based heartbeat classification for arrhythmia detection: A survey. Comput. Methods Programs Biomed. 2016, 127, 144–164. [Google Scholar]
  15. Liu, W.; Huang, Q.; Chang, S.; Wang, H.; He, J. Multiple-feature-branch convolutional neural network for myocardial infarction diagnosis using electrocardiogram. Biomed. Signal Process. Control 2018, 45, 22–32. [Google Scholar] [CrossRef]
  16. Zhu, H.; Cheng, C.; Yin, H.; Li, X.; Zuo, P.; Ding, J.; Lin, F.; Wang, J.; Zhou, B.; Li, Y.; et al. Automatic multilabel electrocardiogram diagnosis of heart rhythm or conduction abnormalities with deep learning: A cohort study. Lancet Digit. Health 2020, 2, e348–e357. [Google Scholar] [CrossRef]
  17. Josko, A.; Rak, R.J. Effective simulation of signals for testing ECG analyzer. IEEE Trans. Instrum. Meas. 2005, 54, 1019–1024. [Google Scholar] [CrossRef]
  18. Chien Chang, J.R.; Tai, C.C. Accurate programmable electrocardiogram generator using a dynamical model implemented on a microcontroller. Rev. Sci. Instrum. 2006, 77, 075104. [Google Scholar] [CrossRef] [Green Version]
  19. Chang, K.H.; Young, M.S. Design of a Three-Lead Synthetic ECG Generator Using the Simplified McSharry’s Model. Instrum. Sci. Technol. 2009, 37, 397–409. [Google Scholar] [CrossRef]
  20. Shorten, G.P.; Burke, M.J. A versatile temperature-stable ECG simulator. J. Med. Eng. Technol. 2011, 35, 92–102. [Google Scholar] [CrossRef]
  21. Wei, Y.C.; Wei, Y.Y.; Wey, S.T.; Jang, L.S. Design of a Programmable ECG Generator Using a Dynamical Model. Appl. Mech. Mater. 2013, 311, 485–490. [Google Scholar] [CrossRef]
  22. Edelmann, J.C.; Mair, D.; Ziesel, D.; Burtscher, M.; Ussmueller, T. An ECG simulator with a novel ECG profile for physiological signals. J. Med. Eng. Technol. 2018, 42, 501–509. [Google Scholar] [CrossRef] [Green Version]
  23. Shafique, M.; Naeem, A. Design and Development of an Efficient and Cost Effective ECG Simulator Capable of Generating Normal and Pathological ECG Signals. Int. J. Simul.-Syst. Sci. Technol. 2018, 19, 1.1–1.7. [Google Scholar] [CrossRef]
  24. Yener, S.C.; Mutlu, R. A microcontroller-based ECG signal generator design utilizing microcontroller PWM output and experimental ECG data. In Proceedings of the 2018 Electric Electronics, Computer Science, Biomedical Engineerings’ Meeting (EBBT), Istanbul, Turkey, 18–19 April 2018; pp. 1–4. [Google Scholar]
  25. Manju, B.; Akshaya, B. Simulation Of Pathological ECG Signal Using Transform Method. Procedia Comput. Sci. 2020, 171, 2121–2127. [Google Scholar]
  26. Raupach, T.; Harendza, S.; Anders, S.; Schuelper, N.; Brown, J. How can we improve teaching of ECG interpretation skills? Findings from a prospective randomised trial. J. Electrocardiol. 2016, 49, 7–12. [Google Scholar] [CrossRef] [PubMed]
  27. Berndt, M.; Thomas, F.; Bauer, D.; Härtl, A.; Hege, I.; Kääb, S.; Fischer, M.R.; Heitzmann, N. The influence of prompts on final year medical students’ learning process and achievement in ECG interpretation. GMS J. Med. Educ. 2020, 37, 1–19. [Google Scholar] [CrossRef]
  28. Patel, K.; El Tokhy, O.; Patel, S.; Maroof, H. Improving electrocardiogram interpretation skills for medical students. Adv. Med. Educ. Pract. 2017, 8, 75. [Google Scholar] [CrossRef] [Green Version]
  29. Waechter, J.; Reading, D.; Lee, C.H.; Walker, M. Quantifying the medical student learning curve for ECG rhythm strip interpretation using deliberate practice. GMS J. Med. Educ. 2019, 36, 1–21. [Google Scholar] [CrossRef]
  30. Jafarnia-Dabanloo, N.; McLernon, D.; Zhang, H.; Ayatollahi, A.; Johari-Majd, V. A modified Zeeman model for producing HRV signals and its application to ECG signal generation. J. Theor. Biol. 2007, 244, 180–189. [Google Scholar] [CrossRef]
  31. Gidea, M.; Gidea, C.; Byrd, W. Deterministic models for simulating electrocardiographic signals. Commun. Nonlinear Sci. Numer. Simul. 2011, 16, 3871–3880. [Google Scholar] [CrossRef]
  32. Das, S.; Maharatna, K. Fractional dynamical model for the generation of ECG like signals from filtered coupled Van-der Pol oscillators. Comput. Methods Programs Biomed. 2013, 112, 490–507. [Google Scholar] [CrossRef] [Green Version]
  33. Ryzhii, E.; Ryzhii, M. Modeling of heartbeat dynamics with a system of coupled nonlinear oscillators. In International Conference on Biomedical Informatics and Technology; Springer: Berlin/Heidelberg, Germany, 2013; pp. 67–75. [Google Scholar]
  34. Ryzhii, M.; Ryzhii, E. Simulink heart model for simulation of the effect of external signals. In Proceedings of the 2016 IEEE Conference on Computational Intelligence in Bioinformatics and Computational Biology (CIBCB), Chiang Mai, Thailand, 5–7 October 2016; pp. 1–5. [Google Scholar]
  35. Barrio, R.A.; Dominguez-Roman, I.; Quiroz-Juarez, M.A.; Jimenez-Ramirez, O.; Vazquez-Medina, R.; Aragon, J.L. Modelling the electrical activity of the heart. In Mathematical Biology and Biological Physics; World Scientific Publishing Co. Pte. Ltd.: Singapore, 2017; pp. 51–59. [Google Scholar]
  36. Quiroz-Juárez, M.A.; Jiménez-Ramírez, O.; Aragón, J.; Del Río-Correa, J.L.; Vázquez-Medina, R. Periodically kicked network of rlc oscillators to produce ecg signals. Comput. Biol. Med. 2019, 104, 87–96. [Google Scholar] [CrossRef]
  37. Quiroz-Juarez, M.A.; Jiménez-Ramírez, O.; Vázquez-Medina, R.; Ryzhii, E.; Ryzhii, M.; Aragón, J.L. Cardiac conduction model for generating 12 lead ECG signals with realistic heart rate dynamics. IEEE Trans. Nanobiosci. 2018, 17, 525–532. [Google Scholar] [CrossRef]
  38. Quiroz-Juárez, M.; Jiménez-Ramírez, O.; Vázquez-Medina, R.; Breña-Medina, V.; Aragón, J.; Barrio, R. Generation of ECG signals from a reaction-diffusion model spatially discretized. Sci. Rep. 2019, 9, 19000. [Google Scholar] [CrossRef] [Green Version]
  39. Gois, S.R.; Savi, M.A. An analysis of heart rhythm dynamics using a three-coupled oscillator model. Chaos Solitons Fractals 2009, 41, 2553–2565. [Google Scholar] [CrossRef]
  40. Sayadi, O.; Shamsollahi, M.B.; Clifford, G.D. Synthetic ECG generation and Bayesian filtering using a Gaussian wave-based dynamical model. Physiol. Meas. 2010, 31, 1309. [Google Scholar] [CrossRef] [Green Version]
  41. Ryzhii, E.; Ryzhii, M. A heterogeneous coupled oscillator model for simulation of ECG signals. Comput. Methods Programs Biomed. 2014, 117, 40–49. [Google Scholar] [CrossRef]
  42. Quiroz-Juarez, M.A.; Vázquez-Medina, R.; Ryzhii, E.; Ryzhii, M.; Aragón, J. Quasiperiodicity route to chaos in cardiac conduction model. Commun. Nonlinear Sci. Numer. Simul. 2017, 42, 370–378. [Google Scholar] [CrossRef]
  43. Postnov, D.; Han, S.K.; Kook, H. Synchronization of diffusively coupled oscillators near the homoclinic bifurcation. Phys. Rev. E 1999, 60, 2799. [Google Scholar] [CrossRef] [Green Version]
  44. Grudziński, K.; Żebrowski, J.J. Modeling cardiac pacemakers with relaxation oscillators. Phys. A Stat. Mech. Its Appl. 2004, 336, 153–162. [Google Scholar] [CrossRef]
  45. Żebrowski, J.; Grudziński, K.; Buchner, T.; Kuklik, P.; Gac, J.; Gielerak, G.; Sanders, P.; Baranowski, R. Nonlinear oscillator model reproducing various phenomena in the dynamics of the conduction system of the heart. Chaos Interdiscip. J. Nonlinear Sci. 2007, 17, 015121. [Google Scholar] [CrossRef] [Green Version]
  46. FitzHugh, R. Impulses and physiological states in theoretical models of nerve membrane. Biophys. J. 1961, 1, 445. [Google Scholar] [CrossRef] [Green Version]
  47. Nagumo, J.; Arimoto, S.; Yoshizawa, S. An active pulse transmission line simulating nerve axon. Proc. IRE 1962, 50, 2061–2070. [Google Scholar] [CrossRef]
  48. Rogers, J.M.; McCulloch, A.D. A collocation-Galerkin finite element model of cardiac action potential propagation. IEEE Trans. Biomed. Eng. 1994, 41, 743–757. [Google Scholar] [CrossRef] [PubMed]
  49. Newhouse, S.; Ruelle, D.; Takens, F. Occurrence of strange AxiomA attractors near quasi periodic flows on Tm, m ≧ 3. Commun. Math. Phys. 1978, 64, 35–40. [Google Scholar] [CrossRef]
  50. Garfinkel, A.; Chen, P.S.; Walter, D.O.; Karagueuzian, H.S.; Kogan, B.; Evans, S.J.; Karpoukhin, M.; Hwang, C.; Uchida, T.; Gotoh, M.; et al. Quasiperiodicity and chaos in cardiac fibrillation. J. Clin. Investig. 1997, 99, 305–314. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  51. Witkowski, F.X.; Leon, L.J.; Penkoske, P.A.; Giles, W.R.; Spano, M.L.; Ditto, W.L.; Winfree, A.T. Spatiotemporal evolution of ventricular fibrillation. Nature 1998, 392, 78–82. [Google Scholar] [CrossRef]
  52. Barrio, R.; Varea, C.; Aragón, J.; Maini, P. A two-dimensional numerical study of spatial pattern formation in interacting Turing systems. Bull. Math. Biol. 1999, 61, 483–505. [Google Scholar] [CrossRef] [Green Version]
  53. Van der Pol, B.; Van der Mark, J. LXXII. The heartbeat considered as a relaxation oscillation, and an electrical model of the heart. Lond. Edinb. Dublin Philos. Mag. J. Sci. 1928, 6, 763–775. [Google Scholar] [CrossRef]
  54. McSharry, P.E.; Clifford, G.D.; Tarassenko, L.; Smith, L.A. A dynamical model for generating synthetic electrocardiogram signals. IEEE Trans. Biomed. Eng. 2003, 50, 289–294. [Google Scholar] [CrossRef] [Green Version]
  55. Goldberger, E. The aVl, aVr, and aVf leads: A simplification of standard lead electrocardiography. Am. Heart J. 1942, 24, 378–396. [Google Scholar] [CrossRef]
  56. John, R.M.; Kumar, S. Sinus node and atrial arrhythmias. Circulation 2016, 133, 1892–1900. [Google Scholar] [CrossRef]
  57. Huikuri, H.V.; Castellanos, A.; Myerburg, R.J. Sudden death due to cardiac arrhythmias. N. Eng. J. Med. 2001, 345, 1473–1482. [Google Scholar] [CrossRef]
  58. Keating, M.T.; Sanguinetti, M.C. Molecular and cellular mechanisms of cardiac arrhythmias. Cell 2001, 104, 569–580. [Google Scholar] [CrossRef] [Green Version]
  59. Sörnmo, L.; Laguna, P. The electrocardiogram—A brief background. In Bioelectrical Signal Processing in Cardiac and Neurological Applications; Elsevier Academic Press: Burlington, MA, USA, 2005; pp. 411–452. [Google Scholar]
  60. Ferreira, B.B.; de Paula, A.S.; Savi, M.A. Chaos control applied to heart rhythm dynamics. Chaos Solitons Fractals 2011, 44, 587–599. [Google Scholar] [CrossRef]
  61. Khan, P.; Khan, Y.; Kumar, S. Activity-based tracking and stabilization of human heart rate using fuzzy FO-PID controller. IEEE J. Emerg. Sel. Top. Ind. Electron. 2021, 3, 372–381. [Google Scholar] [CrossRef]
  62. Gharesi, N.; Arefi, M.M.; Khayatian, A.; Bahrami, Z. Extended state observer-based control of heartbeat described by heterogeneous coupled oscillator model. Commun. Nonlinear Sci. Numer. Simul. 2021, 101, 105884. [Google Scholar] [CrossRef]
  63. Tripathy, R.K.; Bhattacharyya, A.; Pachori, R.B. Localization of myocardial infarction from multi-lead ECG signals using multiscale analysis and convolutional neural network. IEEE Sens. J. 2019, 19, 11437–11448. [Google Scholar] [CrossRef]
  64. Dekimpe, R.; Bol, D. ECG Arrhythmia Classification on an Ultra-Low-Power Microcontroller. IEEE Trans. Biomed. Circuits Syst. 2022, 16, 456–466. [Google Scholar] [CrossRef]
  65. Li, W. Wavelets for electrocardiogram: Overview and taxonomy. IEEE Access 2018, 7, 25627–25649. [Google Scholar] [CrossRef]
Figure 1. Electronic circuit of the ECG patient simulator. Schematics for (a) the STM32F401CCU6 microcontroller, managing the generation of ECG waveforms; (b) the STM32F103C8T6 microcontroller, driving the communication protocol with the TFT LCD touch screen; (c) digital-to-analog conversion and amplitude regulation of synthetic ECG waveforms; and (d) Wye resistor network used to generate electrical potentials from limb electrodes.
Figure 1. Electronic circuit of the ECG patient simulator. Schematics for (a) the STM32F401CCU6 microcontroller, managing the generation of ECG waveforms; (b) the STM32F103C8T6 microcontroller, driving the communication protocol with the TFT LCD touch screen; (c) digital-to-analog conversion and amplitude regulation of synthetic ECG waveforms; and (d) Wye resistor network used to generate electrical potentials from limb electrodes.
Sensors 22 05714 g001
Figure 2. (i) Flowchart of the ECG patient simulator for both microcontrollers, STM32F401CCU6 and STM32F103C8T6. (ii) Graphical user interface, where different screens to interact with the user were implemented: (a) model selection, (b) arrhythmia selection, (c,d) play/pause generation of ECG waveforms, and (e) parameter settings.
Figure 2. (i) Flowchart of the ECG patient simulator for both microcontrollers, STM32F401CCU6 and STM32F103C8T6. (ii) Graphical user interface, where different screens to interact with the user were implemented: (a) model selection, (b) arrhythmia selection, (c,d) play/pause generation of ECG waveforms, and (e) parameter settings.
Sensors 22 05714 g002
Figure 3. (i) Electronic circuit of the proposed ECG patient simulator. (ii) Electronic circuit including the TFT LCD touch screen. (iii) Normal synthetic ECG waveforms obtained from the ECG patient simulator for different mathematical models: (a) network of heterogeneous oscillators (3), (b) discretized reaction–diffusion model (5), (c) ring of three coupled oscillators (7), and (d) model based on a quasiperiodic motion (10).
Figure 3. (i) Electronic circuit of the proposed ECG patient simulator. (ii) Electronic circuit including the TFT LCD touch screen. (iii) Normal synthetic ECG waveforms obtained from the ECG patient simulator for different mathematical models: (a) network of heterogeneous oscillators (3), (b) discretized reaction–diffusion model (5), (c) ring of three coupled oscillators (7), and (d) model based on a quasiperiodic motion (10).
Sensors 22 05714 g003
Figure 4. Synthetic 12-lead ECG profile tested using an interpretive 12 channel electrocardiogram machine with series CardioCare 2000.
Figure 4. Synthetic 12-lead ECG profile tested using an interpretive 12 channel electrocardiogram machine with series CardioCare 2000.
Sensors 22 05714 g004
Figure 5. ECG waveforms obtained with the heterogeneous oscillator model of the cardiac conduction system: (a) Complete SA–AV block and (b) Complete AV–HP block.
Figure 5. ECG waveforms obtained with the heterogeneous oscillator model of the cardiac conduction system: (a) Complete SA–AV block and (b) Complete AV–HP block.
Sensors 22 05714 g005
Figure 6. ECG waveforms obtained with the reaction-diffusion model: (a) Sinus Tachycardia, (b) Atrial Flutter, (c) Ventricular Tachycardia, and (d) Ventricular Flutter.
Figure 6. ECG waveforms obtained with the reaction-diffusion model: (a) Sinus Tachycardia, (b) Atrial Flutter, (c) Ventricular Tachycardia, and (d) Ventricular Flutter.
Sensors 22 05714 g006
Figure 7. ECG waveforms obtained with the ring of three-coupled oscillators model: (a) Sinus Bradycardia, (b) Atrial Flutter, and (c) Ventricular Fibrillation.
Figure 7. ECG waveforms obtained with the ring of three-coupled oscillators model: (a) Sinus Bradycardia, (b) Atrial Flutter, and (c) Ventricular Fibrillation.
Sensors 22 05714 g007
Figure 8. ECG waveforms obtained with the extended dynamical model based on a quasi-periodic motion: (a) Bradycardia, (b) Tachycardia, (c) Ventricular Flutter, (d) Atrial Fibrillation, and (e) Ventricular Tachycardia.
Figure 8. ECG waveforms obtained with the extended dynamical model based on a quasi-periodic motion: (a) Bradycardia, (b) Tachycardia, (c) Ventricular Flutter, (d) Atrial Fibrillation, and (e) Ventricular Tachycardia.
Sensors 22 05714 g008
Table 1. Parameter values for reproducing normal rhythms using different models. In the model based on a quasiperiodic motion, the parameters of the Gaussian kernels are expressed by the values of ( a i , b i , θ i ) for each characteristic waveform.
Table 1. Parameter values for reproducing normal rhythms using different models. In the model based on a quasiperiodic motion, the parameters of the Gaussian kernels are expressed by the values of ( a i , b i , θ i ) for each characteristic waveform.
PathologyParameters
Network of heterogeneous oscillators a 1 = 40 , a 2 = a 3 = 50 , u = 0.69 , K S A A V = K A V H P = f 1 = 22 , f 2 = 8.4 , f 3 = 1.5 , d = 3 , e 1 = 3.5 , e 2 = 5 , e 3 = 12 , τ S A A V = τ A V H P = 0.092 , k 1 = 2 × 10 3 , k 2 = 1 × 10 2 , k 3 = 1 × 10 4 , k 4 = 2 × 10 3 , c 1 = 0.26 , c 2 = c 3 = 0.12 , c 4 = 0.1 , b 1 = b 2 = b 4 = 0 , b 3 = 0.015 , g 1 = 0.4 , g 2 = g 3 = 0.09 , g 4 = 0.1 , h 1 = 0.004 , h 2 = h 3 = h 4 = 0.008 , w 11 = 0.13 , w 12 = 1.0 , w 21 = w 31 = 0.12 , w 22 = w 32 = 1.1 , w 41 = 0.22 , w 42 = 0.8 , C 1 = 4 × 10 5 , C 2 = 4 × 10 5 , C 3 = 9 × 10 5 , C 4 = 6 × 10 5 and z 0 = 0.2
Discretized reaction–diffusion model C = 1.35 , β = 4 , H = 3 , K 1 = 0.024 , K 2 = 0.0216 , K 3 = 0.0012 , K 4 = 0.12 and Γ t = 7 .
Ring of three coupled oscillators α 0 = 1 , α 1 = 0.1 , α 3 = 0.05 , α 5 = 0.4 , α S A = 3 , W S A 1 = 0.2 , W S A 2 = 1.9 , d S A = 3 , α A V = 3 , W A V 1 = 0.1 , W A V 2 = 0.1 , d A V = 3 , e A V = 3 , τ S A A V = τ A V H P = τ S A H P = 0 , τ H P S A = 0 , τ A V S A z = 0.8 , τ H P S A = 0 , k S A A V = k A V H P = k S A H P = 0 , k H P S A = 0 , ρ S A = 1 , ρ A V = 1 , ρ H P = 20 , k H P S A = 0 , e S A = 4.5 , k A V S A = 5 , k H P A V = 20 , W S A W A V = W H P = 0 , β T = 16 and β G = 0.0012 .
Model based on a quasiperiodic motion P + ( 1.2 , 0.25 , π / 3 ) , P ( 0 , 0.25 , π / 3 ) , Q ( 0.5 , 0.1 , π / 12 ) , R ( 30 , 0.1 , 0 ) , S ( 7.5 , 0.1 , π / 12 ) , T + ( 0.75 , 0.45 , π / 2 ) and T ( 0 , 0.75 , π / 2 ) .
Table 2. Parameter values for the reaction–diffusion model.
Table 2. Parameter values for the reaction–diffusion model.
PathologyParameters
Sinus Tachycardia H = 2.848 , K 1 = 0 , K 2 = 0.1 , K 3 = 0 , K 4 = 0 , Γ t = 21
Atrial Flutter H = 1.52 , K 1 = 0.068 , K 2 = 0.028 , K 3 = 0.024 , K 4 = 0.012 , Γ t = 13
Ventricular Tachycardia H = 2.178 , K 1 = 0 , K 2 = 0 , K 3 = 0 , K 4 = 0.1 , Γ t = 21
Ventricular Flutter H = 2.178 , K 1 = 0.1 , K 2 = 0.02 , K 3 = 0.01 , K 4 = 0 , Γ t = 13
Table 3. Parameter values for the ring of three-coupled oscillators.
Table 3. Parameter values for the ring of three-coupled oscillators.
PathologyParameters
Ventricular Flutter e S A = 4.5 , k A V S A = 0 , k H P A V = 20 , W S A = 0 , W A V = 0 , W H P = 0 , β T = 8 and β G = 0.0012
Sinus Bradycardia e S A = 4.5 , k A V S A = 5 , k H P A V = 15 , W S A = 0 , W A V = 0 , W H P = 0 , β T = 8 and β G = 0.0009
Ventricular Fibrillation e S A = 6 , k A V S A = 5 , k H P A V = 20 , W S A = 7.33 , W A V = 7.33 , W H P = 7.33 , β T = 16 and β G = 0.0012
Table 4. Parameter values for the extended dynamical model based on a quasiperiodic motion. The parameters of the Gaussian kernels are expressed by the values of ( a i , b i , θ i ) for each characteristic waveform.
Table 4. Parameter values for the extended dynamical model based on a quasiperiodic motion. The parameters of the Gaussian kernels are expressed by the values of ( a i , b i , θ i ) for each characteristic waveform.
WavesSinus BradycardiaSinus TachycardiaVentricular FlutterAtrial FibrillationVentricular Tachycardia
P ( 0.7 , 0.2 , 3 π / 8 ) ( 0.7 , 0.2 , 3 π / 7 ) ( 0 , 0.1 , π / 6 ) ( 0.7 , 0.12 , 5 π / 7 ) ( 1 , 0.2 , 10 π / 13 )
P + ( 0.8 , 0.1 , π / 3 ) ( 0.8 , 0.1 , π / 3 ) ( 0 , 0.1 , 2 π / 3 ) ( 0.9 , 0.13 , π / 2 ) ( 1 , 0.1 , 2 π / 3 )
Q ( 1 , 0.1 , π / 13 ) ( 7 , 0.1 , π / 13 ) ( 0 , 0.1 , π / 12 ) ( 0.6 , 0.12 , π / 4 ) ( 12 , 0.2 , π / 3 )
R ( 20 , 0.1 , 0 ) ( 20 , 0.1 , 0 ) ( 20 , 0.6 , π / 2 ) ( 18 , 0.1 , 0 ) ( 1 , 0.3 , 0 )
S ( 9.5 , 0.1 , π / 15 ) ( 9.5 , 0.1 , π / 17 ) ( 20 , 0.6 , π / 2 ) ( 0.1 , 0.05 , π / 30 ) ( 3 , 0.4 , 2 π / 11 )
T ( 0.27 , 0.4 , 2 π / 5 ) ( 0.27 , 0.4 , π / 2 ) ( 0 , 0.1 , 3 π / 8 ) ( 0.62 , 0.15 , π / 4 ) ( 5 , 0.5 , π / 2 )
T + ( 0.15 , 0.55 , 4 π / 7 ) ( 0.15 , 0.55 , 4 π / 7 ) ( 0 , 0.1 , 5 π / 8 ) ( 0.55 , 0.17 , 7 π / 11 ) ( 3 , 0.45 , 2 π / 23 )
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Quiroz-Juárez, M.A.; Rosales-Juárez, J.A.; Jiménez-Ramírez, O.; Vázquez-Medina, R.; Aragón, J.L. ECG Patient Simulator Based on Mathematical Models. Sensors 2022, 22, 5714. https://doi.org/10.3390/s22155714

AMA Style

Quiroz-Juárez MA, Rosales-Juárez JA, Jiménez-Ramírez O, Vázquez-Medina R, Aragón JL. ECG Patient Simulator Based on Mathematical Models. Sensors. 2022; 22(15):5714. https://doi.org/10.3390/s22155714

Chicago/Turabian Style

Quiroz-Juárez, Mario Alan, Juan Alberto Rosales-Juárez, Omar Jiménez-Ramírez, Rubén Vázquez-Medina, and José Luis Aragón. 2022. "ECG Patient Simulator Based on Mathematical Models" Sensors 22, no. 15: 5714. https://doi.org/10.3390/s22155714

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop