Correlation : Cross correlation why we need to multiply the samples

I understand what books states about cross-correlation of signals and their mathematical representation:

For continuous functions f and g, the cross-correlation is defined as:

$(f \star g)(\tau)\ \stackrel{\mathrm{def}}{=} \int_{-\infty}^{\infty} f^*(t)\ g(t+\tau)\,dt$,

where $f*$ denotes the complex conjugate of $f$ and $\tau$ is the time lag.

Similarly, for discrete functions, the cross-correlation is defined as:

$(f \star g)[n]\ \stackrel{\mathrm{def}}{=} \sum_{m=-\infty}^{\infty} f^*[m]\ g[m+n]$

So I understand that for CT we always should do Integral and weighted sum for discrete functions. Am I correct in my understanding?

But my question is why we need to do signal samples multiplication to find cross-correlation - I mean how it is different from addition of samples or rather when we should do addition / multiplication of signals samples and what would it mean?

• You have two function values, and you need to do something with them: add, subtract, multiply, divide, exponentiate, square-and-then-add, conjugate-one-and-then-multiply-by-the-other, etc. Many people found that this last thing gave useful results and so the definition of cross-correlation that you have given was adopted by consensus. If you don't like it, go ahead and create a different definition and urge people to use your definition. If your definition has useful properties, they may come around to your point of view. If the properties are not useful, they won't. – Dilip Sarwate Aug 14 '14 at 8:22
• No @DilipSarwate that's not my point - my point is in what way does signal multiplication result sequence differs that of with signal addition. We know what addition / multiplication means and when to use them . We don't do addition when multiplication is required or reverse.As such does signal multiplication result sequence means - multiplying the area of one signal covered (if represented graphically) to other and addition means adding them? – user10810 Aug 14 '14 at 9:08

I am not entirely sure if I understood your question, so this might be completely irrelevant.

Why do we need to multiply and shift the signal samples: The objective of the cross-correlation operation between signal $x$ and signal $y$ is to find how well they correlate (resemble each other) and when they correlate the best. In other words, if $y$ is a delayed version of $x$ as in: $y = x(t - d)$, where $d$ is a positive time delay, then $y$ would appear identical to $x$ if $y$ was shifted by $d$ seconds to the left on the time axis.

What if we have no prior knowledge of the value of $d$? An approach would be to take $y$ and shift it by an amount $\tau$ to the left on the time axis. If we try this operation for an infinite range of $\tau$ values, would you agree with me that, at $\tau$ == $d$, the shifted $y$ signal would appear identical to the $x$ signal? That is more or less the justification for shifting the samples.

Now consider a signal $z$ given by $z = Ax(t-d)$, where $A$ is a scalar. $z$ is a scaled, and time-delayed version of $x$. During the shifting by $\tau$ operation in the previous paragraph, if you were to take the difference/sum of $z$ and $x$, the outcome would not be very informative if $A$ were very large. e.g if $A$ = 1000, the output difference/sum $R$ would not vary significantly over the range of possible $\tau$. What I mean is that $R$ would appear mostly flat, and you would not be able to figure out the value of the time delay $d$.

If you were to use division instead, how would you deal with the divisor signal being 0 sometimes? i.e. division by zero?

Multiplication is the best option, since relative amplitudes do not affect the results too much. You'll then get a peak in the cross-correlation output which will signify the time delay $d$.