An implantable medical device and associated method sense cardiac signals for deriving a template representing a known EGM waveform morphology and for classifying an unknown waveform morphology. A boundary of the template, offset from the template, is computed and compared to an unknown waveform morphology for classifying the unknown waveform morphology.