Transmit Quadrature Error Correction (Tx-QEC)

In a direct-conversion architecture like the QuadRF, Transmit Quadrature Error occurs due to mismatches between the In-phase (I) and Quadrature (Q) signal paths. These mismatches generate unwanted image frequencies where positive baseband frequency mirror into negative frequencies and vice-versa. The primary sources of these errors are:

If all these variables are estimated, they can be pre-compensated in the transmitter using DSP in the FPGA.

Model of the Loopback Channel

In order to estimate the impairments (gain, phase, and delay imbalances between I and Q), we write a mathematical model of the Tx I/Q -> Rx I/Q loopback channel on the QuadRF.

Tx-QEC Loopback Channel Model

If transmitting a test tone, what is received at \( y(t) \) (or I-channel) is:

$$ \begin{align} y(t) &= \cos(\omega_{RF}(t-D_{RX}) + \theta) \cdot G \cdot \cos(\omega_{RF}(t-D_{RF}-D_{RX})) \cdot \cos(\omega_{bb}(t - D_{TXI} - D_{RF} - D_{RX})) \\ &- \cos(\omega_{RF}(t-D_{RX}) + \theta) \cdot G \cdot \sin(\omega_{RF}(t-D_{RF}-D_{RX})+\theta_{TX}) \cdot g_{TX} \cdot \sin(\omega_{bb}(t - D_{TXQ} - D_{RF} - D_{RX})) \end{align} $$

Applying trigonometric sum/product identities on the left cosines, and removing the RF sum terms filtered by the baseband LPF:

$$ \begin{align} y(t) &= \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}) \cdot \cos(\omega_{bb}(t - D_{TXI} - D_{RF} - D_{RX})) \\ &+ \frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot \sin(\omega_{bb}(t - D_{TXQ} - D_{RF} - D_{RX})) \end{align} $$

Now, if we correlate \( y(t) \) with the cosine that was transmitted, and use trig identities on the right (eliminating terms that integrate to zero):

$$ \sum y(t)\cdot\cos(\omega_{bb}t) = \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}) \cdot \frac{\cos(\omega_{bb}(-D_{TXI} - D_{RF} - D_{RX}))}{2} \\ + \frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot \frac{\sin(\omega_{bb}(-D_{TXQ} - D_{RF} - D_{RX}))}{2} $$

Similarly, if we correlate \( y(t) \) with the sine transmitted:

$$ \sum y(t)\cdot\sin(\omega_{bb}t) = \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}) \cdot \frac{-\sin(\omega_{bb}(-D_{TXI} - D_{RF} - D_{RX}))}{2} \\ + \frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot \frac{\cos(\omega_{bb}(-D_{TXQ} - D_{RF} - D_{RX}))}{2} $$

Repeating for \( z(t) \) (or Q-channel):

$$ \begin{align} z(t) &= -\sin(\omega_{RF}(t-D_{RX}) + \theta) \cdot G \cdot \cos(\omega_{RF}(t-D_{RF}-D_{RX})) \cdot \cos(\omega_{bb}(t - D_{TXI} - D_{RF} - D_{RX})) \\ &- \sin(\omega_{RF}(t-D_{RX}) + \theta) \cdot G \cdot \sin(\omega_{RF}(t-D_{RF}-D_{RX})+\theta_{TX}) \cdot g_{TX} \cdot \sin(\omega_{bb}(t - D_{TXQ} - D_{RF} - D_{RX})) \end{align} $$
$$ z(t) = -\frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}) \cdot \cos(\omega_{bb}(t - D_{TXI} - D_{RF} - D_{RX})) \\ + \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot \sin(\omega_{bb}(t - D_{TXQ} - D_{RF} - D_{RX})) $$
$$ \sum z(t)\cdot\cos(\omega_{bb}t) = -\frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}) \cdot \frac{\cos(\omega_{bb}(-D_{TXI} - D_{RF} - D_{RX}))}{2} \\ + \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot \frac{\sin(\omega_{bb}(-D_{TXQ} - D_{RF} - D_{RX}))}{2} $$
$$ \sum z(t)\cdot\sin(\omega_{bb}t) = -\frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}) \cdot \frac{-\sin(\omega_{bb}(-D_{TXI} - D_{RF} - D_{RX}))}{2} \\ + \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot \frac{\cos(\omega_{bb}(-D_{TXQ} - D_{RF} - D_{RX}))}{2} $$

Positive/Negative Frequencies

If we send a negative frequency tone in addition to the positive tone (both \( \pm\omega_{bb} \)) to get \( y^+, z^+ \) and \( y^-, z^- \), we can sum correlation results to cancel the sine terms.

Note: Divide the sum by the number of samples \( N \). Ideally, use an \( N \) that gives an integer number of \( \omega_{bb} \) cycles so the sine/cosine terms are orthogonal.

Four constants are calculated (\( A, B, C, D \)):

Let \( T_I = \cos(\omega_{bb}(-D_{TXI} - D_{RF} - D_{RX})) \)

Let \( T_Q = \cos(\omega_{bb}(-D_{TXQ} - D_{RF} - D_{RX})) \)

$$ B = \sum y^+(t)\cos(\omega_{bb}t) + \sum y^-(t)\cos(\omega_{bb}t) = \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}) \cdot T_I $$ $$ D = \sum y^+(t)\sin(\omega_{bb}t) + \sum y^-(t)(-\sin(\omega_{bb}t)) = \frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot T_Q $$ $$ A = \sum z^+(t)\cos(\omega_{bb}t) + \sum z^-(t)\cos(\omega_{bb}t) = -\frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}) \cdot T_I $$ $$ C = \sum z^+(t)\sin(\omega_{bb}t) + \sum z^-(t)(-\sin(\omega_{bb}t)) = \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot T_Q $$

Then, from the difference of correlations, another four constants (\( A', B', C', D' \)):

Let \( T_{I'} = -\sin(\omega_{bb}(-D_{TXI} - D_{RF} - D_{RX})) \)

Let \( T_{Q'} = \sin(\omega_{bb}(-D_{TXQ} - D_{RF} - D_{RX})) \)

$$ B' = \sum y^+(t)\cos(\omega_{bb}t) - \sum y^-(t)\cos(\omega_{bb}t) = \frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot T_{Q'} $$ $$ D' = \sum y^+(t)\sin(\omega_{bb}t) - \sum y^-(t)(-\sin(\omega_{bb}t)) = \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}) \cdot T_{I'} $$ $$ A' = \sum z^+(t)\cos(\omega_{bb}t) - \sum z^-(t)\cos(\omega_{bb}t) = \frac{G}{2}\cos(\theta + \omega_{RF}D_{RF}-\theta_{TX}) \cdot g_{TX} \cdot T_{Q'} $$ $$ C' = \sum z^+(t)\sin(\omega_{bb}t) - \sum z^-(t)(-\sin(\omega_{bb}t)) = -\frac{G}{2}\sin(\theta + \omega_{RF}D_{RF}) \cdot T_{I'} $$

Angle Sum and Difference Identities

(\( G \) is positive, because phase is fully absorbed into other terms)

$$ G^2/4 = A^2 + (D')^2 + B^2 + (C')^2 $$ $$ \text{atan2}(-A-D', B - C') = (\theta + \omega_{RF}D_{RF}) + \omega_{bb}(-D_{TXI} - D_{RF} - D_{RX}) $$ $$ \text{atan2}(-A+D', B + C') = (\theta + \omega_{RF}D_{RF}) - \omega_{bb}(-D_{TXI} - D_{RF} - D_{RX}) $$
$$ (G \cdot g_{TX})^2/4 = (-D)^2 + (-A')^2 + C^2 + (B')^2 $$ $$ \text{atan2}(D+A', C - B') = (\theta + \omega_{RF}D_{RF} - \theta_{TX}) + \omega_{bb}(-D_{TXQ} - D_{RF} - D_{RX}) $$ $$ \text{atan2}(D-A', C + B') = (\theta + \omega_{RF}D_{RF} - \theta_{TX}) - \omega_{bb}(-D_{TXQ} - D_{RF} - D_{RX}) $$

Which can be easily rearranged to extract the following:

✓ Calculations confirmed in MATLAB and physical testing on the QuadRF.

For determining delays involving \( \omega_{bb} \) unambiguously, Tx-Rx correlation should be time-aligned enough such that phase doesn't alias within a period of \( \omega_{bb} \).


Online Tracking Calculation

(After performing near-loopback time alignment)

As long as the total Tx, RF, Rx delay is small enough relative to \( |\omega_{bb}| \) that the cosine coefficient \( T_I \) isn't too small (assuming \( T_I \) and \( T_Q \) aren't too small):

$$ \theta_{TX} = \text{atan2}(-A, B) - \text{atan2}(-D, -C) $$

Or using conjugate multiply:

$$ \begin{align} \theta_{TX} &= \text{angle}\left[ (B-jA) \cdot \text{conj}(C+jD) \right] \\ &= \text{atan2}(-BD-AC, BC - AD) \end{align} $$

Given a small difference angle, using the approximation \( \text{atan2}(Y,X) \approx Y/X \) (which cancels \( g_{TX} \)):

$$ \theta_{TX} = \frac{AC+BD}{AD-BC} $$

We can also calculate (assuming \( T_I \) isn't too small):

$$ \theta + \omega_{RF}D_{RF} = \text{atan2}(-A, B) $$

If \( T_I = T_Q \) (pretty much true for low freq tones):

$$ g_{TX} = \sqrt{\frac{C^2+D^2}{A^2+B^2}} $$ $$ G \cdot T_I = 2\sqrt{A^2+B^2} $$

Implementation Notes

Calculate each of these times cosine or sine baseband, integrated.

© Martin McCormick, Scale RF Inc.