A method includes retrieving electrogram (EGM) data for N cardiac cycles from a memory of an implantable medical device. N is an integer greater than 1. The method further include categorizing each of the N cardiac cycles into one of a plurality of categories based on a morphology of the N cardiac cycles and performing comparisons between pairs of the N cardiac cycles. Each of the comparisons between two cardiac cycles includes detecting a mismatch between the two cardiac cycles when the two cardiac cycles are in different categories, and detecting a match between the two cardiac cycles when the two cardiac cycles are in the same category. Additionally, the method includes classifying the rhythm of the N cardiac cycles based on a number of detected matches and detected mismatches.