A method for localizing a pattern in a quasi-periodic signal includes estimating, using a controller, a rate or a frequency of a quasi-periodic signal, and defining a search window based on the estimated rate or frequency of the quasi-periodic signal. A starting position is defined in the received quasi-periodic signal, the starting position corresponding to a first maximum. A portion of the quasi-periodic signal in the search window is cross-correlated with a template signal pattern to be matched to produce a second maximum. The second maximum is defined by the controller as a new starting position. The new starting position is stored.