Correlation is such a simple function that I advise you to write your own code to evaluate it, so that you can learn. If x(n), y(n) and z(n) are the samples of the signals, the correlation coefficient between x and y is given by Sigma x(n) * y(n) divided by the root of [Sigma x(n)^2 * y(n)^2], where ' * ' denotes simple multiplication and ^2 denotes squaring. The summation is taken over all the samples of the signals. The duration and hence the number of samples of the signals must be matched. Similarly, you can look at the correlation between y and z OR x and z.
From the above expression, you can easily see that (i) if x and y are identical, the numerator and denominator will be same and you will get corr. coeff of unity. (ii) If they are exactly out of phase, ie. one is the negative of the other, then the numerator will be - Sigma x(n)^2 and denominator is Sigma x(n)^2 and you will get the corr. coeff as -1. These are the extreme values.
If your signals are equal in length, you can use normalized correlation technique. But if the lengths are different, dynamic time warping is an alternative approach.
Hi! From your very general question I assume that you are looking for a general answer, not necessarily the 'correlation' in a technical sense.
If you have a few signals and want to discover common structures, a good place to start is to study their individual power spectral densities. This may give you an insight into which frequency ranges carry relevant structures at all. Then you can design filters that retain the relevant part of the signal and reduce or suppress the other parts. In particular, the correlation as stated above is highly sensitive to the DC component, i.e., an constant offset to a signal. However, often the DC component does not carry any information so you need to get rid of it before you proceed. (This might be more difficult than it sounds.) Weak electronic signals might be contaminated by the 50/60 Hz grid frequency, and so on. Studying the spectrum is like using an oscilloscope on a circuit: you need to set it to the right voltage range, time base, trigger level etc. before you can expect to see the relevant part of the signals.
Another important starting point is audio-visual inspection of the signals. Human beings are very good at hearing and seeing structures in signals. You can try to play a time series as an audio signal, possibly at a different sample rate, and listen for structures. As another example, I once plotted the power consumption of a factory for a year as an image of 365 x 96 pixels, where each line represented the 15min-intervals of a day and the color coded the consumption level. This made several interesting structures obvious, like maintenance intervals and shift cycles, and gave us insights into the less obvious structures.
Once you have insight into the relevant structures of the individual signals, you can look for relations between the signals. The correlation is an important tool there. However, often there is a time-delay between signals due to cause and effect. For example you might have the power consumption of a pump and the rate of the flow that it produces. If you simply correlate these signals x[n] and y[n] it might not be very informative, because when the pump starts the flow will take some time before it rises. What you really want is to correlate x[n] and y[n + a], where a is some constant representing the relative delay between cause and effect. The spectral analysis in the first step will tell you which delays to study.
Your signals must be equal in size (i.e., number of points). then apply point by point correlation function. If you need the similarity of the two signal then you may use Copula functions.
Suppose assume that, two signals are identical for T interval, but first signal is identity with second signal at 'X' time shifted version. In this case, how to find the identity and the Shifted time 'X' ?
To shorten the discussion: cross-correlation ist the proper name for that.
Looking at the oscilloscope to find similarities or by using the ears is often "mission impossible". Cross-correlation even works with small, similar signals hidden in big noise.
The maximum of your cross-correlation function gives you the index x at which the best match (similarity) of two signals occur. If you have more than one significant maximum (some relative maxima) then the signals have more than one similar part. And - to complete the confusion - if the absolute maximum is found in the negative area, then the signals are similar but with a 180° phase shift.
we supposed use Matlab Function xcorr. we find some value after this value we will inject in some classifier, how i can find the difference between a data correlated.