A medical device and associated method for classifying an unknown cardiac signal operate to sense a cardiac signal over known cardiac cycles and generate a template of the known cardiac cycles. An unknown cardiac signal is sensed over an unknown cardiac cycle. A template alignment point and an unknown cardiac signal alignment point are identified by using a fourth order difference signal. The template and the unknown cardiac signal are aligned across an alignment window by aligning the template alignment point and the unknown cardiac signal alignment point. A morphology match metric measuring a similarity between the aligned template and the unknown cardiac signal is computed.