A surface electrocardiogram (EKG) is emulated using signals detected by the internal
leads of an implanted device. The emulation is performed using a matrix-based technique
that separately emulates each of the individual signals of a multiple-lead EKG,
rather than merely emulating a single combined EKG. In one example, each of the
twelve signals of a standard 12-lead EKG are individually emulated, allowing for
separate processing and display. The emulation technique takes into account factors
affecting the relative locations of the internal leads, such as respiration and
posture, to thereby provide a more accurate emulation. A calibration technique
is provided for calibrating the EKG emulation for use with a particular patient
and a verification technique is provided for automatically verifying the reliability
of the emulation. Any significant loss in emulation reliability is likely caused
by lead dislodgment and so automatic detection of possible lead dislodgment is
also achieved.