Arbitrary Phase and Magnitude from I and Q Sum

A sinusoid of arbitrary phase and amplitude relative to a reference sinusoid may be generated if the in-phase (I) and quadrature (Q) components of the reference are available. In other words, the sinusoid

Z \cos ( \alpha + \beta )

may be created from  \cos\alpha (the I component) and \sin\alpha (the Q component) by forming the scaled sum X\cos\alpha+Y\sin\alpha with the proper choice of X and Y.  This represents a sinusoid which leads the reference sinusoid \cos\alpha  by \beta degrees.

Start with the trig identity:


Multiply by Z:


Group terms on the right side:


Now it’s clear that

\begin{aligned} X &= Z\cos\beta \\Y &= -Z\sin\beta \end{aligned}

For example, to create a sinusoid which is .25 times the amplitude of the reference and leads it by 127 degrees, use

\begin{aligned} X &= 0.25\cos(127)&=-0.150 \\ Y &= -0.25\sin(127)&=-0.200 \end{aligned}

which is to say 0.25\cos(\alpha+127)=-0.150\cos\alpha-0.200\sin\alpha.