Лабораторная 2.3 — Интерпретация I/Q и mirrored spectrum¶
Цель¶
Понять разницу между корректной complex I/Q-записью, перестановкой каналов I/Q и real-valued захватом, который даёт зеркальный спектр.
Что выполняется¶
В работе студент:
- формирует комплексный тон в baseband;
- сравнивает correct complex IQ, swapped I/Q и real-only capture;
- измеряет peak positions для положительной и отрицательной частей спектра;
- проверяет, как потеря порядка I/Q или imaginary channel меняет физический смысл спектра.
Результат¶
После выполнения работы должны быть получены:
- временной график компонентов I/Q;
- спектральное сравнение correct/swapped/real capture;
- metrics JSON с положением пиков и проверкой зеркальности;
- инженерный вывод о важности правильного порядка I/Q в SDR pipeline.
Что приложить к отчёту¶
- график
lab23_iq_components_time.png; - график
lab23_iq_interpretation_spectra.png; - measured peaks для correct, swapped и mirrored cases;
- краткое объяснение, почему complex baseband различает знак частоты;
- note о том, как ошибка перестановки I/Q проявится в реальной IQ-записи.
Подробная техническая часть¶
Lab 2.3 — I/Q Interpretation and Mirrored Spectrum¶
Goal¶
Demonstrate the difference between correct complex I/Q capture, swapped I/Q channels, and a real-valued capture that produces mirrored spectra.
Why this matters¶
Complex baseband separates positive and negative frequencies. If the I/Q order is wrong, the spectrum can be mirrored. If only a real-valued channel is used, positive and negative frequency content becomes symmetric and direction information is lost.
Experiment¶
The script builds a complex tone at 120 kHz and compares three cases:
- correct complex I/Q;
- I/Q swapped by exchanging the real and imaginary parts;
- real-valued capture that keeps only the I channel.
The lab measures:
- peak position for the correct complex signal;
- mirrored peak for the swapped-I/Q case;
- positive and negative mirror peaks for the real-valued capture.
Run¶
From the repository root:
python blocks/block_02_signals_and_sampling/python/iq_visualization.py
Or run the representative lab pack:
python tools/run_all_labs.py
Expected artifacts¶
| Artifact | Meaning |
|---|---|
docs/assets/lab23_iq_components_time.png |
I/Q components in the time domain |
docs/assets/lab23_iq_interpretation_spectra.png |
correct, swapped and mirrored spectral views |
docs/assets/lab23_iq_metrics.json |
peak locations and mirroring checks |
Interpretation checks¶
- The correct complex I/Q case should show the main tone near
+120 kHz. - The swapped-I/Q case should mirror the tone to the negative side of the spectrum.
- The real-valued capture should show matching positive and negative peaks around
+/-120 kHz. - The metrics JSON should confirm a small error for the correct case and near-symmetric mirror peaks for the real-valued case.
Report checklist¶
- [ ] Explain why complex baseband can distinguish spectral direction.
- [ ] Attach the time-domain I/Q plot and the spectral comparison plot.
- [ ] Quote the correct, swapped and mirrored peak locations.
- [ ] Explain what acquisition or parsing mistake produces an I/Q swap in practice.
- [ ] State how the same issue would appear in a real SDR recording workflow.