# Finding the auto-correlation sequence $r_{xx}[k]$ for an AR(2) process

Consider the following recursive difference equation of a LTI system, where $v[n]$ is a white noise, zero-mean process with $\sigma_v^2 = 1$.

$x[n] = v[n] + 0.75x[n-1]-0.25x[n-2]$

I want to calculate the auto-correlation sequence $r_{xx}[k]$ for $k=0,1,2$. I started as follows:

$r_{xx}[k] = E\{(v[n] + 0.75x[n-1]-0.25x[n-2])(v[n-k] + 0.75x[n-k-1]-0.25x[n-k-2])\} \\ r_{xx} = E\{ v[n]^2 \} + 0.75^2 E\{ x[n-1]^2 \} - 2 \times 0.25 \times 0.75 E\{ x[n-1] x[n-2] \} + 0.25^2 E\{ x[n-2]^2 \} = \sigma_v^2 + \frac{5}{8} r_{xx} - \frac{3}{8}r_{xx}$

As you can see, in the equation for $r_{xx}$, a term with $r_{xx}$ remains. If I then want to determine $r_{xx}$, a term with $r_{xx}$ remains, and so on. How is it possible to solve this problem?

## 2 Answers

With

\begin{align}r_k=E\{x_nx_{n+k}\}&=E\{(v_n+\alpha x_{n-1}+\beta x_{n-2})x_{n+k}\}\\&=E\{v_nx_{n+k}\}+\alpha E\{x_{n-1}x_{n+k}\}+E\{x_{n-2}x_{n+k}\}\\&=\sigma_v^2+\alpha r_{k+1}+\beta r_{k+2}\tag{1}\end{align}

and with

$$r_k=r_{-k}$$

you can obtain $$3$$ equations

\begin{align}r_0&=\sigma_v^2+\alpha r_1+\beta r_2\\ r_1&=\alpha r_0+\beta r_1\\r_2&=\alpha r_1+\beta r_0\end{align}

from which you get

\begin{align}r_0&=\frac{\sigma_v^2(1-\beta)}{(1+\beta)[(1-\beta)^2-\alpha^2]}\\r_1&=\frac{\sigma_v^2\alpha}{(1+\beta)[(1-\beta)^2-\alpha^2]}\\r_2&=\frac{\sigma_v^2[\alpha^2+\beta(1-\beta)]}{(1+\beta)[(1-\beta)^2-\alpha^2]}\end{align}

With $$\sigma_v^2=1$$, $$\alpha=0.75$$ and $$\beta=-0.25$$, this evaluates to

$$r_0=\frac53,\; r_1=1,\; r_2=\frac13$$

From these values you can compute all other values $$r_k$$ using the recursion $$(1)$$.

We have $$\begin{equation} x[n] = v[n] + 0.75x[n-1]-0.25x[n-2] \end{equation}$$ You started correct, you get $$\begin{equation} \begin{split} r_{xx}[k] = E\{(v[n] + 0.75x[n-1]-0.25x[n-2])(v[n-k] + 0.75x[n-k-1]-0.25x[n-k-2])\} \\ \end{split} \end{equation}$$ You get 9 terms $$\begin{equation} \begin{split} r_{xx}[k] &= Ev[n]v[n-k] +0.75E x[n-k-1]v[n] - 0.25E x[n-k-2]v[n]\\ &+0.75 Ex[n-1]v[n-k] + 0.75^2Ex[n-1]x[n-k-1]+0.75(0.25)Ex[n-1]x[n-k-2]\\ &-0.25Ex[n-2]v[n-k] -0.75(0.25)Ex[n-2]x[n-k-1] + 0.25^2Ex[n-2]x[n-k-2] \end{split} \tag{1} \end{equation}$$ Since the noise is white then $$\begin{equation} Ev[n]v[n-k] = \delta(k)\sigma_v^2 = \delta(k) \end{equation}$$ Since $$k\geq 0$$, write down $$x[n-k-1]$$ and $$x[n-k-2]$$ do not contain lags that align with $$v[n]$$, so \begin{align} E x[n-k-1]v[n] &= 0\\ E x[n-k-2]v[n] &= 0 \end{align} On the other hand, $$Ex[n-1]v[n-k]$$ and $$Ex[n-2]v[n-k]$$, will agree for $$k = 1$$ and $$k=2$$ according to \begin{align} x[n-1]v[n-k] &= \overbrace{Ev[n-1]v[n-k]}^{\delta(k-1)} + 0.75\overbrace{ Ex[n-2]v[n-k] }^{\delta(k-2)}- 0.25\overbrace{Ex[n-3]v[n-k]}^{0} \\ x[n-2]v[n-k] &= \underbrace{Ev[n-2]v[n-k]}_{\delta(k-2)} + \underbrace{E(0.75x[n-3]-0.25x[n-4])v[n-k]}_{0} \end{align} So \begin{align} x[n-1]v[n-k] &= \delta(k-1) + 0.75\delta(k-2) \\ x[n-2]v[n-k] &= \delta(k-2) \end{align} The other four terms follow from the AR definition, i.e. \begin{align} E x[n-1]x[n-k-1] &= r_{xx}[n-1-n+k+1]= r[k] \\ E x[n-1]x[n-k-2] &= r_{xx}[n-1-n+k+2]= r[k+1] \\ E x[n-2]x[n-k-1] &= r_{xx}[n-2-n+k+1]= r[k-1] \\ E x[n-2]x[n-k-2] &= r_{xx}[n-2-n+k+2]= r[k] \end{align} Replacing all results in equation $$(1)$$, we get $$\begin{equation} \begin{split} r[k] &= \delta(k) +0.75\delta(k-1) + 0.75^2\delta(k-1) -0.25\delta(k-2)\\ &+0.75^2 r[k] +0.75(0.25)r[k+1]-0.75(0.25)r[k-1] + 0.25^2 r[k] \end{split} \end{equation}$$ which suggests that $$\begin{equation} 0.375r[k] = \delta(k) + 1.3125\delta(k-1) - 0.25\delta(k-2) +0.1875(r[k+1] - r[k-1]) \end{equation}$$ For $$k = 0$$, we get $$\begin{equation} 0.375r = \delta(0) + 1.3125\delta(-1) - 0.25\delta(-2) +0.1875(r[+1] - r[-1]) \end{equation}$$ we know that $$\delta(0) = 1$$ and $$\delta(-1) = \delta(-2) = 0$$. Also $$r = r[-1]$$ due to the fact that $$r[k]$$ is even $$\begin{equation} r =\frac{1}{0.375} \delta(0) = \frac{8}{3} \end{equation}$$ For $$k = 1$$, we get $$\begin{equation} 0.375r = 1.3125 + 0.1875(r - r) \end{equation}$$ which is (again because $$r[k]$$ is an even function) $$\begin{equation} 0.375r = 1.3125 + 0.1875(r - \frac{8}{3}) \tag{*} \end{equation}$$ and at $$k = -1$$ $$\begin{equation} 0.375r[-1] = 0.1875(r - r[-2]) \end{equation}$$ which is (again because $$r[k]$$ is an even function) $$\begin{equation} 0.375r = 0.1875(\frac{8}{3} - r)\tag{**} \end{equation}$$ Now solve the system of two equations in two unknowns $$(*),(**)$$ to get $$r,r$$, i.e. $$\begin{equation} \begin{bmatrix} 0.3750 & -0.1875\\ 0.3750 & 0.1875 \end{bmatrix} \begin{bmatrix} r\\ r \end{bmatrix} = \begin{bmatrix} 0.8125\\ 0.5000 \end{bmatrix} \end{equation}$$

• There must be a mistake somewhere because the end result is wrong. – Matt L. Sep 21 '18 at 11:29