Hi fritza, sorry about being a little late for answering.
Their (labyrinthine) pseudocode appears to slide a snippet ("template;" kernel?) across a data stream looking for goodness-of-fit by correlation coefficient. This is for each of several templates, so performance is at a premium.
In the way you describe it, looks like a convolution - https://en.wikipedia.org/wiki/Convolution of two signals. Since you are trying to find a cross-correlation - https://en.wikipedia.org/wiki/Cross-correlation when sliding both signals, you must perform a cross-correlation.
It's similar to a convolution process. Theoretically, a cross-correlation is a convolution without reversing one of the signals before sliding it (the point is that, in my experience, there are more already-written code for convolution than for cross-correlation).
You must consider some situations: in most algorithms, the length of both discrete-time signals must be the same, so you may need to append zeros in the end to match it.
you can reverse one of the signals and use the convolution function from vDSP.
Topic:
App & System Services
SubTopic:
Core OS
Tags: