Direct-conversion radio frontends inevitably suffer from two analog impairments: IQ imbalance (the I and Q paths differ slightly in amplitude and are not exactly 90° apart) and DC offset (LO leakage creates a fixed bias on the baseband signal). UHD ships self-calibration utilities that sweep the LO across a frequency range, measure these impairments using transmit leakage into the receive path, and write correction tables to disk. At runtime UHD reads the table and programs correction hardware in the FPGA automatically whenever you retune the LO—no external test equipment required.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/EttusResearch/uhd/llms.txt
Use this file to discover all available pages before exploring further.
Supported RF Frontends
The primary self-calibration utilities (uhd_cal_rx_iq_balance, uhd_cal_tx_dc_offset, uhd_cal_tx_iq_balance) support the following daughterboards and integrated frontends:
- RFX Series transceiver boards
- WBX Series transceiver boards
- SBX Series transceiver boards
- CBX Series transceiver boards
- UBX Series transceiver boards
- OBX Series transceiver boards
- USRP N320
USRP E310, E320, N300, N310, and B200-Series devices use a dedicated RFIC that performs its own internal calibration. Those devices are not covered by the utilities described here.
uhd_iq_dc_correction.py. See the X420 section below.
Running the Self-Calibration Utilities
Disconnect all antennas
Remove any external signals or cables from the RF antenna ports. The utilities use TX-to-RX leakage as the measurement source; external signals corrupt the measurement.
Check for a daughterboard serial number
Calibration data is keyed to the board’s serial number. If your daughterboard is older and lacks one, burn a serial number first:
Run the calibration sweep
Each utility performs a full frequency sweep and writes a Use
.cal file. Allow several minutes per utility:--help to see advanced options such as manually specifying the frequency range and step size.Calibration Data Storage
Calibration files are binary files with a.cal extension stored in the user’s home directory:
- Linux
- Windows
$UHD_CAL_DATA_PATH environment variable.- Re-running a calibration utility replaces the existing file. The old file is renamed so it can be recovered.
- Files can be copied between machines by transferring the
cal/directory. - The format is FlatBuffers-based binary. Schema files are installed to
<install-path>/share/uhd/cal/.
Inspecting and Modifying Calibration Data
Convert a.cal file to editable JSON using the flatc tool:
<foo>_cal.fbs with the appropriate schema, for example pwr_cal.fbs for power calibration data.
Migrating UHD 3.x CSV Data
Older UHD versions stored calibration data as CSV files. Convert them to the current binary format with:/usr/share/lib/uhd/utils/ or equivalent.
Ignoring Calibration Files at Runtime
You can bypass stored calibration data by passingignore-cal-file=1 in the device arguments:
Programmatic Correction API
When you want to set correction values manually—rather than relying on the stored table—use these API calls:- DC Offset Correction
- IQ Balance Correction
Automatic RX DC offset correction is implemented as a single-tap IIR notch filter with a default coefficient of 2⁻²⁰. It removes any constant DC component, but will also attenuate signals very close to DC if the LO is inside your band of interest. Use offset tuning to keep the LO out of band when possible.
X420 IQ and DC Correction
The USRP X420 (1 GHz bandwidth) uses a different correction path and requires the dedicated Python utilityuhd_iq_dc_correction.py, installed to <Python path>/site-packages/uhd/utils/.
Requirements: scipy and tqdm Python packages in addition to the standard UHD Python bindings.
set_rx_dc_offset() / set_rx_iq_balance() is not supported for X420.
