Suppose we have a complex signal $\cos(2\theta) + j\sin(2\theta) = e^{j2\theta}$. Is there any way to find half-angle $\cos(\theta) + j\sin(\theta) = e^{j\theta}$ complex signal without going into polar form and preferably with no divisions? Iterative algorithms are fine.

  • $\begingroup$ Is theta known or unknown? $\endgroup$ – Jim Clay Apr 29 '14 at 21:06
  • 1
    $\begingroup$ $e^{j2\theta}$ is already in polar form. It would be good if you clarified your question a bit, because in this form you might either get no or only trivial answers. $\endgroup$ – Matt L. Apr 29 '14 at 21:12
  • $\begingroup$ Just in case you assume that $\exp(2j\theta)$ is given in cartesian form: In this case there is no answer to the question unless you specify the branch of the complex logarithm, i.e. an interval of length $2\pi$ that contains $\theta$. $\endgroup$ – Jazzmaniac Apr 29 '14 at 21:21
  • $\begingroup$ Of course, theta is not known. We just have a sampled complex signal $ e^{j2\theta(n)} = cos(2\theta(n)) + j sin(2\theta(n)) $ and we'd like to get $ e^{j\theta(n)} = cos(\theta(n)) + j sin(\theta(n)) $ complex signal. $\endgroup$ – dagofff Apr 29 '14 at 23:28
  • 1
    $\begingroup$ You are given the values $a$ of $\cos(2\theta)$ and $b$ of $\sin(2\theta)$, that is, you know $a$ and $b$, but don't know $2\theta$. You need to find the values of $\cos(\theta)$ and $\sin(\theta)$ but not necessarily that of $\theta$. Assume that $a,b > 0$. Then,$$a=\cos(2\theta)=2\cos^2(\theta)-1\quad\Rightarrow\quad\cos(\theta)=\sqrt{\frac{a+1}{2}}.$$ $$b=2\sin(\theta)\cos(\theta)\quad\Rightarrow\quad\sin(\theta)=\frac{b}{2\cos \theta}=\frac{b}{\sqrt{2a+2}}.$$ Repeat for the cases $a<0,b>0$; $a,b<0$; and $a>0,b<0$ to get the full atan2 treatment. $\endgroup$ – Dilip Sarwate Apr 30 '14 at 2:33

For small $\Theta$ an approximation would be to simply halve the imaginary value.

You could also use the ratio of the real and imaginary values as the index to a lookup table that would return the half angle value. You could not store every possible value, of course, so you would have to choose some set of values and then lookup the value that is closest to the actual ratio.

  • 1
    $\begingroup$ Regarding your lookup table idea: this sort of thing is exactly how fast arctangent implementations, including those used in embedded systems, are built. A four-quadrant arctangent (usually known as atan2) can be used to find $\theta$. $\endgroup$ – Jason R Apr 29 '14 at 21:29
  • $\begingroup$ To complement this: a fast atan2 routine for float32s doesn't need divisions - the ingredients are "carmack"'s inverse square root, some sign/octant handling and a LUT. Though you might be using fixed points on a very limited platform if you're so worried about divisions... $\endgroup$ – pichenettes Apr 29 '14 at 23:17
  • $\begingroup$ $\theta$ can be arbitrary. LUT solution is nice, but may require too much memory to get good precision. To clarify things, I'd like to find such nice solution to avoid phase unwrapping after calculating double angle using CORDIC. $\endgroup$ – dagofff Apr 29 '14 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.