# Proving the upper bound of cross correlation

I am reading about cross-correlation from this document and equation (5) states that

The maximum value of the crosscorrelation is not always when the shift equals zero; however, we can prove the following property revealing to us what value the maximum cannot exceed $$R_{xy}(\tau) \le \sqrt{R_{xx}(0)R_{yy}(0)}$$

However, I could not find any proof for this equation. Does anyone have a resource regarding this property?

• I think this is done using the cauchy schwartz inequality. Start with E[(x - y)^2] – FourierFlux Sep 4 '20 at 4:06

The document cited by the OP actually states that $$|R_{X,Y}(\tau)| \leq \sqrt{R_X(0)R_Y(0)}\tag{1}$$ which implies what the OP wants to prove, namely that $$R_{X,Y}(\tau) \leq \sqrt{R_X(0)R_Y(0)}$$ but also tells us that $$R_{X,Y}(\tau) \geq -\sqrt{R_X(0)R_Y(0)}$$.
Recall that for jointly wide-sense stationary processes (which are, of course, individually wide-sense stationary too and thus have constant (possibly nonzero) means $$\mu_X$$ and $$\mu_Y$$), the definitions of the functions in $$(1)$$ are $$R_X(\tau)\stackrel{\Delta}{=} E[X(t)X(t+\tau)],\quad R_Y(\tau)\stackrel{\Delta}{=} E[Y(t)Y(t+\tau)],\quad R_{X,Y}(\tau)\stackrel{\Delta}{=} E[X(t)Y(t+\tau)]$$ where, because of the wide-sense stationarity assumption, the functions depend only on $$\tau$$, and not upon $$t$$. Note also that the means $$\mu_X$$ and $$\mu_Y$$ of the random processes are not involved at all, much to the sorrow of those who prefer to demean their processes before calculating correlations and thus end up with the autocovariance and cross-covariance functions instead of autocorrelation functions and cross-correlation functions as they are defined and understood in the communications and signal processing literature.
Now consider the quantity $$E\left[(\alpha X(t)\pm\beta Y(t+\tau))^2\right] = \alpha^2 R_X(0)+\beta^2 R_Y(0) \pm 2\alpha\beta R_{X,Y}(\tau)$$ which, being the expected value of a nonnegative random variable, must be nonnegative for all choices of real numbers $$\alpha$$ and $$\beta$$. Thus, $$\pm 2\alpha\beta R_{X,Y}(\tau) \leq \alpha^2 R_X(0)+\beta^2 R_Y(0)\quad \forall ~\alpha, \beta$$ or equivalently, for every possible choice of positive real numbers $$\alpha$$ and $$\beta$$, it must be that $$2\alpha\beta |R_{X,Y}(\tau)| \leq \alpha^2 R_X(0)+\beta^2 R_Y(0). \tag{2}$$ Choosing $$\alpha^2 = \frac 12 \sqrt{\frac{R_Y(0)}{R_X(0)}}, \quad \beta^2 = \frac 12 \sqrt{\frac{R_X(0)}{R_Y(0)}}$$ so that $$\alpha^2\beta^2=\frac 14$$, we see that Eq.$$(2)$$ reduces to $$|R_{X.Y}(\tau)| \leq \frac 12 \sqrt{R_X(0)R_Y(0)} + \frac 12 \sqrt{R_X(0)R_Y(0)}$$ which is $$(1)$$.
• @markleeds The correlation coefficient $\rho$ of two random variables is a scaled covariance; the autocorrelation function $R_X(\tau)$ (in the meaning generally accepted on dsp,SE) of a wide-sense-stationary random process is not a scaled autocovariance function: $C_{X}(\tau)$ equals $R_X(\tau) - \mu_X^2$, not $aR_X(\tau)$ for some positive constant $a$. – Dilip Sarwate Sep 6 '20 at 14:00