Lab 9.3 — Multi-Format IQ Reader¶
Goal¶
Extend the IQ analysis workflow from CI16-only reading to a metadata-driven reader that supports ci16, cu8 and cf32 captures.
Engineering question¶
How can one analysis script read IQ recordings from different tools without rewriting the processing pipeline?
Supported formats¶
| Format | Binary layout | Typical source |
|---|---|---|
ci16 |
signed int16 interleaved I/Q | AD9363, custom SDR |
cu8 |
unsigned uint8 interleaved I/Q | RTL-SDR raw captures |
cf32 |
float32 interleaved I/Q | GNU Radio, MATLAB/Python exports |
Executable file¶
python blocks/block_09_recording_and_analysis_tools/python/lab_9_3_multi_format_iq_reader.py
Generated artifacts:
docs/assets/lab93_multiformat_iq_metrics.json
docs/assets/lab93_multiformat_iq_spectrum_ci16.png
docs/assets/lab93_multiformat_iq_spectrum_cu8.png
docs/assets/lab93_multiformat_iq_spectrum_cf32.png
Processing chain¶
flowchart LR
META[Metadata JSON] --> DISPATCH[Format dispatcher]
DISPATCH --> CI16[CI16 reader]
DISPATCH --> CU8[CU8 reader]
DISPATCH --> CF32[CF32 reader]
CI16 --> FFT[Common FFT analysis]
CU8 --> FFT
CF32 --> FFT
FFT --> REPORT[Metrics + plots]
Why this matters¶
Real SDR experiments often mix tools. A course capture may start from HDSDR/RTL-SDR, then move to AD9363, then be exported through GNU Radio or MATLAB. The analysis stage should be metadata-driven, not hard-coded for one binary layout.
What to expect¶
ci16: peak=124987.793 Hz, SNR=73.22 dB
cu8: peak=124987.793 Hz, SNR=73.14 dB
cf32: peak=124987.793 Hz, SNR=73.23 dB
- All three formats give the same peak. The 8-bit CU8 file loses only 0.1 dB of "SNR" here. That does not mean 8 bits are as good as 16: the measured figure is peak over median FFT bin, which includes the FFT's processing gain over a long record, and the synthetic tone's own noise is far above the 8-bit quantization noise spread over that many bins.
Exercises¶
- Remove the synthetic noise and rerun. Which format now shows a lower floor, and by roughly how much (hint: about 6 dB per bit)?
- Add a second tone 50 dB weaker than the first. In which format does it disappear first?
Report checklist¶
- List all tested IQ formats.
- Show metadata for each format.
- Confirm sample count and scaling.
- Compare measured peak frequencies.
- Compare SNR/DC/clipping indicators.
- Explain which format is best for the next processing step.
Engineering conclusion template¶
The same analysis pipeline successfully read formats ____ and produced consistent peak-frequency estimates.
The largest frequency error was ____ Hz. The preferred format for further processing is ____ because ______.