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:
- Gain Imbalance: Differences in the conversion gain of the baseband filters and the data converters (ADCs/DACs) between the I and Q channels.
- Phase Imbalance: The local oscillator (LO) in the quadrature mixer failing to maintain an exact 90-degree phase difference between the I and Q paths.
- Delay Imbalance: Small variations in propagation delay between the baseband filters and data converters on the I and Q paths.
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.
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:
- Loop gain: \( |G| = 2\sqrt{A^2 + (D')^2 + B^2 + (C')^2} \)
- Tx Gain QE: \( |g_{TX}| = \frac{2\sqrt{(-D)^2 + (-A')^2 + C^2 + (B')^2}}{G} \)
- Tx Phase QE: \( \theta_{TX} = \frac{\text{atan2}(-A-D', B - C') + \text{atan2}(-A+D', B + C')}{2} - \frac{\text{atan2}(D+A', C - B') + \text{atan2}(D-A', C + B')}{2} \)
- RF Mixer Tx-Rx Phase: \( \theta + \omega_{RF}D_{RF} \)
- Tx BB mismatch delay: \( \omega_{bb} \cdot (D_{TXI} - D_{TXQ}) \)
- Total loopback delay: \( \omega_{bb} \cdot (D_{RF} + D_{RX} + (D_{TXI} + D_{TXQ})/2) \)
✓ 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.
- Sending pos/neg tones: Note that the correlation start trigger should be consistently the same relative to the baseband tone so the delay variables don’t change.
- The number of correlation samples should ideally be such that \( \omega_{bb} \) completes an integer number of cycles.
- Sending a different baseband frequency: Resolves delay phase ambiguity.
- Offsetting RF PLL: Correlating with different baseband frequencies introduces a new phase offset. Note that \( D_{RX} \) and \( D_{RF} \) are unresolvable without an RF PLL offset.
×
© Martin McCormick, Scale RF Inc.