# How to show that the signal $x_n = A\cos(\omega n)$ can be fully predicted by a system with two weights $w_1,w_2$

I am trying to solve the following exercise:

Show that the signal $x_n = A\cos(\omega n)$ can be fully predicted by a system with two weights $w_1,w_2$ (i.e. $x_n = w_1 x_{n-1} + w_2 x_{n-2}$). Find $w_1,w_2$.

Some ideas came up but, even if they are right, I can't seem to order them in the right direction:

1. I can see that $x'' = -\omega^2x$. Does it connected somehow to what is asked?

2. I guess it has something to do with stationary signals. If yes, how can I prove that this signal is stationary? (Also, somehow I can't find in the internet a clear definition of "stationary signal". Just vague ideas like "not dependant on time". What does this mean mathematically for a signal to be "not dependant on time"?)

3. Maybe it is concerned with some trigonometry of this form: \begin{align} x_{n+2} &= A\cos((n+2)\omega) \\ &= A\cos(n\omega + 2\omega) \\ &= A\cos(n\omega)\cos(2\omega) - A\sin(n\omega)\sin(2\omega) \\ &= B\cos(n\omega) + C\sin(n\omega)\end{align} I could go on with this development but I am realy not sure what am I looking for..

Any help? Thanks!

• Write the system's equation with the cosine output and with two different values of $n$. That gives you two different equations relating the coefficients so you can solve the two coefficients. It's a well-known system: en.wikipedia.org/wiki/Goertzel_algorithm – Olli Niemitalo Mar 23 '16 at 17:15

HINT:

Use

$$2\cos(x)\cos(y)=\cos(x+y)+\cos(x-y)$$

with $x=(n-1)\omega$ and $y=\omega$.

• is $\omega$ known in advance? – robert bristow-johnson Mar 24 '16 at 3:40
• @robertbristow-johnson: I guess so, otherwise I don't think the exercise makes sense in its current form. The recursion is basically the recurrence relation of a simple digital oscillator. – Matt L. Mar 24 '16 at 9:17

Consider this: $$\cos(\omega n) = W_1 \cos(\omega{(n-1)}) + W_2 \cos(\omega{(n-2)})$$

Expand expand both the cos terms in the above expression and start comparing the like terms on both left and right hand side of the equation. Two equations for $W_1$ and $W_2$ can be obtained.

Solving these will show that $W_1$ and $W_2$ take real values and hence it is possible to predict the system with only two weights.