@@ -436,40 +436,16 @@ Implementation
436436
437437Our 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
474450To 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:
8348092. **Middle plot **: Correlation output with adaptive CFAR threshold tracking the noise floor
8358103. **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
842817Practical Considerations and Tuning
0 commit comments