Skip to content

Commit 60642ec

Browse files
777arcvishwaksen-1
andauthored
Random variables section (#137)
* Random variables (#136) * "Add real-time packet detection section to detection chapter" * Add full E2E QPSK simulation to Sync chapter * Add Random Variables chapter and improve Detection flowchart --------- Co-authored-by: Marc Lichtman <marcll@vt.edu> * cleanups * cleanups * cleanups * asd * asd * asd --------- Co-authored-by: Vishwaksen Reddy Dhareddy <73452224+vishwaksen-1@users.noreply.github.com>
1 parent 38b6ab4 commit 60642ec

14 files changed

Lines changed: 613 additions & 96139 deletions

_images/central_limit_theorem.svg

Lines changed: 161 additions & 168 deletions
Loading

_images/detection_realtime.png

286 KB
Loading

_images/detection_realtime.svg

Lines changed: 0 additions & 95912 deletions
This file was deleted.

_images/gaussian_IQ.png

61.5 KB
Loading

_images/gaussian_histogram.png

25.1 KB
Loading

_images/gaussian_transformed.png

56.2 KB
Loading

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
'sphinx.ext.mathjax',
2323
'sphinx.ext.autosectionlabel',
2424
#'sphinxcontrib.tikz', #added for dutch
25+
"sphinxcontrib.mermaid"
2526
]
2627

2728
mathjax_path = "mathjax/tex-mml-chtml.js" # so that the textbook can work offline

content/detection.rst

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -436,40 +436,16 @@ Implementation
436436

437437
Our detector will follow this workflow:
438438

439-
.. code-block:: text
440-
441-
┌─────────────────────────────────────────────────────────────┐
442-
│ Continuous IQ Stream from SDR (e.g., 1 MHz sample rate) │
443-
└────────────────────┬────────────────────────────────────────┘
444-
445-
446-
┌─────────────────────────────────────────────────────────────┐
447-
│ Buffer Accumulation (e.g., 100k samples = 0.1 sec) │
448-
└────────────────────┬────────────────────────────────────────┘
449-
450-
451-
┌─────────────────────────────────────────────────────────────┐
452-
│ Cross-Correlation with Known Preamble │
453-
│ → Produces correlation vs. sample index │
454-
└────────────────────┬────────────────────────────────────────┘
455-
456-
457-
┌─────────────────────────────────────────────────────────────┐
458-
│ CFAR Threshold Computation │
459-
│ → Adaptive threshold that tracks noise floor │
460-
└────────────────────┬────────────────────────────────────────┘
461-
462-
463-
┌─────────────────────────────────────────────────────────────┐
464-
│ Peak Detection (correlation > threshold) │
465-
│ → List of candidate packet start indices │
466-
└────────────────────┬────────────────────────────────────────┘
467-
468-
469-
┌─────────────────────────────────────────────────────────────┐
470-
│ Packet Extraction & Validation │
471-
│ → Extract samples, pass to demodulator │
472-
└─────────────────────────────────────────────────────────────┘
439+
.. mermaid::
440+
441+
flowchart TD
442+
A("Continuous IQ Stream from SDR<br/>(1 MHz sample rate)")
443+
B("Buffer Accumulation<br/>(100k samples = 0.1 sec)")
444+
C("Cross-Correlation with Known Preamble")
445+
D("CFAR Threshold Computation")
446+
E("Peak Detection<br/>(correlation > threshold)")
447+
F("Packet Extraction & Validation")
448+
A --> B --> C --> D --> E --> F
473449

474450
To avoid missing packets that straddle buffer boundaries, we use an **overlap-save** approach, where each buffer includes the last ``N_preamble`` samples from the previous buffer. This ensures any packet starting near the end of buffer ``i`` will be fully contained in buffer ``i+1``. This requires a small additional computational overhead but we don't want to miss packets just because they straddle buffer boundaries.
475451

@@ -825,7 +801,6 @@ Step 7: Visualize Results
825801
axes[2].legend()
826802
827803
plt.tight_layout()
828-
plt.savefig('../_images/detection_realtime.svg', bbox_inches='tight')
829804
plt.show()
830805
831806
The visualization should show:
@@ -834,9 +809,9 @@ The visualization should show:
834809
2. **Middle plot**: Correlation output with adaptive CFAR threshold tracking the noise floor
835810
3. **Bottom plot**: Detected packets highlighted as peaks above threshold
836811

837-
.. image:: ../_images/detection_realtime.svg
838-
:align: center
839-
:target: ../_images/detection_realtime.svg
812+
.. image:: ../_images/detection_realtime.png
813+
:align: center
814+
:scale: 50 %
840815
:alt: Real-time packet detection results
841816

842817
Practical Considerations and Tuning

0 commit comments

Comments
 (0)