# Similarity of signals

I have a question concerning methods to find different aspects of "similarity" of signals. So, first, I'd like to characterize the signals to be dealt with:

We have a number of close to rectangular signals between values 0 and 1, starting and ending with some distinct flanks; furthermore, the signals are subject to some noise. Some of the signals are more like peaks which would not reach 1 (2 flanks meeting in the middle).

We have two sets X and Y of such signals containing n vectors each. The vectors in Y are ideally identical to the vectors in X, but time shifted. This is for the ideal case though, in the real application, the signals are not likely to be identical, but we suppose to find some similarities between them.

My question is now: how could i find the time shift between the two sets? First, I need a method to somehow estimate the similarity of the signals in sets X and Y; afterwards, one can find the time-shift.

I thought about cross-correlation first. The issue is, that those peak signals deliver bigger cross correlation coefficients when correlated with long rectangular signals. So, could you think of solution by normalizing the cross correlation coefficients with some other characteristic value of the signal (I didn't find a meaningful one yet).

After that, we thought that probably dynamic time warping techniques could help - I'm still familiarizing with that one. Do you think this could be a good way to go?

Generally: do you have another technique that could be used and helpful for this problem? I'm not an expert in signal processing (I'm just a mechanical engineer), so don't be too cruel to me.

• Are the signals mean-free? If not, try removing the mean before correlating.
– jan
Oct 1 '13 at 9:06
• Hi and thanks for the comment! The means are normally not zero. So, you would suggest something like this (for series xi=(x1,x2...,xn) and yi=(y1,y2...yn)?: $$\frac{\sum(x_{i} - \bar{x})\cdotp(y_{i} - \bar{y})}{\sqrt{\sum(x_{i} - \bar{x})^2}\cdotp\sqrt{\sum(y_{i} - \bar{y})^2}}$$ I'll try that one then. Thanks for the comment! Oct 1 '13 at 10:45
• Yes if you don't do this you will always have the correlation of the mean-free signals plus the product of the means which can give these weird effects if the mean is not equal for all signals.
– jan
Oct 1 '13 at 10:50
• Yes, I understand - thank you a lot for the helpful comment. If there are any other suggestion leading in another direction, I am still very interested to go into those as well. Oct 1 '13 at 11:09