# Calculation of an autocorrelation function

A sample of a random process is given as:

$$x(t) = A\cos(2\pi f_0t) + Bw(t)$$

where $w(t)$ is a white noise process with $0$ mean and a power spectral density of $\frac{N_0}{2}$, and $f_0$, $A$ and $B$ are constants. Find the auto-correlation function.

Here's my attempt at a solution:

Let $a = 2\pi f_0t$, and $b = 2\pi f_0(t+\tau)$

\begin{align} \text{Autocorrelation of } x(t) & = E\left\{x(t)x(t + \tau)\right\}\\ & = E\left\{\left(A\cos(a) + Bw(t)\right)\left(A\cos(b) + Bw(t+\tau)\right)\right\}\\ & = E\{A^2\cos(a)\cos(b) + AB\cos(a)w(t+\tau) + AB\cos(b)(wt)\\&\quad + B^2w(t)w(t+\tau)\}\\ & = E\left\{A^2\cos(a)\cos(b)\right\} + E\left\{AB\cos(a)w(t+\tau)\right\} + E\left\{AB\cos(b)(wt)\right\}\\&\quad + E\left\{B^2w(t)w(t+\tau)\right\}\\ & = E\left\{A^2\cos(a)\cos(b)\right\} + E\left\{B^2w(t)w(t+\tau)\right\}\\ & = E\left\{A^2\cos(a)\cos(b)\right\} + B^2\left(R_w(\tau)\right)\\ & = E\left\{A^2\cos(a)\cos(b)\right\} + B^2\left(\frac{N_0}{2}\right)(\delta(\tau))\\ \end{align}

The expectation terms with the noise in them all equal $0$ (the last is just the auto correlation of white noise ... hence the simplification above. Using trigonometric identities: $$\cos(a)\cos(b) = \frac 12\left[\cos(a + b) + \cos(a - b)\right]$$

we have:

\begin{align} \text{Autocorrelation of } x(t) & = E\left\{A^2\cos(a)\cos(b)\right\} + B^2\left(\frac{N_0}{2}\right)(\delta(\tau))\\ & = E\left\{\left(A^2\right)\frac 12\left[\cos(a+b)+\cos(a-b)\right]\right\} + B^2\left(\frac{N_0}{2}\right)(\delta(\tau))\\ & = \left(\frac{A^2}{2}\right)\left[E\{\cos(a+b)\} + E\{\cos(a-b)\}\right] + B^2\left(\frac{N_0}{2}\right)(\delta(\tau))\\ \end{align}

We're dealing with constant terms, so expectation term goes away and subbing in our initial conditions we get: $$\frac {A^2}2 \left[\cos(2\pi f_o(2t + \tau) + \cos(2\pi f_o\tau)\right] + B^2\left(\frac{N_0}{2}\right)(\delta(\tau))$$

For some reason I can't help but feel I did something incorrectly calculating that autocorrelation ... it's supposed to be a function of $\tau$, but has a $t$ is in there ... I would very much appreciate it if someone could point me in the right direction, or explain what I messed up. I don't know whether it matters, but in this class we're dealing with only wide sense stationary processes.

• Unless you are sure that the random process $x(t)$ is WSS, you should not expect its ACF to be a function of $\tau$ alone. Therefore it seems correct here to include terms of time $t$. But I think that cosine term inside $x(t)$ might include either a random amplitude or a random phase that you forget to type, then you may have a chance to get rid of the time element $t$ if you wish so much so... Apr 17 '16 at 16:03
• The process $\{A\cos(2\pi f_0t)\}$ is a cyclostationary process (satisfies the stationarity requirements for those time-offsets that are multiples of $(2\pi f_0)^{-1}$) and not a WSS process at all. Note, for example, that even the mean function $E[x(t)]$ is not a constant as it should be for a WSS process. As @Fat32 says (+1) , you might have forgotten to include a random phase $\Theta$ in your $x(t)$ definition (the needed property for WS stationarity is that $E[\cos(2\Theta)]=E[\sin(2\Theta)]=0$ which holds for $\Theta\sim U(0,2\pi)$ or $P\{\Theta=n\pi/2\}=\frac 14$ for $n=0,1,2,3$). Apr 17 '16 at 19:23

I guess you've done almost everything right, but have a problem at the calculation of the expectation value regarding $t$. You should calculate the expectation value of the cosine function. Sadly, it does not simply "go away" as you wrote.

Have a look at the Wikipedia page. There you can find another, more explicit, formula for the auto-correlation function of a function $f(t)$:

$R_{\textrm{ff}}(\tau) = \int\limits_{-\infty}^\infty f(t+\tau)\bar{f}(t) \, \textrm{d}t$ .

(Note, that compared to the Wikipedia page, I have taken the liberty to use the variable $t$ in the integration instead of $u$, which would be the mathematically more accurate version.)

As you can see from this equation, you "integrate away" the dependency on t, and indeed you should be left with a function that is independent of $t$.

Note that there is also an version that does not go to infinite times, but is constrained to a period $T$. Maybe this version is more appropriate in your case. However, the same holds for this version: $t$ is integrated away and should not be a variable in the resulting formula.

• You are mixing up two different notions when you write "As you can see from this equation, you "integrate away" the dependency on $t$, and indeed you should be left with a function that is independent of $t$" Apr 18 '16 at 1:55
• You can also take the formula from the Wikipedia page without $t$ and write $R_\textrm{ff}(\tau) = \int\limits_{-\infty}^\infty f(u+\tau)\bar{f}(u)\,\textrm{d}u$. The important thing here is in both cases that the argument of the function $f$ is t and is integrated over - hence you do not have the $t$ in the end result anymore, but only $\tau$.
– M529
Apr 18 '16 at 7:49
• @Dilip You may also have a look here ocw.mit.edu/courses/mechanical-engineering/… - this is basically the first result after a simple google search. There, on page 22-2 (page 3 in the PDF) is an example for an autocorrelation function, which was calculated by this formula and is independent of $t$. Also you can find the mathematically not so sound integral notation on the previous page.
– M529
Apr 18 '16 at 7:54
• Far be it from me to question the validity of a formula that you claim can be found on Wikipedia or is taught in an MIT online course, but it seems to me that in \begin{align}2\int_{-\infty}^\infty\cos(2\pi f_0t)\cos(2\pi f_0(t+\tau))dt&=\int_{-\infty}^\infty\cos(2\pi f_0(2t+\tau))+\cos(2\pi f_0\tau)dt\\&=\int_{-\infty}^\infty\cos(2\pi f_0(2t+\tau))dt+\int_{-\infty} \infty\cos(2\pi f_0\tau)dt\end{align} that second integral on that second line (whose integrand is a constant w.r.t. $t$) diverges unless $\tau$ happens to have a value such that $\cos(2\pi f_0\tau)=0$. Apr 18 '16 at 13:07
• @Dilip You are correct, this integral diverges. Not even the first integral is meaningful, since it does not converge. For this reason, there is the last paragraph in my answer.
– M529
Apr 18 '16 at 14:25