# What is the meaning of positive and negative shift in signal correlation?

If $$x(t)$$ and $$y(t)$$ are real valued signal then from this page cross correlation between them is defined as

\begin{align} R_{XY}(\tau) &= \int_{-\infty}^{\infty}x(t)y(t-\tau) dt\quad\text{+ve shift}\tag{1a}\\ R_{XY}(\tau) &= \int_{-\infty}^{\infty}x(t+\tau)y(t) dt\quad\text{-ve shift}\tag{1b}\\ \end{align}

I tried to solve a problem where $$x(t) = e^{-at}u(t)$$ and $$y(t) = e^{-bt}u(t)$$.

From $$(1a)$$: Positive shift

\begin{align} R_{XY}(\tau) &= \int_{-\infty}^{\infty}x(t)y(t-\tau)dt\\ &= \int_{-\infty}^{\infty}e^{-at}e^{-b(t-\tau)}u(t)u(t-\tau)dt\tag{2} \end{align} For $$\tau\geq0$$. Limits of integration will be from $$\tau\leq t\leq\infty$$. Hence from $$(2)$$ after simplification integration can be written as \begin{align} R_{XY}(\tau) &= \int_{\tau}^{\infty}e^{-at}e^{-b(t-\tau)}dt\\ &=e^{b\tau}\int_{\tau}^{\infty}e^{-(a+b)t}dt\\ &=\frac{e^{-a\tau}}{a+b} \end{align} For $$\tau\leq0$$. Limits of integration will be from $$0\leq t\leq\infty$$. Hence from $$(2)$$ after simplification integration can be written as \begin{align} R_{XY}(\tau) &= \int_{0}^{\infty}e^{-at}e^{-b(t-\tau)}dt\\ &=-\frac{e^{b\tau}}{a+b}\int_{0}^{\infty}e^{-(a+b)t}dt\\ &=\frac{e^{b\tau}}{a+b} \end{align} Therefore \begin{align} R_{XY}(\tau)=\begin{cases} \frac{e^{-a\tau}}{a+b}; \tau\geq0\\ \frac{e^{b\tau}}{a+b}; \tau\leq0 \end{cases}\tag{3} \end{align}

From $$(1b)$$: Negative shift

\begin{align} R_{XY}(\tau) &= \int_{-\infty}^{\infty}x(t+\tau)y(t)dt\\ &= \int_{-\infty}^{\infty}e^{-a(t+\tau)}e^{-bt}u(t+\tau)u(t)dt\tag{4} \end{align} For $$\tau\geq0$$. Limits of integration will be from $$0\leq t\leq\infty$$. Hence from $$(4)$$ after simplification integration can be written as \begin{align} R_{XY}(\tau) &= \int_{0}^{\infty}e^{-a(t+\tau)}e^{-bt)}dt\\ &=e^{-a\tau}\int_{0}^{\infty}e^{-(a+b)t}dt\\ &=\frac{e^{-a\tau}}{a+b} \end{align}

Corrected my analysis after @Fat32 answer

For $$\tau\leq0$$. Limits of integration will be from $$-\tau\leq t\leq\infty$$. Hence from $$(4)$$ after simplification integration can be written as \begin{align} R_{XY}(\tau) &= \int_{-\tau}^{\infty}e^{-a(t+\tau)}e^{-bt)}dt\\ &=e^{-a\tau}\int_{-\tau}^{\infty}e^{-(a+b)t}dt\\ &=\frac{e^{b\tau}}{a+b} \end{align} Therefore \begin{align} R_{XY}(\tau)=\begin{cases} \frac{e^{-a\tau}}{a+b}; \tau\geq0\\ \frac{e^{b\tau}}{a+b}; \tau\leq0 \end{cases}\tag{5} \end{align}

Hence from $$(3)$$ and $$(5)$$ as can be seen the result match. If my analysis is wrong do correct me and if its correct then what does these negative and postive shift signifies?

On substituting $$u = t - \tau \Rightarrow t = u + \tau \Rightarrow dt = du$$ in $$(1a)$$, we get $$(1b)$$ as \begin{align} R_{XY}(\tau) &= \int_{-\infty}^{\infty}x(u+\tau)y(u) du = \int_{-\infty}^{\infty}x(t+\tau)y(t) dt\\ \end{align}

Hence

\begin{align} R_{XY}(\tau) &= \int_{-\infty}^{\infty}x(t)y(t-\tau) du = \int_{-\infty}^{\infty}x(t+\tau)y(t) dt\\ \end{align}

It is clear that both definitions are identical. This is most easily seen by using substitution:

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

Now set $$\xi=t-\tau$$, and you get

$$R_{XY}(\tau) = \int_{-\infty}^{\infty}x(\xi+\tau)y(\xi) d\xi\tag{2}$$

which is identical to your Equation $$(1b)$$.

• Yes @Matt L. I too tried doing that and got the results. Thanks for your time. – Meet Feb 3 '19 at 8:53

Your Eq(3), for positive shift, is correct. And your Eq(5), for negative shift, should also be the same, but is wrong for $$\tau < 0$$ case.

The lower limit of the integral in Eq(4) should be $$-\tau$$ but you took it $$\tau$$. The reason is the step function $$u(t+\tau)$$ will have the nonzero range for $$t > -\tau$$.

You will get the same result with the correct limit.

• Thanks for pointing out the mistake. I've corrected my mistake in analysis. So it comes out to be the same for both positive and negative correlation definition. But what does it signifies? Or it is just another way of calculating. – Meet Feb 3 '19 at 8:16
• because of the infinite limits on the correlation integrals, the two different way of expressing correlation are mathematically the same. – robert bristow-johnson Feb 3 '19 at 8:46