Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
329 changes: 161 additions & 168 deletions _images/central_limit_theorem.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/detection_realtime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95,912 changes: 0 additions & 95,912 deletions _images/detection_realtime.svg

This file was deleted.

Binary file added _images/gaussian_IQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/gaussian_histogram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/gaussian_transformed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'sphinx.ext.mathjax',
'sphinx.ext.autosectionlabel',
#'sphinxcontrib.tikz', #added for dutch
"sphinxcontrib.mermaid"
]

mathjax_path = "mathjax/tex-mml-chtml.js" # so that the textbook can work offline
Expand Down
51 changes: 13 additions & 38 deletions content/detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -436,40 +436,16 @@ Implementation

Our detector will follow this workflow:

.. code-block:: text

┌─────────────────────────────────────────────────────────────┐
│ Continuous IQ Stream from SDR (e.g., 1 MHz sample rate) │
└────────────────────┬────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Buffer Accumulation (e.g., 100k samples = 0.1 sec) │
└────────────────────┬────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Cross-Correlation with Known Preamble │
│ → Produces correlation vs. sample index │
└────────────────────┬────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ CFAR Threshold Computation │
│ → Adaptive threshold that tracks noise floor │
└────────────────────┬────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Peak Detection (correlation > threshold) │
│ → List of candidate packet start indices │
└────────────────────┬────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Packet Extraction & Validation │
│ → Extract samples, pass to demodulator │
└─────────────────────────────────────────────────────────────┘
.. mermaid::

flowchart TD
A("Continuous IQ Stream from SDR<br/>(1 MHz sample rate)")
B("Buffer Accumulation<br/>(100k samples = 0.1 sec)")
C("Cross-Correlation with Known Preamble")
D("CFAR Threshold Computation")
E("Peak Detection<br/>(correlation > threshold)")
F("Packet Extraction & Validation")
A --> B --> C --> D --> E --> F

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.

Expand Down Expand Up @@ -825,7 +801,6 @@ Step 7: Visualize Results
axes[2].legend()

plt.tight_layout()
plt.savefig('../_images/detection_realtime.svg', bbox_inches='tight')
plt.show()

The visualization should show:
Expand All @@ -834,9 +809,9 @@ The visualization should show:
2. **Middle plot**: Correlation output with adaptive CFAR threshold tracking the noise floor
3. **Bottom plot**: Detected packets highlighted as peaks above threshold

.. image:: ../_images/detection_realtime.svg
:align: center
:target: ../_images/detection_realtime.svg
.. image:: ../_images/detection_realtime.png
:align: center
:scale: 50 %
:alt: Real-time packet detection results

Practical Considerations and Tuning
Expand Down
Loading