# Reconstructing a wave which interferes together with a second known one

Is it possible to calculate one of two interfering waves, if the interference (the sum) $$v$$ and the other wave (summand) $$v_1$$ is known? The waves have same frequency but may differ in phase and amplitude.

I have found the formulas for the interference (the sum) but my algebra/analytical skills are not good enouth to recognize if there is a explicit solution. There are two unknown variables and four known variables in the formula.  If there is a explicit solution, could someone please show me the formula for it.

Edit:

I look for the amplitude $$A_2(t)$$ and phase $$\varphi_2(t)$$ of the following equation in a time discrete, embedded system.

$$v(t)=v_1(t)+v_2(t) =Acos(\omega t+\varphi)=A_1cos(\omega t+\varphi_1)+A_2cos(\omega t+\varphi_2)$$ When subtracting $$v_1(t) \text{ from } v(t)$$ I get a term with amplitude $$A_2$$ and phase $$\varphi_2$$ not separable because both are unknown. $$v_2(t)=v(t)-v_1(t)=A_2cos(\omega t+\varphi_2)=Acos(\omega t+\varphi)-A_1cos(\omega t+\varphi_1)$$

• Better suited for Math.SE Feb 5 at 13:43
• You need to define your signals $v_1(t)$ and $v_2(t)$. You have 2 terms on the left and 3 on the right. Feb 6 at 1:49
• please check my edit, I actually solved this nightmare. This is ugly, you should go for the newton method if you don't need to have an explicit formula. Feb 6 at 17:26
• I did some more editing in hope it gets clearer for you to read. I hope I didn't make sign errors ! Feb 6 at 17:51

Let us define $$f: \begin{bmatrix} a_2\\ \phi_2 \end{bmatrix}\mapsto \begin{bmatrix} f_1(a_2, \phi_2)\\ f_2(a_2, \phi_2) \end{bmatrix} = \begin{bmatrix} \sqrt{a_1^{2}+a_2^{2}+a_1 a_2 cos(\phi_1 - \phi_2)}-A\\ \frac{a_1 sin(\phi_1)+a_2 sin(\phi_2)}{a_1 cos(\phi_1)+a_2 cos(\phi_2)}-tan(\phi) \end{bmatrix}$$ where $$a_1, \phi_1, A, \phi$$ are supposed to be known. Then I'd go for numerical tools such as the Newton method. First you need find a way to compute your gradient, either analytically or numerically compute the gradient matrix, here $$G(a_2, \phi_2) = \begin{bmatrix} \frac{\partial f_1}{\partial a_2}(a_2, \phi_2) & \frac{\partial f_1}{\partial \phi_2}(a_2, \phi_2)\\ \frac{\partial f_2}{\partial a_2}(a_2, \phi_2) & \frac{\partial f_2}{\partial \phi_2}(a_2, \phi_2)\\ \end{bmatrix}$$

Then you enter the algorithm. You need to find an initial seed as close as you can to the solution ($$X_0 = \begin{bmatrix}a_1\\ \phi_1\end{bmatrix}$$ in our case for instance) and do in a loop : $$X_{k+1} = X_{k} - G(X_k)^{-1}f(X_k)$$

and if you just want the result, this might do the trick for you.

EDIT : apparently you want to go full analytical. Let us use the second of your equations. We have, after some regrouping: $$a_1(tan(\phi)cos(\phi_1)-sin(\phi_1)) = a_2(sin(\phi_2)-tan(\phi)cos(\phi_2))$$ by remarking that: $$sin(\phi_2)-tan(\phi)cos(\phi_2) = -\sqrt{1+tan^{2}(\phi)}[\frac{tan(\phi)}{\sqrt{1+tan^{2}(\phi)}}cos(\phi_2)-\frac{1}{\sqrt{1+tan^{2}(\phi)}}sin(\phi_2)]$$ we can, by setting $$\theta = arctan(1/tan(\phi))$$ get $$cos(\theta) = \frac{tan(\phi)}{\sqrt{1+tan^{2}(\phi)}}$$ and $$sin(\theta) = \frac{1}{\sqrt{1+tan^{2}(\phi)}}$$. Then by using the $$cos(\phi_2+\theta)$$ development formula backwards we get : $$a_2cos(\phi_2+\theta) = -\frac{a_1(tan(\phi)cos(\phi_1)-sin(\phi_1))}{\sqrt{1+tan^{2}(\phi)}}$$. We will call the right hand factor $$m$$ for the sake of brevity. Note that is does not depend on $$\phi_2$$ nor $$a_2$$. So we have $$a_2cos(\phi_2+\theta) = m \tag{1}\label{eq1}$$ Note how $$m$$ does not depend on $$\phi_2$$ nor $$a_2$$ (that was the point). The other equation of your post can be squared and put under the form : $$a_2^{2}+2a_1a_2cos(\phi_2-\phi_1) = A^{2}-a_1^{2}$$ Now if we develop the cosine and use \eqref{eq1}, we get $$2a_1a_2cos(\phi_2-\phi_1)=2a_1a_2cos((\phi_2+\theta)-(\phi_1+\theta))$$ $$=2a_1a_2[cos(\phi_2+\theta)cos(\phi_1+\theta)+sin(\phi_2+\theta)sin(\phi_1+\theta)]$$ $$=2a_1mcos(\phi_1+\theta)+[2a_1sin(\phi_1+\theta)]$$

Note how $$2a_1mcos(\phi_1+\theta)$$ does not depend on the parameters we seek. Therefore, if we reinject this in the original equation we get : $$a_2^{2}+[2a_1sin(\phi_1+\theta)]a_2sin(\phi_2+\theta) = A^{2}-a_1^{2}-2a_1mcos(\phi_1+\theta)$$ If we name the right hand $$\gamma$$ and we set $$\alpha = 2a_1sin(\phi_1+\theta)$$ we get the nicer equation $$a_2^{2}+\alpha a_2sin(\phi_2+\theta) = \gamma\tag{2}\label{eq2}$$ so we also have, by passing $$a_2^{2}$$ on the right side and squaring equation \eqref{eq2}: $$\alpha^{2}a_2^{2}sin^{2}(\phi_2+\theta) = \gamma^{2}-2\gamma a_2^{2}+a_2^{4}$$ Now we remember we also have \eqref{eq1}. We multiply it and square it $$\alpha^{2}a_2^{2}cos^{2}(\phi_2+\theta)=\alpha^{2}m^{2}$$ then, by summing both equations you eliminate the $$\phi_2$$ dependence. You finally get: $$\alpha^{2}a_2^{2} = \gamma^{2}+\alpha^{2}m^{2}-2\gamma a_2^{2}+a_2^{4}$$ so $$a_2^{4} -(\alpha^{2}+2\gamma)a_2^{2}+\gamma^{2}+m^{2}=0\tag{3}\label{eq3}$$ I believe \eqref{eq3} is called a bi squared equation. It means that you can solve it with $$a_2^{2}$$ as the unknown (you just have to find the roots of the polynomial $$X^{2}-(\alpha^{2}+2\gamma)X+m^{2}+\gamma^{2}$$) and then $$a_2$$ the generalized square roots of whatever you found for $$a_2^{2}$$ (with j or not, with + or -). You should get four roots and hope that only one makes sense. Once you have $$a_2$$, for $$\phi_2$$ I suggest you use equations \eqref{eq2} and \eqref{eq1} : $$a_2sin(\phi_2+\theta) = \frac{\gamma-a_2^{2}}{\alpha}$$ $$a_2cos(\phi_2+\theta) = m$$ You ratio both equations and you solve with arctan but you can go with arccos on \eqref{eq1} or arcsine on \eqref{eq2}, it should depend on which hypothesis you make on $$\phi_2$$.

• Impressing! I will try the numerical method because it seems easier to do on my system. The analytical method seems hard to me to follow. Feb 6 at 19:33
• @A.Lymphater The general idea is that I treat the second equation, then I treat the first equation. Each time, I isolate all the terms depending on $a_2$ and $\phi_2$ (our unknowns) on the left side. Then I do a bit of trigonometry in order to simplify the left side, I put everything else on the right and I give a name to the horrific right hand term. After all I square the cos and sine and I sum them in order to kill the $\phi_2$ dependence. It gives a nice solvable equation for $a_2$. $phi_2$ is easy to find once you have $a_2$. Feb 7 at 9:51
• @A.Lymphater I hope it helps. I bet $\alpha^{2}+2\gamma$ and $m^{2}+\gamma^{2}$ would simplify nicely. But yes, the Newton method, especially one in which you approximate the gradient, is much easier. Also, it is resistant to computation errors (you just have to get your function right). Just so you know, I'm the kind of person who often forget a sign here, or come coefficient there... That's also why I like numerical methods. Feb 7 at 9:56

Maybe I'm missing something here but that should be trivial.

Assuming we have $$z(t) = x(t) + y(t)$$. If $$x(t)$$ and $$z(t)$$ are known, you can get $$y(t)$$ simply as

$$y(t) = z(t) - x(t)$$

In other words subtract the known summand from the sum. That works for any type of signals, not just sine waves.

• I think this will not solve my problem because I have a time discrete system where only discrete samples of the wave are observable. The goal is to find the amplitude and phase of the second summand. I will edit my question later to clarify. Feb 5 at 14:12
• That certainly works for discrete systems as well, i.e. $y[n] = z[n]-x[n]$. Is the problem to identify amplitude and phase from a discrete sine wave? In this case you can just do an FFT. Feb 5 at 15:56
• Thank you for hanging in here with me. I tried to clarify my question by editing it based on your input. I like the idea of looking at a set of samples but this seems to take a lot of resource on my embedded system, may there be another solution with only the samples at time $t_n$? Feb 5 at 20:46