Cross-Correlation : Comparing two signals or finding the location of a target

I read across places that cross-correlation of two signal (a radar sending a signal and receiving it back) one can detect the location (distance) of a target from a point and that cross-correlation can be used for comparing signals.

I solved a question to find cross-correlation of two finite length sequences where:

x(l)={1,2,1,1}
y(l)={1,1,2,1}


The cross-correlation sequence came as:

{1,4,6,6,5,2,1}


The answer was also correct as per my verification.

But I am not able to understand how using the above cross-correlation sequence value I can state it to be used for -

a)location of a target? b)comparing signals x and y?

Your example would be more illuminating for you if you did this:

x(l)={1,2,1,1}

y(l)={0,0,0,0,0,0,0,1,2,1,1}

The peak of the crosscorrelation would then tell you how far into y(1) the contents of x(1) are. If x(1) represents a radar pulse, then y(1) represents the received reflection. The peak of the cross correlation then tells you how long it took for the reflection to return. This tells you how far away the obect that reflected your signal - you then know where that object is.

Cross correlating also tells you how similar two signals are. The higher the peak, the more the two signals are alike.

Try these to see what I mean:

These have a relatively low peak

x(l)={1,2,0,0}

y(l)={0,1,1,1}

compared to this next set which has a relatively high peak:

x(l)={1,2,0,0}

y(l)={1,2,0,0}

• I understand what you have stated but - "The higher the peak, the more the two signals are alike.", is there a way that we can measure comparatively or quantitatively. Is there no range or absolute value to state that peak? – Programmer Aug 14 '14 at 15:01
• The cross correlation method can be done so as to scale the results to be between 1 and -1. Where 1 is maximum correlation, 0 is no correlation, and -1 is maximum correlation with the inverse of one of the signals. For a correlation of -1 you would need something like x(l)={1,2,1,1} and y(l)={-1,-2,-1,-1} – JRE Aug 14 '14 at 15:23