Pacemaker has two leads placed against the inner heart wall. Each lead has two electodes which can sense the electrical voltage changes near the heart tissue. The depolarizations of the heart tissue travel across the heart like a wave. Clinical studies shows that the depolarization wave move toward and away from the electrode, the voltage sensed by the electrode increases and decreases correspondingly.
We model this behavior by calculating the distance between the location of the depolarization wave within the path automata, and the location of the electrode. The animation on the right shows the simulated voltage sensed by two electrodes (Uni1,Uni2). The left column shows the analog signal sensed by the two electrodes and their difference. The right column shows the logical pulses that the pacemaker gets after simple thersholding.
With the model of the electrodes we are able to put imaginary electrodes at different places of our heart model. This also allows us to simulate behaviors like pacemaker lead dislodge and crosstalk. More information on these subjects can be found in our EMBC'11 paper