Analysis of template-matching methods for intracardiac electrogram analysis.