# Two different definitions of cross-correlation

I have come across two different definitions of the cross-correlation function:

$$R_{XY}(\tau) = \int_{-\infty}^{+\infty} x(t) y(t+ \tau) dt$$

and

$$R_{XY}(\tau) = \int_{-\infty}^{+\infty} x(t) y(t- \tau) dt$$

Are these two definitions equal?

Also is $$R_{XY}(\tau) = R_{YX}(\tau)$$?

• You can answer both questions yourself! try setting $x(t)=y(t)=u(t)$, i.e. the unit step function, which is $$u(t)=\begin{cases}0&t<0\\1 &t\ge0\end{cases}\text.$$ You'll notice one of the definitions is wrong, at least for the complex case. Nov 17, 2018 at 12:01
• Regarding the second question: you should really be asking this in a separate question, but: You're only giving the correlation formulas for real-valued signals. For these, $R_{XY}=R_{YX}$. But: in signal processing, very often, you consider complex-valued signals, and then, no. But: again, this is something that feels like your homework to prove yourself. Even if it's not, try proving it yourself! It's not hard. Nov 17, 2018 at 12:04
• Even after i substitute x(t) and y(t) as u(t) in both the definitons, what am I looking for? I get two integrals both $\infty$ Nov 17, 2018 at 12:15
• Regarding the second question, considering real valued signals, I get $R_{XY}(\tau) = R_{YX}(-\tau)$ which i think is correct. Nov 17, 2018 at 12:19

The first definition is the more common one. In its more general form it should read

$$R_{XY}(\tau)=\int_{-\infty}^{\infty}x^*(t)y(t+\tau)dt\tag{1}$$

which also holds for complex-valued signals ( $$^*$$ denotes complex conjugation). If we use $$\tilde{R}_{XY}(\tau)$$ to denote the function defined by the second equation (and if we assume conjugation of $$x(t)$$ as in $$(1)$$), then we simply have

$$R_{XY}(\tau)=\tilde{R}_{XY}(-\tau)\tag{2}$$

So the difference between the two definitions is trivial and just a matter of convention. However, they are obviously not the same, because we have

$$R_{XY}(\tau)=R^*_{YX}(-\tau)\tag{3}$$

and, consequently,

$$\tilde{R}_{XY}(\tau)=R^*_{YX}(\tau)\tag{4}$$

Note that for the auto-correlation (i.e., if $$x(t)=y(t)$$), both definitions are equivalent:

$$R_{XX}(\tau)=\tilde{R}_{XX}(\tau)\tag{5}$$

As a final note, that definition for the cross-correlation (and auto-correlation) is only useful for signals with finite energy. There are other definitions for power signals, and for random processes.

• In Equation 5 you mean $R_{XX}(\tau) = \tilde{R}_{XX}(\tau)$ right? Nov 17, 2018 at 20:45
• @0xcrab: Yes, that was a typo, I corrected it. Nov 17, 2018 at 21:36

$$R_{XY}(\tau) = \int_{-\infty}^{+\infty} x(t) y(t+ \tau) dt$$

Then it follows:

$$R_{YX}(\tau) = \int_{-\infty}^{+\infty} y(t) x(t+ \tau) dt$$

Let $$s = t+ \tau$$:

$$R_{YX}(\tau) = \int_{-\infty}^{+\infty} y(s -\tau ) x(s ) ds$$

Reverse the product and substitute $$t$$ for $$s$$:

$$R_{YX}(\tau) = \int_{-\infty}^{+\infty} x(t ) y(t -\tau ) dt$$

Now it is pretty clear that

$$R_{XY}(\tau) = R_{YX}(-\tau)$$

The question of odd or even is irrelevant because they are not the same function.

Note: Your second function is assumed to be $$R_{YX}(\tau)$$, otherwise your are simply giving contradictory definitions to the same function.