Iterative Blind Sinus Signal Suppression There are two real signals in the form of $A_i sin(wt+p_i), i=1,2$. Suppose frequency $w$ of both the signals is the same and amplitude $A_i$ and phase $p_i$ are different. The first signal has unknown $A$ and $p$, but they are constant in the time of observation (for simplicity only, actually they aren't). The second signal is under control. We only have it's difference $x(t) = s_1(t)-s_2(t)$. Some iterative algorithm is needed to minimize power of $x(t)$. So $x(t)$ is available input and $A_2(t)$, $p_2(t)$ are parameters under control. 

The question is: is it some robust and rapid algorithm for jointly control both amplitude and phase to minimize power of $x(t)$? My idea was to implement complex gradient method: phase and amplitude at each step are represented as a complex number $C(t)$. Signal $s_2(t)$ can be set as $Re[C(t) exp(iwt)]$. But I can't understand how to define cost function and gradient in this case and also this approach seems to be computationally redundant. Any ideas?

Thanks in advance!
I assume you do everything in discrete time. If I understood correctly then the observed signal is

$$x(n)=s(n)-A\sin(\omega_0n+\phi)$$

where $s(n)$ is a sinusoidal signal with frequency $\omega_0$ and unknown amplitude and phase. The parameters $A$ and $\phi$ are to be optimized such that the power of $x(n)$ is minimized. In a real-time algorithm you can define the cost function as the sum of $x^2(n)$ over a fixed length $N$:

$$F(A,\phi,n)=\sum_{k=n-N+1}^{n}x^2(k)$$

where $n$ is the current sample. For a steepest descent algorithm you need the gradient:

$$\frac{\partial F}{\partial A}=-2\sum_{k=n-N+1}^{n}x(k)\sin(\omega_0k+\phi)\\
\frac{\partial F}{\partial \phi}=-2A\sum_{k=n-N+1}^{n}x(k)\cos(\omega_0k+\phi)$$

The parameters are now updated in the following way:

$$A_n=A_{n-1}-\mu\frac{\partial F_{n-1}}{\partial A}\\
\phi_n=\phi_{n-1}-\mu\frac{\partial F_{n-1}}{\partial \phi}$$

where $\mu$ is the step size. Note that in every iteration you need to recompute the gradients with the current values of $A$ and $\phi$.

The figure below is a simulation of this gradient algorithm with the unknown signal $s(n)=2\sin(\pi n/3+\pi/2)$, $N=50$, $\mu=0.01$, and with zero initialization of both amplitude and phase (amplitude $A$ in blue, phase $\phi$ in green).