A system and method for automatically analyzing a cardiac signal, including the step of providing an episode database on a computer storage medium including a plurality of episode data records of one or more patients. Each episode data record includes a cardiac signal from at least one data-generating device. The method also includes the step of selecting one or more of the N beats to be one or more beat templates, for at least a first cardiac signal having N beats. Another step is determining a value K for the cardiac signal using a computer system where K beat templates can represent all the N beats in the cardiac signal.