I recently started going through some lecture notes on linear systems and Fourier optics. (By the way, I just started with these, but so far the lecture notes are excellent. If anyone is looking to learn the subject but doesn't want to spend money on a textbook, the lecture notes, and the videos of the lectures, can be found at https://itunes.apple.com/us/itunes-u/opti512r-linear-systems-fourier/id413140966?mt=10).

In lecture 5, it says,

Does anyone know, in what sense is this integral a measure of the similarity between [itex]f[/itex] and [itex]g[/itex]?

I'm looking for both conceptual answers, i.e., an intuitive sense of why this integral corresponds to similarity, and quantitative answers, i.e., if the integral evaluates to this, [itex]f[/itex] and [itex]g[/itex] are "similar", but if it evaluates to that, then [itex]f[/itex] and [itex]g[/itex] are "dissimilar".

This formula can be used to see how much the functions ##g## and ##f## match. Indeed, this integral will be maximized if ##f=g##. In a formal sense, we have

and equality holds if ##f=g##. So if we get a "high" value for this, then the functions match a lot, otherwise, they don't match a lot.

But now let's look at ##\sin## and ##\cos##. They certainly are not the same functions, but they are similar. In fact, they are the same function up to a phase factor. Indeed,

[tex]\sin(\alpha) = \cos(\alpha - \pi/2)[/tex]

The cross-correlation function is used to deal with this case. So by definition, we have

So for any phase constant, what this does is translate ##g## by that phase constant and then measure the similarity of the functions.

As such, we get several values, one for each ##x##. So we get the function ##(f\ast g)##. High values of this function indicate that ##f## and the translated ##g## match a lot, low values that they don't match a lot. So the cross-correlation can be used to indicate by how much we should translate a function for them to match.

I understand - like functions will be in the same quadrant of the complex plane (or even better, "point" in the same direction in the complex plane) at the same time, or restricting ourselves to real functions, like functions will be positive or negative at the same time. This results in (ignoring the [itex]-x[/itex] for the moment) higher values of the given integral, since [itex]f\times g^{*}[/itex] will be positive if [itex]\mathrm{Re}(f)/\mathrm{Im}(f) = \mathrm{Re}(g)/\mathrm{Im}(g)[/itex]. Unlike functions won't be expected to point in the same direction in the complex plane at the same time, resulting in lower values for the given integral. Throwing the [itex]-x[/itex] back in there, we have a variable that can be adjusted to increase or decrease the similarity.

So, similarity in this sense means "degree to which the two functions point in the same direction in the complex plane".