The use of the coherent averaging technique applied to the electrocardiographic signal implies the location of a fiducial point as a synchronisation reference. An algorithm easily adaptable to a personal computer, operable in real time, insensitive to mains and to ECG-baseline fluctuations, with a low jitter value and the capacity to trigger any ECG signal wave or complex, has been developed. The algorithm detects those waveforms which, within certain confidence intervals, are morphologically equal to a reference wave. This wave is chosen by the user as the repetitive waveform within which the fiducial point is to be located. A two-window template and differential parameters are used. The possibility of building the template permits the user to adapt the algorithm to each patient's ECG. To evaluate its accuracy objectively, a software simulation was built of a generator capable of producing test signals as the sum of the 'useful' signal plus 'noise'. A jitter standard deviation of 1.65 ms was obtained in the worst test (SNR = 10 dB; noiseband = 0-50 Hz), which shows the excellent recognition accuracy of the algorithm.