reject based on the amplitude a binary method of reducing noise is used the resultant correlated traces may be used in a number of different ways for example traces having high correlation values i e one or more peaks in the resultant correlated trace have a correlation of 1 or approaching 1 can be used as the corrected trace on which the electrogram analysis is subsequently based alternatively the correlation values associated with different templates can be compared with each other so as to obtain an average alternatively two or more of the correlated traces may be processed with an u201c and u201d operator to remove solitary peaks or and u201c or u201d operator together with a threshold value can be used to show peaks above a threshold value which have been picked up by one template it has been found that having a series of templates to filter different electrograms is sufficient to filter electrograms from the majority of patients for example a series of four templates may be used these templates may be defined on the basis that they resemble data in a typical electrogram and they may be time dilated versions of each other for example the series may comprise a master template template 1 which is shorter than the others meaning that template 1 will typically pick up most of the data in the electrogram together with some noise the other templates are of varying.