An intracardiac electrogram model to bridge virtual hearts and
implantable cardiac devices

arXiv:1703.01107v1 [] 3 Mar 2017

Weiwei Ai1 , Nitish Patel1 , Partha Roop1 , Avinash Malik1 , Nathan Allen1 and Mark L. Trew2
Abstract— Virtual heart models have been proposed to enhance the safety of implantable cardiac devices through closed
loop validation. To communicate with a virtual heart, devices
have been driven by cardiac signals at specific sites. As a result,
only the action potentials of these sites are sensed. However,
the real device implanted in the heart will sense a complex
combination of near and far-field extracellular potential signals.
Therefore many device functions, such as blanking periods and
refractory periods, are designed to handle these unexpected
signals. To represent these signals, we develop an intracardiac
electrogram (IEGM) model as an interface between the virtual
heart and the device. The model can capture not only the local
excitation but also far-field signals and pacing afterpotentials.
Moreover, the sensing controller can specify unipolar or bipolar
electrogram (EGM) sensing configurations and introduce various oversensing and undersensing modes. The simulation results
show that the model is able to reproduce clinically observed
sensing problems, which significantly extends the capabilities
of the virtual heart model in the context of device validation.

I. INTRODUCTION
With the growing use of implantable cardiac devices
[1], it has become increasingly important to validate the
devices under broader physiologically relevant conditions.
This necessitates real-time virtual heart development to facilitate closed-loop validation. In closed-loop validation, virtual
heart models provide physiologically relevant responses to
the device [2], [3], [4], [5]. These models are usually based
on timed automaton (TA) [6] or hybrid automaton (HA) [7],
which is amenable to formal analysis [2], [3] and real-time
implementations [8], [9]. This is desirable for the verification
of safety-critical systems.
However, modeling the heart-device interface has received
limited attention. In [3], the heart model is connected with
the device via specific computational nodes, which means
that the device can only sense the immediate local signals.
Synthetic EGM are generated by summing the distancedependent Gaussian factor [10]. This can not reflect the real
sensed signals, i.e. EGM, by the devices in patients, which
include local activation, far-field signals and pacing artifacts
[11].
The device senses these unexpected signals, referred to as
oversensing, which can cause inappropriate pacing inhibition, pacemaker tracking or mode switching [11], [12]. For
instance, an unintended mode switch is reported because of
prolonged atrial activation [13]. As a large proportion of

the functionality of cardiac devices is designed to handle
unexpected signals, we must be able to represent these
behaviors in order to validate the functionality.
To the best of our knowledge, no existing work explicitly
models far-field signals and pacing artifacts for the virtual
heart [2], [3], [4] in the context of closed-loop validation.
Yip et.al [4] use HA to model an abstracted network of
cardiac conduction system. The network is composed of
cardiac cells connected by paths to capture characteristics
of action potential propagation in tissue. This paper focuses
on the approach to derive realistic EGM from the abstract
heart model [4], but the methodology can also be applied to
other work, like [2], [3], [4].
We develop an EGM model to capture local cardiac
activities, stimuli afterpotentials and far-field signals. The
model is designated for the virtual heart in the context of
closed-loop validation. The same HA formalism is employed,
which enables us the amenability to formal analysis and realtime implementation. It expands the capability of validating
timing cycles by introducing various oversensing and undersensing modes. The simulation results show that the model is
able to reproduce sensing problems discussed in the literature
like [11], [12], [13].
II. M ATERIALS AND M ETHODS
A. IEGM module
The proposed IEGM module acts as an interface between
the heart and the device, as shown in Fig. 1, consisting of
four components (Fig. 2). We extend the heart model [4] with
the events Celli , Cellj and so on to signify the propagation
status, which are used to synchronize the EGM computation
model detailed in Section II-B. Section II-C describes the
T wave generated by the ventricular repolarization, pacing
pulses AP and V P from the device create pacing afterpotentials likely leading to crosstalk [11], depicted in Section II-D.
The sensing controller, Section II-E, is used to control the
sensing configurations and introduce various sensing signals.
The outputs atrial EGM (AEGM ) and ventricular EGM
(V EGM ) go to the device sensing circuits.

Heart

Celli , Cellj
Relayi/j
Celli&j , Anni, ...
AP, V P

1 Weiwei Ai, Nitish Patel, Partha Roop, Avinash Malik and Nathan Allen
are with the Department of Electrical and Computer Engineering, University
of Auckland, NZ wai484@aucklanduni.ac.nz
2 Mark L. Trew is with Auckland Bioengineering Institute, University of
Auckland, NZ m.trew@auckland.ac.nz

IEGM

AEGM
V EGM

Device

AP, V P

Fig. 1: IEGM module as the interface between the heart and
the device.

Celli , Cellj
Relayi/j
Celli&j , Anni

Cellir , Celljr
Relayi/jr
Celli&jr , Annir

Section II-B
Intrinsic
EGM
Section II-C
T
wave

Vadt , Vadr

EGMi
t˙i = 1
i)
Vi = C · cosϕ(t
r(ti )2
EGMij = Vi

Vvdt , Vvdr

Vvrt , Vvrr

Section II-E
Sensing
controller

Section II-D
P acing
af terpotentials

Idle
EGMij = 0

Relayi/j ?

AEGM
V EGM

Vvpa , Vapa

Fig. 2: Components of IEGM module.

B. Intrinsic EGM
The separation of electrical charges generated at the border
between activated and resting myocardium creates moving
electric dipoles [14], [15], as shown in Fig. 3. When the
activation front moves nearby an electrode, the potential
sensed by the electrode can be calculated by (1) [15], where
C represents the dipole moment, r is the distance from the
dipole to the electrode, and ϕ is the angle between the dipole
and the distance vector. The amplitude decreases as the
distance r increases. As a consequence, the local activation
contributes much greater amplitude to the potential than farfield signals.

tj : = 0
Relayi/j ?

EGMj
t˙j = 1
cosϕ(t )
Vj = C · r(tj )2j
EGMij = Vj

Anni?

Cellij ?
tij : = 0

AP, V P

Cellj ?

Celli ?
ti : = 0

EGMi&j
t˙ij = 1
cosϕ(t +t )
Vi = C · r(ti +ti ij )ij2

Cellij ?
tij : = 0

cosϕ(t +t )

Vj = C · r(tj +tj ij )ij2
EGMij = Vi + Vj

Fig. 4: The model of the EGM computation.

compute the instantaneous position of the moving action
potential (x(t), y(t)), cosϕ(t), r(t) and then obtain the
potential V at any specified electrode (xp , yp ) according to
(1) with the synchronization events.
Fig.4 shows the synchronizing control of the EGM computation with the P athij . Given any electrode, the sensed
EGM is the superposition of potentials generated by dipoles
moving along all the paths within the heart model [4],
including the local activation as well as far-field signals.
In our model, we specify the coordinates of the tip and
the ring electrodes in the right atrium and right ventricle. The sensed signals by these electrodes are denoted as
Vadt , Vadr , Vvdt , Vvdr respectively.
C. T wave
The T wave reflects the ventricular repolarization [16].
In our model, we take the process of repolarization as a
virtual dipole with advancing negative charges rather than the
positive charges of the depolarization wave. The computation
process is similar to Section II-B.
D. Pacing afterpotential

Fig. 3: Dipole model [15].

cosϕ
(1)
r2
The heart model [4] is composed of nodes and paths. The
EGM computation module is connected with the path model.
The event Celli /Cellj denotes that the action potential from
Celli /Cellj starts traveling along the path. Relayi/j means
that the action potential reaches the other end of the path.
Celli&j represents both action potentials moving to each
other and Anni indicates that they collide in the middle of
the path.
We assign each node with the coordinate (xi , yi ) and the
conduction velocity vci along the path such that we can
V (r, ϕ) = C ·

A low-amplitude wave of opposite polarity is followed
by a pacing pulse, referred to as afterpotential [11]. The
amplitude is directly related to both the amplitude and the
duration of the pacing pulse. The afterpotential exponentially
decreases and the decay characteristics are determined by the
time constant formed by the product of the coupling capacitor
C and the load (combination impedance of lead, electrode to
tissue interface, and myocardium) [17], as shown in (2).
−t

V (t) = VS · e RC

Stimend ?
t: = 0

Idle
Vpa = 0
Stimstart ?

(2)

PA
ṫ = 1
−t
Vpa = VS · e RC

Fig. 5: The model of the pacing afterpotential computation.

As shown in Fig. 5, we can detect the start and the
termination of the stimulation from the device, i.e., AP
or V P , and employ (2) to compute the afterpotential. The
outputs Vvpa , Vapa denote atrial oversensing of ventricular
pacing events (VA crosstalk) and ventricular oversensing of
atrial pacing impulse (AV crosstalk).
E. Sensing controller
Both oversensing and undersensing may trigger various
algorithms of cardiac devices. These problems arise from
many factors [11], such as sensing threshold, configurations
and so on. We develop a sensing controller to model these
factors affecting EGM contents. In this module, AEGM and
VEGM are the signals sensed by the atrial and ventricular
leads, computed by (3) and (4) respectively.
AEGM = a · (Vadt − b · Vadr + cva · Vvpa )

(3)

V EGM =d · (Vvdt − b · Vvdr +

(4)

e · (Vvrt − b · Vvrr ) + cav · Vapa )

The variables a, b, cva , cav , d, e are used to determine
which signals are present to the device, including desired
local activations and far-field signals Vadt , Vadr , Vvdt , Vvdr ,
T wave Vvrt , Vvrr and afterpotentials Vvpa , Vapa . These variables can be changed over time according to the validation
requirements.
III. R ESULTS AND DISCUSSION
The clinically observed physiologic intracardiac signals
EGM on the atrial channel and the ventricular channel are
listed in Table I and II respectively. The sources of these
signals can be found in the given references. The clinical
significance column indicates how often these problems
could occur in real patients. The corresponding variables in
our model to control the presence of the signals are also
given. While all of these signals can be reproduced by the
proposed model, we only present some examples (Fig. 6) in
this paper due to the space limitation.
AEGMs
P-wave
P-wave
double
counting [11], [13]
Far-field R-wave
(FFRW)
VA crosstalk [11]

Clinical
Significance
The desired signal
Rare [11]
Relatively
frequent[11]
Rare [11]

Controls

Segment

a, b, cva ;
Atrial conduction
a, b

A

cva

–

D
B

TABLE I: Intracardiac signals of atrial EGMs
We use the heart model to produce various rhythms
and present the electrical activities via the proposed IEGM
module to the device. The presence of signals is varied over
time controlled by the sensing controller. The simulation
plots in Fig. 6 show (from top to bottom): AEGM, ASraw
(Level High shows that AEGM signal is greater than the
sensing threshold and could be detected by the device),

VEGMs
R-wave
Far-field P-wave
[11]
R-wave double
counting [12]
T-Wave
Oversensing
[12]
AV crosstalk [12]

Segment
A
–

Clinical Significance
The desired signal

Controls
d, b, e, cav

Rare in adults [12] for
ICDs and uncommon
for pacemaker [11]

d

Exceptional with pacemakers but may occur
with ICDs [11]

Ventricular
conduction

–

Rare in pacemakers and
more frequent in ICDs
[11]
Rarely encountered but
may still occur [11]

e

–

cav

C

TABLE II: Intracardiac signals of ventricular EGMs

VEGM, V Sraw , the device sensed events AS, V S and the
pacing pulses AP, V P .
Segment A in Fig. 6 shows the desired AEGM and
VEGM. These signals only reflect the local activations and
are detected by the device once at a time. A far-field R
wave is present in Segment B. The signal falls into the
refractory period so no extra AS is detected by the device.
In Segment C, the ventricular lead senses the afterpotential
of atrial pacing pulse AP . We mimic the interatrial block
in Segment D by slowing the conduction velocity of partial
atrium such that the AEGM is prolonged. In this example,
the device double counted the atrial signals.
While the dipole theory has been applied in numerous
cardiac electrophysiology studies [18], our integration of the
classical dipole model into an abstract HA-based heart model
is novel. The simulation result shows that it is a feasible and
effective approach. This integration has unique advantages:
1) The HA formalism is amenable to formal analysis
and real-time implementations. This is vital for the
verification of safety-critical cardiac devices.
2) HA-based models favor compositional design. This benefits future expansion of the model.
3) Due to the nature of the dipole theory, the morphology of EGM can capture realistic signals by refining
the heart model with 3D anatomical data. This would
be necessary for implantable cardioverter defibrillator
(ICD) validation.
4) The electrocardiogram (ECG) could also be modeled
by extending the heart model with an appropriate torso
model. The ECG can be used to validate the heart
model.
5) Stochastic features could also be captured by extending
the sensing controller with probabilistic automaton. This
enables us more flexibility in the context of device
validation.
As the morphology of EGM created by dipole models
relies on the geometry of the heart, the current EGM is an
approximation of real signals because of the abstract nature
of the existing heart model. In particular, the T wave records
the ventricular repolarization but cannot reflect patterns of
epicardium to endocardium activation. For a pacemaker, the
major algorithms depend on the timing of the signals rather

Time (s)
Fig. 6: Simulation EGMs. Segment A demonstrates desired AEGM/VEGM. B includes far-field R wave indicated by the
red arrow. AV crosstalk is present in C due to the atrial pacing pulse AP . In D, the prolonged P-wave is double counted
by the device indicated by the red arrow.

than morphology. Therefore, the current model can meet the
need of the pacemaker validation. We connected the virtual
heart and the proposed IEGM module to a pacemaker model,
and Fig. 6 shows the device can sense the EGM and deliver
pacing pulses if bradycardia is present. As we discussed, the
morphology can be improved by refining the heart model for
ICD validation.
IV. C ONCLUSION
We have developed an intracardiac electrogram (IEGM)
model capturing local excitation, far-field signals and pacing
afterpotentials. The results show that we are able to cover
sensing problems discussed in the literature. We have integrated classical dipole model into the HA-based virtual
heart to enable the amenability to formal analysis. This is
desirable for the verification of safety-critical systems. The
compositional feature of HA and the nature of the dipole
theory provide us with a promising potential for future
expansion of the work.
R EFERENCES
[1] H. G. Mond and A. Proclemer, “The 11th world survey of cardiac pacing and implantable cardioverter-defibrillators: Calendar year
2009–a world society of arrhythmia’s project,” Pacing and Clinical
Electrophysiology, vol. 34, no. 8, pp. 1013–1027, 2011.
[2] Z. Jiang, M. Pajic, and R. Mangharam, “Cyber–physical modeling of
implantable cardiac medical devices,” Proceedings of the IEEE, vol.
100, no. 1, pp. 122–137, 2012.
[3] T. Chen, M. Diciolla, M. Kwiatkowska, and A. Mereacre, “Quantitative verification of implantable cardiac pacemakers over hybrid heart
models,” Information and Computation, vol. 236, pp. 87–101, 2014.
[4] E. Yip, S. Andalam, P. S. Roop, A. Malik, M. Trew, W. Ai, and
N. Patel, “Towards the emulation of the cardiac conduction system
for pacemaker testing,” CoRR, vol. abs/1603.05315, 2016. [Online].
Available: http://arxiv.org/abs/1603.05315
[5] W. Ai, N. Patel, and P. Roop, “Requirements-centric closed-loop
validation of implantable cardiac devices,” in Design, Automation &
Test in Europe Conference & Exhibition (DATE). IEEE, 2016, pp.
846–849.
[6] R. Alur and D. L. Dill, “A theory of timed automata,” Theoretical
computer science, vol. 126, no. 2, pp. 183–235, 1994.

[7] T. A. Henzinger, “The theory of hybrid automata,” in Logic in
Computer Science, LICS’96. Proceedings., Eleventh Annual IEEE
Symposium on. IEEE, 1996, pp. 278–292.
[8] N. Allen, S. Andalam, P. Roop, A. Malik, M. Trew, and N. Patel,
“Modular code generation for emulating the electrical conduction
system of the human heart,” in 2016 Design, Automation & Test in
Europe Conference & Exhibition (DATE). IEEE, 2016, pp. 648–653.
[9] S. Andalam, H. Ramanna, A. Malik, P. Roop, N. Patel, and M. L. Trew,
“Hybrid automata models of cardiac ventricular electrophysiology
for real-time computational applications,” in Engineering in Medicine
and Biology Society (EMBC), 2016 IEEE 38th Annual International
Conference of the. IEEE, 2016, pp. 5595–5598.
[10] Z. Jiang, M. Pajic, A. Connolly, S. Dixit, and R. Mangharam,
“Real-time heart model for implantable cardiac device validation and
verification,” in Real-Time Systems (ECRTS), 2010 22nd Euromicro
Conference on. IEEE, 2010, pp. 239–248.
[11] H. Burri, “37 - pacemaker programming and troubleshooting,” in Clinical Cardiac Pacing, Defibrillation and Resynchronization Therapy
(Fifth Edition), fifth edition ed., K. A. Ellenbogen, B. L. Wilkoff,
G. N. Kay, C.-P. Lau, and A. Auricchio, Eds. Elsevier, 2017, pp.
1031 – 1063.
[12] C. D. Swerdlow, M. L. Brown, and P. Bordachar, “4 - sensing and
detection with cardiac implantable electronic devices,” in Clinical
Cardiac Pacing, Defibrillation and Resynchronization Therapy (Fifth
Edition), fifth edition ed., K. A. Ellenbogen, B. L. Wilkoff, G. N. Kay,
C.-P. Lau, and A. Auricchio, Eds. Elsevier, 2017, pp. 114 – 167.
[13] M. Almehairi, A. Baranchuk, A. Johri, and J. Caldwell, “An unusual
cause of automatic mode switching in the absence of an atrial tachyarrhythmia,” Pacing and Clinical Electrophysiology, vol. 37, no. 6,
pp. 777–780, 2014.
[14] F. Wilson, A. Macleod, and P. Barker, “The distribution of the
action currents produced by heart muscle and other excitable tissues
immersed in extensive conducting media,” The Journal of general
physiology, vol. 16, no. 3, pp. 423–456, 1933.
[15] W. IRNICH, “Intracardiac electrograms and sensing test signals:
Electrophysiological, physical, and technical considerations,” Pacing
and Clinical Electrophysiology, vol. 8, no. 6, pp. 870–888, 1985.
[16] D. M. Mirvis and A. L. Goldberger, “12 - electrocardiography,” in
Braunwald’s heart disease: a textbook of cardiovascular medicine,
tenth edition ed., D. L. Mann, D. P. Zipes, P. Libby, and R. O. Bonow,
Eds. Elsevier Health Sciences, 2015, pp. 114 – 154.
[17] J. Sperzel, J. NEUZNER, T. Schwarz, Q. Zhu, A. KÖNIG, and
G. KAY, “Reduction of pacing output coupling capacitance for sensing
the evoked response,” Pacing and Clinical Electrophysiology, vol. 24,
no. 9, pp. 1377–1382, 2001.
[18] G. Lines, M. Buist, P. Grottum, A. Pullan, J. Sundnes, and A. Tveito,
“Mathematical models and numerical methods for the forward problem
in cardiac electrophysiology,” Computing and Visualization in Science,
vol. 5, no. 4, pp. 215–239, 2003.

