[![enter image description here](https://i.stack.imgur.com/C8DoS.png)](https://i.stack.imgur.com/C8DoS.png)

The goal is to find the FIR filter coefficients $\mathbf{h} = [5;3]$ with the help of the adaptive FIR filter $\mathbf{w}$ of order $p = 2$.

I have implemented the Stochastic approximation algorithm in MATLAB for this adaptive system identification problem.

$\mathbf{w}[k] = \mathbf{w}[k-1] + (1/k) \cdot \mathbf{x}[k] e[k]$ 

As input sequence I use white gaussian noise with zero mean and variance of 1.
Measurement noise is also WGN with variance of 1.

$N = 1000 $ ... number of measured datapoints

For the input sequence above my algorithm works fine and converges and I find the right $\mathbf{w}$.

However if I change my input sequence to $x[k] = 0.1 \cdot \cos(\pi k /(N/10))$ my algorithm doesn't find the right coefficients.

So my question is:

Is the Stochastic approximation algorithm restricted to special input sequences, and if so what is the optimal input sequence to use?