ESPectre SDK
2.8.0-280-gac7af68
Wi-Fi CSI motion sensing for ESP32 firmware
Toggle main menu visibility
Loading...
Searching...
No Matches
detector_limits.h
Go to the documentation of this file.
1
/*
2
* ESPectre - Detector Limits
3
*
4
* Shared detector window size and calibration buffer limits.
5
*
6
* Author: Francesco Pace <francesco.pace@gmail.com>
7
* SPDX-License-Identifier: GPL-3.0-only
8
* Commercial licensing available under separate agreement; see LICENSING.md.
9
*/
10
#pragma once
11
12
#include <cstdint>
13
14
namespace
espectre
{
15
16
// The public contract is temporal. These packet counts are only the resolved
17
// storage bounds used after the runtime has measured the CSI cadence.
18
constexpr
uint32_t
DETECTOR_WINDOW_SIZE_MS_MIN
= 1000U;
19
constexpr
uint32_t
DETECTOR_WINDOW_SIZE_MS_MAX
= 2000U;
20
constexpr
uint32_t
DETECTOR_WINDOW_SIZE_MS_DEFAULT
= 1000U;
21
constexpr
uint16_t
DETECTOR_DEFAULT_WINDOW_SIZE
= 100;
22
// A target-rate/window pair may resolve to a single slot. Readiness is governed
23
// by the derived temporal occupancy floor, never by an absolute packet count.
24
constexpr
uint16_t
DETECTOR_MIN_WINDOW_SIZE
= 1;
25
// Bounded by measurement, not stack: detector working buffers are allocated
26
// to the resolved window, and the ceiling limits drift away from the feature
27
// geometry used during fitting.
28
constexpr
uint16_t
DETECTOR_MAX_WINDOW_SIZE
= 1000;
29
30
constexpr
uint16_t
CALIBRATION_NUM_WINDOWS
= 10;
31
constexpr
uint16_t
CALIBRATION_DEFAULT_BUFFER_SIZE
=
32
DETECTOR_DEFAULT_WINDOW_SIZE
*
CALIBRATION_NUM_WINDOWS
;
33
34
// Detector timing contract, in microseconds. The packet counts above and in
35
// csi_features.h are what these durations resolve to at the nominal 100 pps; on
36
// a stream that runs faster or slower they are re-derived from the measured
37
// cadence. Keep aligned with src/python/micro_espectre/config.py.
38
constexpr
uint32_t
EVALUATION_INTERVAL_US
= 250000U;
// Time between evaluations
39
constexpr
uint32_t
L1_DELTA_LAG_US
= 100000U;
// Profile-displacement lag
40
constexpr
uint32_t
TURB_AUTOCORR_LAG_US
= 10000U;
// Autocorrelation lag
41
constexpr
uint16_t
DETECTOR_L1_DELTA_LAG_DEFAULT
= 10U;
42
constexpr
uint16_t
DETECTOR_AUTOCORR_LAG_DEFAULT
= 1U;
43
// The L1 profile ring is statically sized in firmware, so the displacement
44
// lag is capped. 32 packets covers the 100 ms contract up to ~320 pps, well
45
// past what any supported chip sustains; above that the lag saturates and
46
// spans less than 100 ms. Measured cost at 1000 pps is a few points of
47
// recall, and the decisive high-rate lag is the autocorrelation one, which
48
// stays far below this bound.
49
//
50
// The ring costs L1_DELTA_LAG_MAX x HT20_SELECTED_BAND_SIZE floats, i.e.
51
// 32 x 12 x 4 = 1536 bytes. An earlier revision of this comment said 4.5 KB,
52
// which never matched the declaration.
53
constexpr
uint16_t
L1_DELTA_LAG_MAX
= 32;
54
// A cadence faster than this is not a CSI stream, it is a batch delivered
55
// faster than real time. The packet-rate estimator ignores it when deriving
56
// feature geometry; evaluation cadence still follows the packet timestamps.
57
// There is no upper bound because a stream slower than one window is already
58
// handled as a hole by the configured detector window duration.
59
constexpr
uint32_t
MIN_PLAUSIBLE_PACKET_INTERVAL_US
= 200U;
// 5000 pps
60
61
}
// namespace espectre
espectre
Definition
espectre_sdk_version.h:62
espectre::L1_DELTA_LAG_US
constexpr uint32_t L1_DELTA_LAG_US
Definition
detector_limits.h:39
espectre::DETECTOR_DEFAULT_WINDOW_SIZE
constexpr uint16_t DETECTOR_DEFAULT_WINDOW_SIZE
Definition
detector_limits.h:21
espectre::DETECTOR_WINDOW_SIZE_MS_MAX
constexpr uint32_t DETECTOR_WINDOW_SIZE_MS_MAX
Definition
detector_limits.h:19
espectre::MIN_PLAUSIBLE_PACKET_INTERVAL_US
constexpr uint32_t MIN_PLAUSIBLE_PACKET_INTERVAL_US
Definition
detector_limits.h:59
espectre::L1_DELTA_LAG_MAX
constexpr uint16_t L1_DELTA_LAG_MAX
Definition
detector_limits.h:53
espectre::DETECTOR_WINDOW_SIZE_MS_DEFAULT
constexpr uint32_t DETECTOR_WINDOW_SIZE_MS_DEFAULT
Definition
detector_limits.h:20
espectre::DETECTOR_WINDOW_SIZE_MS_MIN
constexpr uint32_t DETECTOR_WINDOW_SIZE_MS_MIN
Definition
detector_limits.h:18
espectre::CALIBRATION_NUM_WINDOWS
constexpr uint16_t CALIBRATION_NUM_WINDOWS
Definition
detector_limits.h:30
espectre::CALIBRATION_DEFAULT_BUFFER_SIZE
constexpr uint16_t CALIBRATION_DEFAULT_BUFFER_SIZE
Definition
detector_limits.h:31
espectre::DETECTOR_L1_DELTA_LAG_DEFAULT
constexpr uint16_t DETECTOR_L1_DELTA_LAG_DEFAULT
Definition
detector_limits.h:41
espectre::DETECTOR_MAX_WINDOW_SIZE
constexpr uint16_t DETECTOR_MAX_WINDOW_SIZE
Definition
detector_limits.h:28
espectre::DETECTOR_AUTOCORR_LAG_DEFAULT
constexpr uint16_t DETECTOR_AUTOCORR_LAG_DEFAULT
Definition
detector_limits.h:42
espectre::EVALUATION_INTERVAL_US
constexpr uint32_t EVALUATION_INTERVAL_US
Definition
detector_limits.h:38
espectre::TURB_AUTOCORR_LAG_US
constexpr uint32_t TURB_AUTOCORR_LAG_US
Definition
detector_limits.h:40
espectre::DETECTOR_MIN_WINDOW_SIZE
constexpr uint16_t DETECTOR_MIN_WINDOW_SIZE
Definition
detector_limits.h:24
src
cpp
core
detector_limits.h
Generated by
1.17.0