Suppose I have a signal in the form of N real numbers. I am searching for a continuous pattern within this signal. The pattern is represented by M real numbers. (M < N)
To find the pattern's position within the signal I apply convolution operator c = conv(signal, pattern) and look for the highest value in c.
Should I subtract the mean from the signal and pattern before applying convolution? If so is there a formal justification?
EDIT: (since the above turned out to be trivial)
What if my signal doesn't necessarily contain the pattern and can vary in intensity (as in images) and I'm convolving with a small "patch" as a pattern? It's hard to set a threshold beyond which I decide the pattern is found.