Patent ID: 7640054

Claim:
A method of generating a template in an implantable medical device for implantation within a patient, comprising the steps of: generating a template from collected events corresponding to the patient; delaying the step of generating a template for a first predetermined time period in response to the template not being generated within a predetermined number of collected events; determining whether the template is valid; and monitoring the template to determine whether the template is an accurate representation of the patient, wherein the step of generating a template comprises the steps of: monitoring a heart rate of the patient to generate the collected events; determining whether beats corresponding to the collected events are normal beats; and determining whether a predetermined number of normal beats has been collected within the predetermined number of collected events, wherein the step of delaying the template generation includes delaying the template generation in response to the predetermined number of normal beats not being collected within the predetermined number of collected events, and wherein the step of generating a template further comprises: determining whether the predetermined number of normal beats have been collected and computing cross matches between the predetermined number of collected normal beats to form corresponding computed cross matches; determining whether a predetermined number of the computed cross matches exceed a threshold; determining whether a predetermined number of cross matching attempts have failed; delaying the template generation for a second predetermined time period in response to the predetermined number of failed cross matching attempts; and forming the template from the predetermined number of computed cross matches in response to the predetermined number of the computed cross matches exceeding the threshold.