# Removing I/Q phase rotation

What is the most reliable and agnostic way to correct for a phase rotation of I/Q downconversion - without time alignment of the signal and support different lengths of transmitted and received data?

To be more specific: Assuming perfect I/Q balance, there is still a phase rotation in the received I/Q data if the LO of the transmitter and receiver are not exactly phase locked. As an example, consider sending the following signal:

$$x[n] = x_i + j \,0,\qquad x_i \sim \cal{N}(0,\sigma^2)$$

The received signal will, in general, look like:

$$y[n] = y_i + j y_q$$

Multiplying $y[n]$ yb proper $e^{j\theta}$ should make $y_q$ zero and hence correct for the LO phase rotation.

If I transmit this $x[n]$, I could iterate over all possible $\theta$ values and find the one which minimizes $\mathbb{E}(y_q^2)$.

However, it would be desirable to find this constant for arbitrary $x[n]$.

Furthermore, I could cut and align the signals and then just find the complex constant via least squares.

However, there will also be a time delay associated between the sender and the receiver and I do not want to correct for this delay at this stage. Furthermore, $y[n]$ may be longer or shorter as $x[n]$ - in this case $y[n]$ is a part of $x[n]$ or vice versa.

I wonder if there is a reliable way for the general conditions above to find $\theta$ at a very early stage in the I/Q receiver (i.e., from uncorrected I/Q samples of the two ADCs).

• If I understand your question, you're looking for a carrier synchronizer. Costas loop is the standard algorithm. – MBaz Apr 20 '18 at 1:37
• You are assuming 0 frequency offset, 0 doppler, and perfect frequency stability between both transmitter and receiver as well, if you are only concerned about phase rotation. Assuming all that magic happens, for a known signal the phase of the peak of a complex cross correlation will be the carrier phase. For an unknown signal, a PLL with an appropriate loop filter will track amd eliminate the phase offset. – Andy Walls Apr 20 '18 at 1:46
• It is quite easy to do if you have transmitted a known (but arbitrary) $x[n]$ as a pilot symbol. It is also possible to some degree if you know that $x[n]$ belongs to some alphabet or has some other characteristics (like being real-valued in your example). Are you assuming that the receiver knows something about the transmitted signal? If so, exploiting this knowledge should lead to an efficient algorithm. – hops Apr 20 '18 at 18:40
• I was hoping that I could leverage some statistics. But yes, I think I have to resort to some sort of training signal. I think this rotation depends only on the RX/TX-LO phase shift so it should stay constant. I will go with the real-valued one – divB Apr 20 '18 at 18:45