The context is as follows: I want to measure (as in, digitize) some input signal $x$ (I have no detailed knowledge about $x$ or its statistical description).
A noise signal $x_N$ contaminates $x$ before I digitize it. That is, the signal I read is: $x' = x + H_1(x_N)$, where $H_1$ is some unknown filter (let's assume linear, but possibly time-varying).
I have access to $x_N$ (for example, $x_N$ could be the "mains" voltage, or the ripple voltage in my power supply). I want to cancel the noise component in $x'$ to obtain the best estimate of $x$. This estimate $\hat{x}$ is obtained by subtracting a filtered version of the noise: $$\hat{x} ~=~ x' - \;H(x_N)$$
where $H$ is my adaptive filter. The best estimate is that with minimum power (as a function of the filter coefficients), since the noise and the true signal are uncorrelated.
My algorithm aims to minimize $\left(\hat{x}\right)^2$. At time step $n$, I have: $$\left(\hat{x}(n)\right)^2 = {\left( x' - \sum_{k=0}^L h_k \, x_N(n-k) \right)}^2$$ To obtain the gradient, I take: $$\frac{\partial \left(\hat{x}(n)^2\right)}{\partial h_k} = -2 \, \hat{x}(n)\; x_N(n-k)$$ And presumably voilà: each $h_k$ at step $n$ is updated by adding $\mu$ times the above expression to the estimate of $h_k$ at step $n-1$.
Question 1: Does the above make sense?
Question 2: Rather, a concern when I look at the math above --- intuitively, I expect the gradient's magnitude to approach zero as the system gets close to the solution (the optimal filter), but that doesn't seem the case from the equation above: the gradient is a copy of the last $L$ samples of $x_N$ (which in principle has non-zero mean), scaled by the present value of the output (which also, in principle has non-zero mean).
Am I doing something wrong?