# Maximum Likelihood Estimation of Phase

I'm trying to solve an exercise where I need to derive the MLE of the phase parameter.

I'm given the below signal with white noise $$w[n] \sim \mathcal{N}(0, \sigma^2)$$, amplitude $$A$$, angular frequency $$\omega \notin \{0, \pi\}$$, $$N$$ measurements and unknown phase $$\phi$$.

$$x[n]=A \cos (\omega n+\phi)+w[n], \; \; n= 1,...,N$$

Usually I'd get the log-likelihood function, compute the first derivative, set it to zero and solve for the unknown parameter which is $$\phi$$ in this case. However, I am unable to solve for $$\phi$$ in the 1st derivative as I am can't extract it from inside the sine and cosine functions.

$$\begin{gathered} \frac{\partial}{\partial \phi} \ln p(x ; \phi)=-\frac{1}{\sigma^{2}} \sum_{1}^{N}(x[n]-A \cos (\omega n+\phi))(A \sin (\omega n+\phi)) \\ \frac{\partial}{\partial \phi} \ln p(x ; \phi)=0 \end{gathered}$$

• hi! You seem to know how to typeset formulas in $\LaTeX$! That's great. If you put them between $, for example as $\phi, they get rendered as LaTeX (just for the future) Commented Aug 2, 2022 at 15:50 • I wasn't aware of that and I was just adding the equations as images, thanks a lot for the hint! :) Commented Aug 2, 2022 at 16:20 • You're welcome! When you want "freestanding" equation lines, you'd do $$w[n] \sim \mathcal{N}(0,\sigma^2)$$; you can also do \begin{align} \frac{\partial}{\partial \phi} \ln p(x;\phi) &= \ldots \\ & 0 \end{align} Commented Aug 2, 2022 at 16:28 • This problem is really tricky because of the non-additive noisew\$ that appears both in and outside the cosine. Commented Aug 3, 2022 at 1:13
I'm not sure that there's a closed-form solution for the ML estimate of phase, but if you recast the definition of $$x[n]$$ to $$x[n] = a \cos (\omega n) + b \sin (\omega n) + w[n], \; \; n= 1,...,N$$ then you can easily find the ML estimates of $$a$$ and $$b$$, and take $$\hat \phi = \tan^{-1}\frac{\hat b}{\hat a}.$$
Maybe you cannot get an analytical solution. Or maybe you can assume the phase is very small, and use some approximation like $$\cos \left( \phi \right) = 1$$ and $$\sin \left( \phi \right) = \phi$$.