ESPectre SDK 2.8.0-280-gac7af68
Wi-Fi CSI motion sensing for ESP32 firmware
Loading...
Searching...
No Matches
espectre Namespace Reference

Classes

class  BaseDetector
 Abstract base class for motion detection algorithms. More...
class  ChannelShapeTrajectoryTracker
struct  DirectWebSocketRequest
struct  DirectWebSocketServiceConfig
struct  DirectWebSocketServiceDiagnostics
struct  EspectreCommand
 A parsed control command. More...
struct  EspectreDeviceConfig
 Device identity and broker settings. More...
struct  EspectreDeviceInfo
 What the device advertises about itself. More...
struct  EspectreNetworkInfo
 Link details available to frontends. More...
struct  EspectreOtaStatus
 Full OTA status: state, the versions involved, and the resolved URLs. More...
class  FilteredTurbulenceRing
 Fixed-capacity turbulence history with optional Hampel and low-pass filtering. More...
struct  hampel_turbulence_state_t
class  HighAccuracyDetector
 Neural motion detector, using the MLP weights exported by training. More...
class  IDirectWebSocketService
 Local WebSocket endpoint used by the Native frontend after Wi-Fi is ready. More...
class  IEspectreRuntime
 The sensing backend behind RuntimeFrontendController. More...
class  IMqttTransport
 The MQTT client seam. More...
class  IOtaService
 The firmware-update seam. More...
class  IRuntimeListener
 Everything the runtime tells your firmware. More...
class  L1DeltaTracker
struct  L1DeltaWindow
 One sliding window of displacements over a caller-owned ring. More...
class  LightweightDetector
 The default detector: self-calibrating, no training data required. More...
struct  lowpass_filter_state_t
struct  MeanVariance
struct  MLSeriesScratch
struct  MLSeriesStats
struct  MLStatNeeds
struct  MqttTransportDiagnostics
struct  RuntimeCapabilities
 What a runtime actually offers its frontend. More...
struct  RuntimeConfig
 Everything the runtime needs to know before setup(). More...
struct  RuntimeDiagnosticsSample
 Rate and link diagnostics derived from cumulative runtime counters. More...
class  RuntimeDiagnosticsSampler
 Converts cumulative diagnostics into rates over the interval between reads. More...
struct  RuntimeDiagnosticsSnapshot
 Low-frequency counters and radio state used by optional diagnostic surfaces. More...
class  RuntimeFrontendController
 The recommended entry point for firmware embedding ESPectre. More...
struct  RuntimeSnapshot
 A consistent view of the sensing state at one instant. More...
class  StartupThresholdCalibrator
 Startup threshold calibrator with a motion-first primary path and an internal quiet-first fallback. More...

Typedefs

using runtime_diagnostic_visitor_t = std::function<void(const char *key, const char *value)>
using SelectedSubcarriers = std::array<uint8_t, HT20_SELECTED_BAND_SIZE>
using hampel_filter_state_t = hampel_turbulence_state_t

Enumerations

enum class  WifiBandPolicy : uint8_t { BAND_2G = 0 , BAND_5G = 1 , AUTO = 2 }
 Wi-Fi band selection requested by the embedding frontend. More...
enum class  RuntimeSubcarrierSource { FIXED_DEFAULT }
 How the runtime chose the subcarriers it measures on. More...
enum class  DetectionAlgorithm { LIGHTWEIGHT , HIGH_ACCURACY }
 Which detector runs. More...
enum class  RuntimeProfile { SENSING , STREAM }
 Which runtime backend the controller builds. More...
enum class  RuntimeTrafficMode { DNS , PING }
 Which packet the internal generator sends to solicit CSI from the AP. More...
enum class  RuntimeConfigError : uint8_t {
  NONE = 0 , RUNTIME_PROFILE , WIFI_BAND_POLICY , DETECTION_ALGORITHM ,
  SEGMENTATION_THRESHOLD , SEGMENTATION_WINDOW_SIZE_MS , CSI_TARGET_PPS , TRAFFIC_GENERATOR_MODE ,
  CSI_TRAFFIC_MODE , CSI_TRAFFIC_UDP_PORT , CSI_TRAFFIC_MULTICAST_GROUP , CSI_TRAFFIC_EXPECTED_PAYLOAD ,
  STREAM_COLLECTOR_PORT , STREAM_LOG_INTERVAL_MS , STREAM_TX_BATCH_RECORDS , PUBLISH_INTERVAL_MS ,
  EVALUATION_INTERVAL_MS , MOTION_HITS , LOWPASS_CUTOFF , HAMPEL_WINDOW ,
  HAMPEL_THRESHOLD
}
 Machine-readable reason a RuntimeConfig cannot be applied. More...
enum class  CsiTrafficMode { INTERNAL , EXTERNAL , PACING , DISABLED }
 Where the CSI-bearing traffic comes from. More...
enum class  EspectreOtaState : uint8_t {
  IDLE = 0 , CHECKING , UPDATE_AVAILABLE , UP_TO_DATE ,
  DOWNLOADING , APPLYING , REBOOT_SCHEDULED , ERROR
}
 OTA progress, as reported to clients. More...
enum class  MotionState { IDLE , MOTION }
 Debounced detector state. More...
enum class  Ht20BinLayout : uint8_t { UNKNOWN = 0 , CENTERED , CLASSIC }
enum  MLFeatureId : uint8_t {
  ML_FEAT_TURB_AUTOCORR = 6 , ML_FEAT_TURB_ZCR = 14 , ML_FEAT_L1_DELTA_LAG_RATIO = 25 , ML_FEAT_TURB_IQR_OVER_MEAN_AGGR = 45 ,
  ML_FEAT_CHAN_SHAPE_COHERENT_INNOVATION_ENERGY = 46 , ML_FEAT_CHAN_SHAPE_EXCESS_PATH = 47 , ML_FEAT_CHAN_SHAPE_SPREAD_SUBBAND = 48 , ML_FEAT_CHAN_SHAPE_SUBBAND_KENDALL_LAG_EXCESS = 49
}
enum class  MLFeatureSource : uint8_t { TURBULENCE_SERIES , AGGREGATED_TURBULENCE_SERIES , L1_TRACKER , CHANNEL_SHAPE_TRAJECTORY_TRACKER }

Functions

constexpr const char * espectre_sdk_version ()
 The SDK version as a string, usable where a macro is not.
constexpr float runtime_threshold_max (DetectionAlgorithm algorithm)
constexpr bool runtime_detection_algorithm_valid (DetectionAlgorithm algorithm)
constexpr bool runtime_profile_valid (RuntimeProfile profile)
constexpr bool runtime_traffic_mode_valid (RuntimeTrafficMode mode)
constexpr bool runtime_csi_traffic_mode_valid (CsiTrafficMode mode)
constexpr bool runtime_csi_traffic_mode_valid_for_profile (RuntimeProfile profile, CsiTrafficMode mode)
constexpr float runtime_default_threshold (DetectionAlgorithm algorithm)
bool validate_runtime_threshold (float threshold)
bool validate_runtime_threshold_for_algorithm (float threshold, DetectionAlgorithm algorithm)
bool validate_runtime_float (float value, float min_value, float max_value)
bool validate_runtime_uint32 (uint32_t value, uint32_t min_value, uint32_t max_value)
bool validate_runtime_uint8 (uint8_t value, uint8_t min_value, uint8_t max_value)
RuntimeConfigError validate_runtime_config (const RuntimeConfig &config)
 Validate the complete configuration before creating runtime state.
const char * runtime_config_error_message (RuntimeConfigError error)
 Stable diagnostic label for a configuration error.
const char * runtime_profile_name (RuntimeProfile profile)
const char * wifi_band_policy_name (WifiBandPolicy policy)
const char * traffic_mode_name (RuntimeTrafficMode mode)
const char * csi_traffic_mode_name (CsiTrafficMode mode)
bool csi_traffic_mode_is_sensing_control (CsiTrafficMode mode)
CsiTrafficMode normalize_sensing_csi_traffic_mode (CsiTrafficMode mode)
const char * detection_algorithm_name (DetectionAlgorithm algorithm)
const char * subcarrier_source_name (RuntimeSubcarrierSource source)
RuntimeTrafficMode parse_traffic_mode (const char *mode)
CsiTrafficMode parse_csi_traffic_mode (const char *mode)
DetectionAlgorithm parse_detection_algorithm (const char *algorithm)
WifiBandPolicy parse_wifi_band_policy (const char *policy)
RuntimeConfig make_runtime_sensing_config ()
void visit_runtime_diagnostics (const RuntimeConfig &config, const RuntimeSnapshot &snapshot, runtime_diagnostic_visitor_t visitor)
bool parse_direct_websocket_request (const std::string &payload, DirectWebSocketRequest *request, std::string *error=nullptr)
bool direct_websocket_request_to_command (const DirectWebSocketRequest &request, EspectreCommand *command, std::string *error=nullptr)
std::string direct_websocket_success_response (const std::string &id, const std::string &result_json="{}")
std::string direct_websocket_error_response (const std::string &id, const char *code, const char *message)
std::string direct_websocket_event (const char *event, const std::string &data_json)
const char * espectre_firmware_version ()
 The running application's version, as your build system defined it.
RuntimeConfig make_runtime_sensing_config_from_kconfig ()
 Build a RuntimeConfig from the ESPECTRE_* menuconfig options.
constexpr SelectedSubcarriers make_default_subcarriers ()
uint8_t ht20_bins_with_energy (const int8_t *csi_data, const uint8_t *bins, uint8_t count)
Ht20BinLayout detect_ht20_bin_layout (const int8_t *csi_data, size_t csi_len)
 Identify which HT20 bin ordering a 64-subcarrier payload uses.
void rotate_ht20_classic_to_centered (const int8_t *csi_data, int8_t *out)
 Rotate a classic-order HT20 payload into the centered convention.
float calculate_spatial_turbulence (const float *magnitudes, const uint8_t *subcarriers, uint8_t num_subcarriers, uint16_t max_subcarrier=64)
 Calculate spatial turbulence from pre-calculated magnitudes.
uint8_t extract_subcarrier_amplitudes (const int8_t *csi_data, size_t csi_len, const uint8_t *subcarriers, uint8_t num_subcarriers, float *out, uint8_t out_capacity)
 Extract subcarrier amplitudes from raw CSI data (I/Q pairs).
uint8_t extract_packet_subcarrier_amplitudes (const int8_t *csi_data, size_t csi_len, float *out, uint8_t out_capacity)
 Extract one packet-wide amplitude frame for reuse by multiple feature paths.
uint8_t fill_packet_subcarrier_energies (const int8_t *csi_data, size_t csi_len, float *out, uint8_t out_capacity)
 Fill one packet-wide squared-magnitude frame for energy-domain consumers.
void energies_to_amplitudes_in_place (float *values, uint8_t count)
uint8_t select_subcarrier_amplitudes (const float *packet_amplitudes, uint8_t packet_count, const uint8_t *subcarriers, uint8_t num_subcarriers, float *out, uint8_t out_capacity)
 Select the configured tones from a packet-wide amplitude frame.
uint8_t select_adjacent_aggregated_subcarrier_amplitudes (const float *packet_amplitudes, uint8_t packet_count, const uint8_t *subcarriers, uint8_t num_subcarriers, uint8_t width, float *out, uint8_t out_capacity)
 Select adjacent-bin mean amplitudes from a packet-wide amplitude frame.
uint8_t extract_adjacent_aggregated_subcarrier_amplitudes (const int8_t *csi_data, size_t csi_len, const uint8_t *subcarriers, uint8_t num_subcarriers, uint8_t width, float *out, uint8_t out_capacity)
 Extract one mean magnitude per selected tone from adjacent live HT20 bins.
float calculate_spatial_turbulence_from_amplitudes (const float *amplitudes, uint8_t count)
float calculate_spatial_turbulence_from_csi (const int8_t *csi_data, size_t csi_len, const uint8_t *subcarriers, uint8_t num_subcarriers)
 Calculate spatial turbulence directly from raw CSI data (I/Q pairs).
void lowpass_filter_init (lowpass_filter_state_t *state, float cutoff_hz, float sample_rate_hz, bool enabled)
float lowpass_filter_apply (lowpass_filter_state_t *state, float value)
void lowpass_filter_reset (lowpass_filter_state_t *state)
void hampel_turbulence_init (hampel_turbulence_state_t *state, uint8_t window_size, float threshold, bool enabled)
float hampel_filter (const float *window, size_t window_size, float current_value, float threshold)
 Stateless Hampel decision over a caller-owned window.
float hampel_filter_turbulence (hampel_turbulence_state_t *state, float turbulence)
float calculate_mean (const float *values, size_t n)
 Calculate mean of an array.
float calculate_median_float (float *arr, size_t size)
 Calculate median of a float array (sorts array in-place).
float apply_cv_normalization (float std_dev, float mean)
 Apply gain-invariant normalization to standard deviation.
float calculate_turbulence_from_variance (float variance, const float *values, size_t count)
 Calculate turbulence from variance with gain-invariant normalization.
MeanVariance calculate_mean_variance_two_pass (const float *values, size_t n)
 Calculate mean and variance in one two-pass sweep (numerically stable).
float calculate_variance_two_pass (const float *values, size_t n)
 Calculate variance using the two-pass algorithm.
float calculate_magnitude (int8_t i, int8_t q)
 Calculate magnitude (amplitude) from I/Q components.
uint8_t normalize_amplitude_profile (const float *amplitudes, uint8_t count, float mean, float *out)
 Write the mean-normalized amplitude profile into out.
uint8_t normalize_amplitude_profile (const float *amplitudes, uint8_t count, float *out)
MLFeatureSource ml_feature_source (MLFeatureId id)
bool ml_feature_needs_l1_tracker (uint8_t id)
bool ml_feature_needs_channel_shape_trajectory_tracker (uint8_t id)
bool ml_feature_needs_aggregated_turbulence (uint8_t id)
float median_from_sorted (const float *sorted_values, uint16_t count)
float percentile_from_sorted (const float *sorted_values, uint16_t count, float quantile)
float order_statistic_in_place (float *values, uint16_t count, uint16_t index)
float percentile_in_place (float *values, uint16_t count, float quantile)
float calc_autocorrelation (const float *values, uint16_t count, float mean, float variance, uint16_t lag=1)
float calc_zero_crossing_rate (const float *values, uint16_t count, float center)
MLStatNeeds ml_series_needs (const uint8_t *feature_ids, uint8_t num_features, MLFeatureSource wanted)
void compute_ml_series_stats (const float *values, uint16_t count, MLSeriesStats *out, const MLStatNeeds &needs, const MLSeriesScratch &scratch)
float ml_feature_value_from_stats (uint8_t id, const MLSeriesStats &turb, const MLSeriesStats &aggregated_turb, float l1_delta_lag_ratio, float chan_shape_spread_subband, float chan_shape_coherent_innovation_energy, float chan_shape_excess_path, float chan_shape_subband_kendall_lag_excess)
 Resolve one exported ML feature from precomputed series and tracker stats.
void extract_ml_features_by_id (const float *turb_buffer, uint16_t turb_count, const float *aggregated_turb_buffer, uint16_t aggregated_turb_count, const uint8_t *feature_ids, uint8_t num_features, float *features_out, const MLSeriesScratch &series_scratch, float l1_delta_lag_ratio, float chan_shape_spread_subband, float chan_shape_coherent_innovation_energy, float chan_shape_excess_path, float chan_shape_subband_kendall_lag_excess)
float motion_participation (const float *energy, uint8_t count)
bool is_valid_threshold (float threshold, float min_threshold, float max_threshold)
 Validate threshold value against finite/range constraints.
float clamp_threshold (float threshold, float min_threshold, float max_threshold)
 Clamp threshold to [min, max] and recover non-finite values.
Device identity

Resolve, format, and parse the identity a device presents on the wire.

std::string format_espectre_device_id (uint64_t device_id)
 Format a device id in its canonical wire form.
bool parse_espectre_device_id (const std::string &value, uint64_t *device_id)
 Parse a device id from its wire form.
uint64_t espectre_device_id_from_mac (const uint8_t *mac, size_t mac_len)
 Pack the first six MAC bytes into the historical numeric representation.
std::string espectre_device_name (uint64_t device_id, const char *chip=nullptr)
 Conventional device name derived from the immutable device identifier.
uint64_t espectre_effective_device_id_u64 (const EspectreDeviceConfig &config)
 The id actually in use.
std::string espectre_effective_device_id (const EspectreDeviceConfig &config)
 espectre_effective_device_id_u64() in wire form.
std::string espectre_effective_device_label (const EspectreDeviceConfig &config)
 The configured label, or the effective device id when no label is set.
EspectreDeviceInfo normalize_protocol_device_info (const EspectreDeviceInfo &info, const RuntimeSnapshot *snapshot, bool supports_ota, const char *default_frontend, const char *default_chip=nullptr)
 Fill in the parts of a device info block the frontend did not set.
void clear_espectre_mqtt_config (EspectreDeviceConfig *config)
 Erase broker settings while preserving identity, for a config reset.
Topics and payloads

Build the wire representation from runtime state.

Each returns a complete payload ready to hand to a transport.

std::string espectre_topic (const EspectreDeviceConfig &config, const char *suffix)
 Build a full topic from this device's prefix and a trailing segment.
std::string espectre_status_payload (const EspectreDeviceConfig &config, bool online, uint32_t timestamp_ms)
 Availability payload.
std::string espectre_info_payload (const EspectreDeviceConfig &config, const EspectreDeviceInfo &info)
 Device description, supported controls, and optional CSI traffic settings.
std::string espectre_commands_payload (const EspectreDeviceConfig &config, const EspectreDeviceInfo &info)
 MQTT command catalog for the current frontend.
std::string espectre_telemetry_payload (const EspectreDeviceConfig &config, const RuntimeSnapshot &snapshot, uint32_t timestamp_ms, uint32_t uptime_s, const char *frontend)
 Motion state, metric, and threshold.
std::string espectre_stats_payload (const EspectreDeviceConfig &config, const RuntimeSnapshot &snapshot, uint32_t timestamp_ms, uint32_t uptime_s, float free_memory_kb, float loop_time_ms, const RuntimeDiagnosticsSample *diagnostics=nullptr)
 Health counters plus optional rate and link diagnostics.
std::string espectre_command_result_payload (const EspectreDeviceConfig &config, const EspectreCommand &command, bool accepted, const char *message)
 Acknowledge a command, echoing its command_id.
std::string espectre_ota_status_payload (const EspectreDeviceConfig &config, const EspectreOtaStatus &status, uint32_t timestamp_ms)
 OTA progress payload, for each IOtaService status callback worth publishing.
Command parsing

Turn received bytes into validated values.

bool parse_espectre_command (const std::string &payload, EspectreCommand *command, std::string *error)
 Parse a JSON command payload from the MQTT command topic.
bool parse_espectre_command_request (const std::string &command_id, const std::string &command_name, const std::string &params_json, EspectreCommand *command, std::string *error)
 Parse a transport-neutral command name plus a JSON parameter object.
bool espectre_ota_channel_accepted (const std::string &channel)
 Whether channel is a published OTA channel name.
std::string espectre_ota_manifest_url (const char *frontend, const char *chip, const std::string &channel)
 Built-in GitHub Releases manifest URL for a frontend, chip, and channel.
bool parse_espectre_config_command (const std::string &command, EspectreDeviceConfig *config, std::string *error)
 Parse a legacy ASCII SET_DEVICE_CONFIG: command.
bool parse_espectre_mqtt_config_command (const std::string &command, EspectreDeviceConfig *config, std::string *error)
 Parse a SET_MQTT_CONFIG: command, carrying the broker settings.

Variables

constexpr const char *const RUNTIME_TRAFFIC_GENERATOR_MODE_DNS_NAME = "dns"
constexpr const char *const RUNTIME_TRAFFIC_GENERATOR_MODE_PING_NAME = "ping"
constexpr const char *const RUNTIME_TRAFFIC_GENERATOR_MODE_DEFAULT_NAME = "ping"
constexpr const char *const RUNTIME_CSI_TRAFFIC_MODE_INTERNAL_NAME = "internal"
constexpr const char *const RUNTIME_CSI_TRAFFIC_MODE_EXTERNAL_NAME = "external"
constexpr const char *const RUNTIME_CSI_TRAFFIC_MODE_PACING_NAME = "pacing"
constexpr const char *const RUNTIME_CSI_TRAFFIC_MODE_DISABLED_NAME = "disabled"
constexpr const char *const RUNTIME_CSI_TRAFFIC_MODE_DEFAULT_NAME = "internal"
constexpr const char *const RUNTIME_DETECTION_ALGORITHM_LIGHTWEIGHT_NAME = "lightweight"
constexpr const char *const RUNTIME_DETECTION_ALGORITHM_HIGH_ACCURACY_NAME = "high_accuracy"
constexpr const char *const RUNTIME_DETECTION_ALGORITHM_DEFAULT_NAME = "lightweight"
constexpr float RUNTIME_THRESHOLD_MIN = 0.0f
constexpr float RUNTIME_THRESHOLD_MAX = 1.0f
constexpr float RUNTIME_HIGH_ACCURACY_THRESHOLD_MAX = 1.0f
constexpr float RUNTIME_SEGMENTATION_THRESHOLD_DEFAULT = LIGHTWEIGHT_DEFAULT_THRESHOLD
constexpr uint32_t RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_MIN = 1000U
constexpr uint32_t RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_MAX = 2000U
constexpr uint32_t RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_DEFAULT = 1000U
constexpr uint32_t RUNTIME_CSI_TARGET_PPS_MIN = 1U
constexpr uint32_t RUNTIME_CSI_TARGET_PPS_MAX = 500U
constexpr uint32_t RUNTIME_CSI_TARGET_PPS_DEFAULT = 100U
constexpr uint32_t RUNTIME_PUBLISH_INTERVAL_MS_MIN = 100
constexpr uint32_t RUNTIME_PUBLISH_INTERVAL_MS_MAX = 60000
constexpr uint32_t RUNTIME_PUBLISH_INTERVAL_MS_DEFAULT = 1000
constexpr uint32_t RUNTIME_EVALUATION_INTERVAL_MS_MIN = 10
constexpr uint32_t RUNTIME_EVALUATION_INTERVAL_MS_MAX = 10000
constexpr uint32_t RUNTIME_EVALUATION_INTERVAL_MS_DEFAULT = 250
constexpr uint8_t RUNTIME_MOTION_HITS_MIN = 1
constexpr uint8_t RUNTIME_MOTION_HITS_MAX = 20
constexpr uint8_t RUNTIME_MOTION_ON_HITS_DEFAULT = 4
constexpr uint8_t RUNTIME_MOTION_OFF_HITS_DEFAULT = 3
constexpr bool RUNTIME_LOWPASS_ENABLED_DEFAULT = false
constexpr float RUNTIME_LOWPASS_CUTOFF_MIN = 5.0f
constexpr float RUNTIME_LOWPASS_CUTOFF_MAX = 20.0f
constexpr float RUNTIME_LOWPASS_CUTOFF_DEFAULT = 11.0f
constexpr bool RUNTIME_HAMPEL_ENABLED_DEFAULT = true
constexpr uint8_t RUNTIME_HAMPEL_WINDOW_MIN = 3
constexpr uint8_t RUNTIME_HAMPEL_WINDOW_MAX = 11
constexpr uint8_t RUNTIME_HAMPEL_WINDOW_DEFAULT = 7
constexpr float RUNTIME_HAMPEL_THRESHOLD_MIN = 1.0f
constexpr float RUNTIME_HAMPEL_THRESHOLD_MAX = 10.0f
constexpr float RUNTIME_HAMPEL_THRESHOLD_DEFAULT = 5.0f
constexpr uint16_t RUNTIME_STREAM_COLLECTOR_PORT_DEFAULT = 5001
constexpr uint16_t RUNTIME_NETWORK_PORT_MIN = 1U
constexpr uint16_t RUNTIME_NETWORK_PORT_MAX = UINT16_MAX
constexpr uint32_t RUNTIME_STREAM_LOG_INTERVAL_MS_MIN = 100U
constexpr uint32_t RUNTIME_STREAM_LOG_INTERVAL_MS_MAX = 60000U
constexpr uint32_t RUNTIME_STREAM_LOG_INTERVAL_MS_DEFAULT = 1000
constexpr uint8_t RUNTIME_STREAM_TX_BATCH_RECORDS_MIN = 1U
constexpr uint8_t RUNTIME_STREAM_TX_BATCH_RECORDS_MAX = 7U
constexpr uint8_t RUNTIME_STREAM_TX_BATCH_RECORDS_DEFAULT = 4
constexpr uint16_t RUNTIME_CSI_TRAFFIC_UDP_PORT_DEFAULT = 5555
constexpr const char *const RUNTIME_CSI_TRAFFIC_MULTICAST_GROUP_DEFAULT = "239.255.0.1"
constexpr size_t RUNTIME_CSI_TRAFFIC_EXPECTED_PAYLOAD_MAX = 16U
constexpr const char * ESPECTRE_PROTOCOL_VERSION = "1.0"
 Protocol version reported in payloads.
constexpr const char * ESPECTRE_TOPIC_PREFIX = "espectre/v1/devices"
 Default MQTT topic root.
constexpr const char * ESPECTRE_OTA_CHANNEL_RELEASE = "release"
 Official tagged GitHub Release OTA channel.
constexpr const char * ESPECTRE_OTA_CHANNEL_PREVIEW = "preview"
 Rolling main OTA channel.
constexpr const char * ESPECTRE_OTA_CHANNEL_DEVELOP = "develop"
 Rolling develop OTA channel.
constexpr const char * ESPECTRE_OTA_RELEASE_TAG_PREVIEW = "snapshot"
 GitHub Releases tag for the preview OTA channel.
constexpr const char * ESPECTRE_OTA_RELEASE_TAG_DEVELOP = "snapshot-dev"
 GitHub Releases tag for the develop OTA channel.
constexpr uint64_t ESPECTRE_DEFAULT_DEVICE_ID = 0U
 Sentinel meaning "use the runtime-generated device id".
constexpr const char * ESPECTRE_DEFAULT_DEVICE_LABEL = ""
 Empty label, meaning the device id is used as the display name.
constexpr const char * ESPECTRE_DIRECT_WEBSOCKET_ENDPOINT = "/espectre/v1/ws"
constexpr const char * ESPECTRE_DIRECT_WEBSOCKET_SUBPROTOCOL = "espectre.v1"
constexpr unsigned ESPECTRE_DIRECT_ENVELOPE_VERSION = 1U
constexpr size_t ESPECTRE_DIRECT_MAX_FRAME_SIZE = 4096U
constexpr size_t ESPECTRE_DIRECT_MAX_REQUEST_ID_SIZE = 64U
constexpr size_t ESPECTRE_DIRECT_MAX_METHOD_SIZE = 64U
constexpr float LIGHTWEIGHT_DEFAULT_THRESHOLD = 0.6621854538596202f
constexpr float LIGHTWEIGHT_MIN_THRESHOLD = 0.0f
constexpr float LIGHTWEIGHT_MAX_THRESHOLD = 1.0f
constexpr float LIGHTWEIGHT_STARTUP_THRESHOLD_FACTOR = 1.0f
constexpr float HIGH_ACCURACY_DEFAULT_THRESHOLD = 0.5f
constexpr float HIGH_ACCURACY_MIN_THRESHOLD = 0.0f
constexpr float HIGH_ACCURACY_MAX_THRESHOLD = 1.0f
constexpr float HIGH_ACCURACY_METRIC_SCALE = 1.0f
constexpr float LOWPASS_CUTOFF_DEFAULT = 11.0f
constexpr float LOWPASS_CUTOFF_MIN = 5.0f
constexpr float LOWPASS_CUTOFF_MAX = 20.0f
constexpr float LOWPASS_SAMPLE_RATE = 100.0f
constexpr uint8_t HAMPEL_TURBULENCE_WINDOW_MIN = 3U
constexpr uint8_t HAMPEL_TURBULENCE_WINDOW_MAX = 11U
constexpr uint8_t HAMPEL_TURBULENCE_WINDOW_DEFAULT = 7U
constexpr float HAMPEL_TURBULENCE_THRESHOLD_DEFAULT = 5.0f
constexpr uint16_t HT20_NUM_SUBCARRIERS = 64U
constexpr uint16_t HT20_CSI_LEN = 128U
constexpr uint16_t HT20_CSI_LEN_DOUBLE = 256U
constexpr uint16_t HT20_CSI_LEN_SHORT = 114U
constexpr uint16_t HT20_CSI_LEN_SHORT_DOUBLE = 228U
constexpr uint8_t HT20_CSI_LEN_SHORT_LEFT_PAD = 8U
constexpr uint8_t HT20_GUARD_BAND_LOW = 4U
constexpr uint8_t HT20_GUARD_BAND_HIGH = 60U
constexpr uint8_t HT20_DC_SUBCARRIER = 32U
constexpr uint8_t HT20_SELECTED_BAND_SIZE = 12U
constexpr uint8_t DEFAULT_SUBCARRIERS [HT20_SELECTED_BAND_SIZE]
constexpr float LIGHTWEIGHT_AUTOCORR_CENTER = 0.3919344866784947f
constexpr float LIGHTWEIGHT_AUTOCORR_SCALE = 0.3798648330757351f
constexpr float LIGHTWEIGHT_AUTOCORR_WEIGHT = 5.083034533668216f
constexpr float LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_CENTER = 0.24612139211074338f
constexpr float LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_SCALE = 0.20056599613462603f
constexpr float LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_WEIGHT = 4.997501915217463f
constexpr float LIGHTWEIGHT_INTERCEPT = 1.0776769868761f
constexpr float LIGHTWEIGHT_TRAIN_IDLE_Q95_LOGIT = -2.253902812716911f
constexpr float LIGHTWEIGHT_STARTUP_QUANTILE = 0.95f
constexpr float LIGHTWEIGHT_STARTUP_STRENGTH = 0.5f
constexpr uint8_t LIGHTWEIGHT_STARTUP_SAMPLE_LIMIT = 64U
constexpr uint8_t LIGHTWEIGHT_SETTLE_BLOCKS = 12U
constexpr uint8_t LIGHTWEIGHT_SETTLE_BLOCK_EVALUATIONS = 20U
constexpr float LIGHTWEIGHT_SETTLE_MARGIN_LOGITS = 2.7f
constexpr uint8_t HT20_CLASSIC_ONLY_NULL_BINS [] = {29, 30, 31, 33, 34, 35}
constexpr uint8_t HT20_CENTERED_ONLY_NULL_BINS [] = {1, 2, 3, 61, 62, 63}
constexpr uint32_t DETECTOR_WINDOW_SIZE_MS_MIN = 1000U
constexpr uint32_t DETECTOR_WINDOW_SIZE_MS_MAX = 2000U
constexpr uint32_t DETECTOR_WINDOW_SIZE_MS_DEFAULT = 1000U
constexpr uint16_t DETECTOR_DEFAULT_WINDOW_SIZE = 100
constexpr uint16_t DETECTOR_MIN_WINDOW_SIZE = 1
constexpr uint16_t DETECTOR_MAX_WINDOW_SIZE = 1000
constexpr uint16_t CALIBRATION_NUM_WINDOWS = 10
constexpr uint16_t CALIBRATION_DEFAULT_BUFFER_SIZE
constexpr uint32_t EVALUATION_INTERVAL_US = 250000U
constexpr uint32_t L1_DELTA_LAG_US = 100000U
constexpr uint32_t TURB_AUTOCORR_LAG_US = 10000U
constexpr uint16_t DETECTOR_L1_DELTA_LAG_DEFAULT = 10U
constexpr uint16_t DETECTOR_AUTOCORR_LAG_DEFAULT = 1U
constexpr uint16_t L1_DELTA_LAG_MAX = 32
constexpr uint32_t MIN_PLAUSIBLE_PACKET_INTERVAL_US = 200U
constexpr float MAD_SCALE_FACTOR = 1.4826f
constexpr uint8_t L1_DELTA_LAG = 10
constexpr float L1_DELTA_STARTUP_THRESHOLD_FACTOR = 1.1f
constexpr uint8_t TURB_IQR_AGGREGATION_WIDTH = 5U
constexpr uint8_t HT20_LIVE_BAND_SIZE = 56U
constexpr std::array< uint8_t, HT20_LIVE_BAND_SIZEHT20_LIVE_BINS
constexpr uint8_t CHANNEL_SHAPE_SUBBAND_COUNT = 8U
constexpr uint8_t CHANNEL_SHAPE_SUBBAND_SIZE
constexpr uint32_t CHANNEL_SHAPE_BIN_US = 80000U
constexpr uint32_t CHANNEL_SHAPE_WINDOW_US = 1000000U
constexpr uint8_t CHANNEL_SHAPE_WINDOW_BINS
constexpr uint8_t CHANNEL_SHAPE_MAX_PROFILES_PER_BIN = L1_DELTA_LAG_MAX
constexpr float CHANNEL_SHAPE_KENDALL_RELATIVE_DEADBAND = 0.02f
constexpr uint8_t CHANNEL_SHAPE_KENDALL_MIN_COMPARABLE_PAIRS = 8U
constexpr std::array< std::array< float, CHANNEL_SHAPE_SUBBAND_COUNT >, CHANNEL_SHAPE_SUBBAND_COUNTCHANNEL_SHAPE_DCT
constexpr float SEGMENTATION_DEFAULT_THRESHOLD = 1.0f
constexpr float SEGMENTATION_MIN_THRESHOLD = 1e-9f
constexpr float SEGMENTATION_MAX_THRESHOLD = 10.0f
constexpr float DEFAULT_ADAPTIVE_FACTOR = 1.3f
constexpr uint8_t STARTUP_GATE_CHUNKS = 6
constexpr float STARTUP_GATE_SPREAD_RATIO = 1.10f
constexpr float STARTUP_GATE_ANCHOR_RATIO = 1.5f
constexpr uint8_t STARTUP_MOTION_CHUNK_SIZE = 25
constexpr uint8_t STARTUP_MOTION_MIN_QUIET_CHUNKS = 2
constexpr uint8_t STARTUP_MOTION_CONFIRM_CHUNKS = 2
constexpr uint8_t STARTUP_POST_MOTION_QUIET_CHUNKS = 2
constexpr float STARTUP_QUIET_STABILITY_RATIO = 1.20f
constexpr float STARTUP_MOTION_TRIGGER_RATIO = 1.80f
constexpr float STARTUP_QUIET_RETURN_RATIO = 1.25f
constexpr float STARTUP_MOTION_GAP_RATIO = 1.35f
constexpr float STARTUP_NO_MOTION_FALLBACK_MARGIN = 1.03f
constexpr uint8_t STARTUP_MOTION_MAX_LEVELS = 40

Typedef Documentation

◆ runtime_diagnostic_visitor_t

using espectre::runtime_diagnostic_visitor_t = std::function<void(const char *key, const char *value)>

Definition at line 104 of file runtime_diagnostics.h.

◆ SelectedSubcarriers

Definition at line 32 of file csi_types.h.

◆ hampel_filter_state_t

Enumeration Type Documentation

◆ WifiBandPolicy

enum class espectre::WifiBandPolicy : uint8_t
strong

Wi-Fi band selection requested by the embedding frontend.

Enumerator
BAND_2G 

Restrict association to 2.4 GHz.

This is the validated production default.

BAND_5G 

Restrict association to 5 GHz.

Supported only by dual-band targets.

AUTO 

Let a dual-band radio choose between 2.4 GHz and 5 GHz.

Definition at line 34 of file runtime_interface.h.

◆ RuntimeSubcarrierSource

How the runtime chose the subcarriers it measures on.

Enumerator
FIXED_DEFAULT 

The fixed band validated for the shipped detectors.

Currently the only mode.

Definition at line 21 of file runtime_snapshot.h.

◆ DetectionAlgorithm

enum class espectre::DetectionAlgorithm
strong

Which detector runs.

See docs/ALGORITHMS.md for how they differ.

Enumerator
LIGHTWEIGHT 

Lightweight feature fusion.

Self-calibrates, and needs no training data. Default.

HIGH_ACCURACY 

High-accuracy neural detector using the trained weights in core/ml_weights.h.

Definition at line 38 of file runtime_sensing_schema.h.

◆ RuntimeProfile

enum class espectre::RuntimeProfile
strong

Which runtime backend the controller builds.

Enumerator
SENSING 

Detect motion on-device and report state.

The normal profile.

STREAM 

Ship raw CSI to a host collector instead of detecting.

For dataset collection and offline analysis. Requires a build with the stream runtime compiled in; setup() fails otherwise.

Definition at line 46 of file runtime_sensing_schema.h.

◆ RuntimeTrafficMode

enum class espectre::RuntimeTrafficMode
strong

Which packet the internal generator sends to solicit CSI from the AP.

Enumerator
DNS 

DNS queries.

Useful where ICMP is filtered.

PING 

ICMP echo.

Default.

Definition at line 59 of file runtime_sensing_schema.h.

◆ RuntimeConfigError

enum class espectre::RuntimeConfigError : uint8_t
strong

Machine-readable reason a RuntimeConfig cannot be applied.

Enumerator
NONE 
RUNTIME_PROFILE 
WIFI_BAND_POLICY 
DETECTION_ALGORITHM 
SEGMENTATION_THRESHOLD 
SEGMENTATION_WINDOW_SIZE_MS 
CSI_TARGET_PPS 
TRAFFIC_GENERATOR_MODE 
CSI_TRAFFIC_MODE 
CSI_TRAFFIC_UDP_PORT 
CSI_TRAFFIC_MULTICAST_GROUP 
CSI_TRAFFIC_EXPECTED_PAYLOAD 
STREAM_COLLECTOR_PORT 
STREAM_LOG_INTERVAL_MS 
STREAM_TX_BATCH_RECORDS 
PUBLISH_INTERVAL_MS 
EVALUATION_INTERVAL_MS 
MOTION_HITS 
LOWPASS_CUTOFF 
HAMPEL_WINDOW 
HAMPEL_THRESHOLD 

Definition at line 17 of file runtime_config_utils.h.

◆ CsiTrafficMode

enum class espectre::CsiTrafficMode
strong

Where the CSI-bearing traffic comes from.

CSI is only produced when packets actually arrive, so something has to keep the link busy. This picks who does it.

Enumerator
INTERNAL 

The runtime generates its own traffic at csi_target_pps.

Default, and the only self-sufficient mode.

EXTERNAL 

Another device supplies the traffic; the runtime only listens.

PACING 

External traffic, with the runtime pacing the sender to hold the rate.

DISABLED 

No traffic management at all.

Only sensible when ambient traffic already sustains the packet rate the detector needs; otherwise the detector starves.

Definition at line 21 of file csi_traffic_types.h.

◆ EspectreOtaState

enum class espectre::EspectreOtaState : uint8_t
strong

OTA progress, as reported to clients.

A check runs IDLE -> CHECKING -> UPDATE_AVAILABLE or UP_TO_DATE. An update continues DOWNLOADING -> APPLYING -> REBOOT_SCHEDULED. ERROR is terminal for the attempt and carries the reason in EspectreOtaStatus::message.

Enumerator
IDLE 
CHECKING 
UPDATE_AVAILABLE 
UP_TO_DATE 
DOWNLOADING 
APPLYING 
REBOOT_SCHEDULED 
ERROR 

Definition at line 216 of file espectre_protocol.h.

◆ MotionState

enum class espectre::MotionState
strong

Debounced detector state.

Enumerator
IDLE 
MOTION 

Definition at line 16 of file detector_types.h.

◆ Ht20BinLayout

enum class espectre::Ht20BinLayout : uint8_t
strong
Enumerator
UNKNOWN 
CENTERED 
CLASSIC 

Definition at line 48 of file csi_format.h.

◆ MLFeatureId

enum espectre::MLFeatureId : uint8_t
Enumerator
ML_FEAT_TURB_AUTOCORR 
ML_FEAT_TURB_ZCR 
ML_FEAT_L1_DELTA_LAG_RATIO 
ML_FEAT_TURB_IQR_OVER_MEAN_AGGR 
ML_FEAT_CHAN_SHAPE_COHERENT_INNOVATION_ENERGY 
ML_FEAT_CHAN_SHAPE_EXCESS_PATH 
ML_FEAT_CHAN_SHAPE_SPREAD_SUBBAND 
ML_FEAT_CHAN_SHAPE_SUBBAND_KENDALL_LAG_EXCESS 

Definition at line 31 of file csi_features.h.

◆ MLFeatureSource

enum class espectre::MLFeatureSource : uint8_t
strong
Enumerator
TURBULENCE_SERIES 
AGGREGATED_TURBULENCE_SERIES 
L1_TRACKER 
CHANNEL_SHAPE_TRAJECTORY_TRACKER 

Definition at line 45 of file csi_features.h.

Function Documentation

◆ espectre_sdk_version()

const char * espectre::espectre_sdk_version ( )
constexpr

The SDK version as a string, usable where a macro is not.

Returns
ESPECTRE_SDK_VERSION_STRING, valid for the process lifetime.

Definition at line 69 of file espectre_sdk_version.h.

◆ runtime_threshold_max()

float espectre::runtime_threshold_max ( DetectionAlgorithm algorithm)
constexpr

Definition at line 134 of file runtime_sensing_schema.h.

◆ runtime_detection_algorithm_valid()

bool espectre::runtime_detection_algorithm_valid ( DetectionAlgorithm algorithm)
constexpr

Definition at line 139 of file runtime_sensing_schema.h.

◆ runtime_profile_valid()

bool espectre::runtime_profile_valid ( RuntimeProfile profile)
constexpr

Definition at line 144 of file runtime_sensing_schema.h.

◆ runtime_traffic_mode_valid()

bool espectre::runtime_traffic_mode_valid ( RuntimeTrafficMode mode)
constexpr

Definition at line 148 of file runtime_sensing_schema.h.

◆ runtime_csi_traffic_mode_valid()

bool espectre::runtime_csi_traffic_mode_valid ( CsiTrafficMode mode)
constexpr

Definition at line 152 of file runtime_sensing_schema.h.

◆ runtime_csi_traffic_mode_valid_for_profile()

bool espectre::runtime_csi_traffic_mode_valid_for_profile ( RuntimeProfile profile,
CsiTrafficMode mode )
constexpr

Definition at line 157 of file runtime_sensing_schema.h.

◆ runtime_default_threshold()

float espectre::runtime_default_threshold ( DetectionAlgorithm algorithm)
constexpr

Definition at line 165 of file runtime_sensing_schema.h.

◆ validate_runtime_threshold()

bool espectre::validate_runtime_threshold ( float threshold)

◆ validate_runtime_threshold_for_algorithm()

bool espectre::validate_runtime_threshold_for_algorithm ( float threshold,
DetectionAlgorithm algorithm )

◆ validate_runtime_float()

bool espectre::validate_runtime_float ( float value,
float min_value,
float max_value )

◆ validate_runtime_uint32()

bool espectre::validate_runtime_uint32 ( uint32_t value,
uint32_t min_value,
uint32_t max_value )

◆ validate_runtime_uint8()

bool espectre::validate_runtime_uint8 ( uint8_t value,
uint8_t min_value,
uint8_t max_value )

◆ validate_runtime_config()

RuntimeConfigError espectre::validate_runtime_config ( const RuntimeConfig & config)

Validate the complete configuration before creating runtime state.

◆ runtime_config_error_message()

const char * espectre::runtime_config_error_message ( RuntimeConfigError error)

Stable diagnostic label for a configuration error.

Never returns nullptr.

◆ runtime_profile_name()

const char * espectre::runtime_profile_name ( RuntimeProfile profile)

◆ wifi_band_policy_name()

const char * espectre::wifi_band_policy_name ( WifiBandPolicy policy)

◆ traffic_mode_name()

const char * espectre::traffic_mode_name ( RuntimeTrafficMode mode)

◆ csi_traffic_mode_name()

const char * espectre::csi_traffic_mode_name ( CsiTrafficMode mode)

◆ csi_traffic_mode_is_sensing_control()

bool espectre::csi_traffic_mode_is_sensing_control ( CsiTrafficMode mode)

◆ normalize_sensing_csi_traffic_mode()

CsiTrafficMode espectre::normalize_sensing_csi_traffic_mode ( CsiTrafficMode mode)

◆ detection_algorithm_name()

const char * espectre::detection_algorithm_name ( DetectionAlgorithm algorithm)

◆ subcarrier_source_name()

const char * espectre::subcarrier_source_name ( RuntimeSubcarrierSource source)

◆ parse_traffic_mode()

RuntimeTrafficMode espectre::parse_traffic_mode ( const char * mode)

◆ parse_csi_traffic_mode()

CsiTrafficMode espectre::parse_csi_traffic_mode ( const char * mode)

◆ parse_detection_algorithm()

DetectionAlgorithm espectre::parse_detection_algorithm ( const char * algorithm)

◆ parse_wifi_band_policy()

WifiBandPolicy espectre::parse_wifi_band_policy ( const char * policy)

◆ make_runtime_sensing_config()

RuntimeConfig espectre::make_runtime_sensing_config ( )

◆ visit_runtime_diagnostics()

void espectre::visit_runtime_diagnostics ( const RuntimeConfig & config,
const RuntimeSnapshot & snapshot,
runtime_diagnostic_visitor_t visitor )

◆ format_espectre_device_id()

std::string espectre::format_espectre_device_id ( uint64_t device_id)

Format a device id in its canonical wire form.

◆ parse_espectre_device_id()

bool espectre::parse_espectre_device_id ( const std::string & value,
uint64_t * device_id )

Parse a device id from its wire form.

Parameters
valueFormatted device id, as produced by format_espectre_device_id().
device_idWritten only when parsing succeeds.
Returns
false on a malformed value, leaving the output untouched.

◆ espectre_device_id_from_mac()

uint64_t espectre::espectre_device_id_from_mac ( const uint8_t * mac,
size_t mac_len )

Pack the first six MAC bytes into the historical numeric representation.

Deprecated
Runtime firmware uses the cached, domain-separated SHA-256 pseudonym from derive_runtime_device_id() instead.

◆ espectre_device_name()

std::string espectre::espectre_device_name ( uint64_t device_id,
const char * chip = nullptr )

Conventional device name derived from the immutable device identifier.

◆ espectre_effective_device_id_u64()

uint64_t espectre::espectre_effective_device_id_u64 ( const EspectreDeviceConfig & config)

The id actually in use.

Frontend startup replaces the zero sentinel.

◆ espectre_effective_device_id()

std::string espectre::espectre_effective_device_id ( const EspectreDeviceConfig & config)

◆ espectre_effective_device_label()

std::string espectre::espectre_effective_device_label ( const EspectreDeviceConfig & config)

The configured label, or the effective device id when no label is set.

◆ normalize_protocol_device_info()

EspectreDeviceInfo espectre::normalize_protocol_device_info ( const EspectreDeviceInfo & info,
const RuntimeSnapshot * snapshot,
bool supports_ota,
const char * default_frontend,
const char * default_chip = nullptr )

Fill in the parts of a device info block the frontend did not set.

Takes the detector from snapshot, and default_frontend / default_chip where the caller left the field empty, so each frontend only states what is genuinely its own.

Parameters
infoWhat the frontend knows about itself.
snapshotSource of the detector name. May be nullptr when no snapshot exists yet.
supports_otaWhether this frontend exposes firmware updates.
default_frontendFrontend name used when info.frontend is empty.
default_chipChip name used when info.chip is empty.
Returns
A copy of info with the gaps filled.

◆ clear_espectre_mqtt_config()

void espectre::clear_espectre_mqtt_config ( EspectreDeviceConfig * config)

Erase broker settings while preserving identity, for a config reset.

◆ espectre_topic()

std::string espectre::espectre_topic ( const EspectreDeviceConfig & config,
const char * suffix )

Build a full topic from this device's prefix and a trailing segment.

◆ espectre_status_payload()

std::string espectre::espectre_status_payload ( const EspectreDeviceConfig & config,
bool online,
uint32_t timestamp_ms )

Availability payload.

Publish it retained so late subscribers see it.

◆ espectre_info_payload()

std::string espectre::espectre_info_payload ( const EspectreDeviceConfig & config,
const EspectreDeviceInfo & info )

Device description, supported controls, and optional CSI traffic settings.

Publish retained on connect.

◆ espectre_commands_payload()

std::string espectre::espectre_commands_payload ( const EspectreDeviceConfig & config,
const EspectreDeviceInfo & info )

MQTT command catalog for the current frontend.

Published on commands/catalog in response to commands. The list is derived from the same supports_* flags carried by info.

◆ espectre_telemetry_payload()

std::string espectre::espectre_telemetry_payload ( const EspectreDeviceConfig & config,
const RuntimeSnapshot & snapshot,
uint32_t timestamp_ms,
uint32_t uptime_s,
const char * frontend )

Motion state, metric, and threshold.

The payload behind every motion update.

◆ espectre_stats_payload()

std::string espectre::espectre_stats_payload ( const EspectreDeviceConfig & config,
const RuntimeSnapshot & snapshot,
uint32_t timestamp_ms,
uint32_t uptime_s,
float free_memory_kb,
float loop_time_ms,
const RuntimeDiagnosticsSample * diagnostics = nullptr )

Health counters plus optional rate and link diagnostics.

diagnostics carries CSI and link rates from RuntimeDiagnosticsSampler. Pass nullptr only for a frontend that does not expose extended diagnostics.

◆ espectre_command_result_payload()

std::string espectre::espectre_command_result_payload ( const EspectreDeviceConfig & config,
const EspectreCommand & command,
bool accepted,
const char * message )

Acknowledge a command, echoing its command_id.

Publish one for every command you parse, accepted or not; clients correlate on the id and otherwise cannot tell rejection from packet loss.

◆ espectre_ota_status_payload()

std::string espectre::espectre_ota_status_payload ( const EspectreDeviceConfig & config,
const EspectreOtaStatus & status,
uint32_t timestamp_ms )

OTA progress payload, for each IOtaService status callback worth publishing.

◆ parse_espectre_command()

bool espectre::parse_espectre_command ( const std::string & payload,
EspectreCommand * command,
std::string * error )

Parse a JSON command payload from the MQTT command topic.

Parameters
payloadRaw message body as received.
commandPopulated only on success. Check the has_* flags to see which fields the peer actually sent.
errorReceives a human-readable reason on failure. May be nullptr.
Returns
false on malformed input or an unknown command.

◆ parse_espectre_command_request()

bool espectre::parse_espectre_command_request ( const std::string & command_id,
const std::string & command_name,
const std::string & params_json,
EspectreCommand * command,
std::string * error )

Parse a transport-neutral command name plus a JSON parameter object.

Direct WebSocket uses the request envelope id and method as the first two arguments. MQTT uses parse_espectre_command() for its flat payload.

◆ espectre_ota_channel_accepted()

bool espectre::espectre_ota_channel_accepted ( const std::string & channel)

Whether channel is a published OTA channel name.

Accepted values are release, preview, and develop. Empty is not accepted here; omit the field to keep the firmware default.

◆ espectre_ota_manifest_url()

std::string espectre::espectre_ota_manifest_url ( const char * frontend,
const char * chip,
const std::string & channel )

Built-in GitHub Releases manifest URL for a frontend, chip, and channel.

release uses /releases/latest/download/. preview uses tag ESPECTRE_OTA_RELEASE_TAG_PREVIEW (snapshot). develop uses tag ESPECTRE_OTA_RELEASE_TAG_DEVELOP (snapshot-dev).

Returns
Empty when frontend, chip, or channel is not a published value.

◆ parse_espectre_config_command()

bool espectre::parse_espectre_config_command ( const std::string & command,
EspectreDeviceConfig * config,
std::string * error )

Parse a legacy ASCII SET_DEVICE_CONFIG: command.

Carries one key=value pair, applied in place. A rejected command writes nothing.

Parameters
commandFull command string, including the SET_DEVICE_CONFIG: prefix.
configUpdated in place on success.
errorReceives a human-readable reason on failure. May be nullptr.

◆ parse_espectre_mqtt_config_command()

bool espectre::parse_espectre_mqtt_config_command ( const std::string & command,
EspectreDeviceConfig * config,
std::string * error )

Parse a SET_MQTT_CONFIG: command, carrying the broker settings.

Fields are applied as they are read, so a command rejected part-way through leaves config partially updated. Pass a copy and commit only on success. host and port are required; the rest keep their previous values.

◆ parse_direct_websocket_request()

bool espectre::parse_direct_websocket_request ( const std::string & payload,
DirectWebSocketRequest * request,
std::string * error = nullptr )

◆ direct_websocket_request_to_command()

bool espectre::direct_websocket_request_to_command ( const DirectWebSocketRequest & request,
EspectreCommand * command,
std::string * error = nullptr )

◆ direct_websocket_success_response()

std::string espectre::direct_websocket_success_response ( const std::string & id,
const std::string & result_json = "{}" )

◆ direct_websocket_error_response()

std::string espectre::direct_websocket_error_response ( const std::string & id,
const char * code,
const char * message )

◆ direct_websocket_event()

std::string espectre::direct_websocket_event ( const char * event,
const std::string & data_json )

◆ espectre_firmware_version()

const char * espectre::espectre_firmware_version ( )

The running application's version, as your build system defined it.

Resolved from APP_PROJECT_VER when set, otherwise from the ESP-IDF application descriptor, and "unknown" on a host build. In an SDK integration this is your product version, not ESPectre's: it is what the ESPectre Protocol reports as firmware_version and what OTA compares against. For the version of the ESPectre sources you compiled against, use ESPECTRE_SDK_VERSION_STRING from espectre_sdk_version.h.

Returns
A static string, valid for the process lifetime. Never nullptr.

◆ make_runtime_sensing_config_from_kconfig()

RuntimeConfig espectre::make_runtime_sensing_config_from_kconfig ( )

Build a RuntimeConfig from the ESPECTRE_* menuconfig options.

This is the ergonomic path on ESP-IDF: expose the sensing settings in menuconfig, call this at boot, and override only the fields your product computes at runtime.

config.device_id = my_device_id();
controller.set_config(config);
RuntimeConfig make_runtime_sensing_config_from_kconfig()
Build a RuntimeConfig from the ESPECTRE_* menuconfig options.
Everything the runtime needs to know before setup().
uint64_t device_id
Stable device identity used by the ESPectre Protocol and CSI streaming.

Every value is range-checked against the schema in runtime_sensing_schema.h. An out-of-range or unparseable option falls back to the documented default and logs a warning rather than failing the boot, so a bad sdkconfig degrades instead of bricking the device.

Options absent from the build, for instance when the SDK Kconfig is not sourced, compile to their defaults. Fields with no Kconfig option, such as device_id and the stream settings, keep their RuntimeConfig defaults.

Returns
A validated configuration, ready for RuntimeFrontendController::set_config().

◆ make_default_subcarriers()

SelectedSubcarriers espectre::make_default_subcarriers ( )
constexpr

Definition at line 34 of file csi_types.h.

◆ ht20_bins_with_energy()

uint8_t espectre::ht20_bins_with_energy ( const int8_t * csi_data,
const uint8_t * bins,
uint8_t count )
inline

Definition at line 54 of file csi_format.h.

◆ detect_ht20_bin_layout()

Ht20BinLayout espectre::detect_ht20_bin_layout ( const int8_t * csi_data,
size_t csi_len )
inline

Identify which HT20 bin ordering a 64-subcarrier payload uses.

Requires positive evidence in both directions: one guard set must be entirely null and the other entirely populated. Absence of energy alone is not enough, because a sparse or degenerate payload is null under both conventions.

Parameters
csi_dataRaw CSI payload (interleaved I/Q pairs)
csi_lenPayload length in bytes (must be HT20_CSI_LEN)
Returns
The detected layout, or UNKNOWN when the evidence is inconclusive

Definition at line 76 of file csi_format.h.

◆ rotate_ht20_classic_to_centered()

void espectre::rotate_ht20_classic_to_centered ( const int8_t * csi_data,
int8_t * out )
inline

Rotate a classic-order HT20 payload into the centered convention.

Rotating by half the FFT size is its own inverse, so one swap of the payload halves maps 0~31, -32~-1 onto -32~+31.

Parameters
csi_dataSource payload of HT20_CSI_LEN bytes
outDestination buffer of HT20_CSI_LEN bytes (must not alias the source)

Definition at line 106 of file csi_format.h.

◆ calculate_spatial_turbulence()

float espectre::calculate_spatial_turbulence ( const float * magnitudes,
const uint8_t * subcarriers,
uint8_t num_subcarriers,
uint16_t max_subcarrier = 64 )
inline

Calculate spatial turbulence from pre-calculated magnitudes.

Spatial turbulence is the standard deviation of magnitudes across selected subcarriers. It measures the spatial variability of the Wi-Fi channel - higher values indicate motion/disturbance.

Parameters
magnitudesArray of magnitude values (one per subcarrier)
subcarriersArray of selected subcarrier indices
num_subcarriersNumber of selected subcarriers (max 12)
max_subcarrierMaximum valid subcarrier index (default: 64 for HT20)
Returns
Turbulence value

Definition at line 128 of file csi_format.h.

◆ extract_subcarrier_amplitudes()

uint8_t espectre::extract_subcarrier_amplitudes ( const int8_t * csi_data,
size_t csi_len,
const uint8_t * subcarriers,
uint8_t num_subcarriers,
float * out,
uint8_t out_capacity )
inline

Extract subcarrier amplitudes from raw CSI data (I/Q pairs).

Mirrors the Python SegmentationContext._fill_amplitude_buffer helper.

Parameters
csi_dataRaw CSI data (interleaved I/Q pairs, Espressif format)
csi_lenLength of CSI data in bytes
subcarriersArray of selected subcarrier indices
num_subcarriersNumber of selected subcarriers
outOutput amplitude buffer
out_capacityCapacity of the output buffer
Returns
Number of amplitudes written

Definition at line 167 of file csi_format.h.

◆ extract_packet_subcarrier_amplitudes()

uint8_t espectre::extract_packet_subcarrier_amplitudes ( const int8_t * csi_data,
size_t csi_len,
float * out,
uint8_t out_capacity )
inline

Extract one packet-wide amplitude frame for reuse by multiple feature paths.

Definition at line 194 of file csi_format.h.

◆ fill_packet_subcarrier_energies()

uint8_t espectre::fill_packet_subcarrier_energies ( const int8_t * csi_data,
size_t csi_len,
float * out,
uint8_t out_capacity )
inline

Fill one packet-wide squared-magnitude frame for energy-domain consumers.

Definition at line 208 of file csi_format.h.

◆ energies_to_amplitudes_in_place()

void espectre::energies_to_amplitudes_in_place ( float * values,
uint8_t count )
inline

Definition at line 223 of file csi_format.h.

◆ select_subcarrier_amplitudes()

uint8_t espectre::select_subcarrier_amplitudes ( const float * packet_amplitudes,
uint8_t packet_count,
const uint8_t * subcarriers,
uint8_t num_subcarriers,
float * out,
uint8_t out_capacity )
inline

Select the configured tones from a packet-wide amplitude frame.

Definition at line 229 of file csi_format.h.

◆ select_adjacent_aggregated_subcarrier_amplitudes()

uint8_t espectre::select_adjacent_aggregated_subcarrier_amplitudes ( const float * packet_amplitudes,
uint8_t packet_count,
const uint8_t * subcarriers,
uint8_t num_subcarriers,
uint8_t width,
float * out,
uint8_t out_capacity )
inline

Select adjacent-bin mean amplitudes from a packet-wide amplitude frame.

Definition at line 244 of file csi_format.h.

◆ extract_adjacent_aggregated_subcarrier_amplitudes()

uint8_t espectre::extract_adjacent_aggregated_subcarrier_amplitudes ( const int8_t * csi_data,
size_t csi_len,
const uint8_t * subcarriers,
uint8_t num_subcarriers,
uint8_t width,
float * out,
uint8_t out_capacity )
inline

Extract one mean magnitude per selected tone from adjacent live HT20 bins.

Windows are clamped to bins 4..60 and skip the DC null at bin 32. This is the production counterpart of SegmentationContext._fill_adjacent_aggregated_amplitude_buffer.

Definition at line 281 of file csi_format.h.

◆ calculate_spatial_turbulence_from_amplitudes()

float espectre::calculate_spatial_turbulence_from_amplitudes ( const float * amplitudes,
uint8_t count )
inline

Definition at line 328 of file csi_format.h.

◆ calculate_spatial_turbulence_from_csi()

float espectre::calculate_spatial_turbulence_from_csi ( const int8_t * csi_data,
size_t csi_len,
const uint8_t * subcarriers,
uint8_t num_subcarriers )
inline

Calculate spatial turbulence directly from raw CSI data (I/Q pairs).

This is a convenience wrapper that calculates magnitudes internally before computing spatial turbulence.

HT20 only: 64 subcarriers, 128 bytes CSI data.

Parameters
csi_dataRaw CSI data (interleaved I/Q pairs)
csi_lenLength of CSI data in bytes (expected: 128 for HT20)
subcarriersArray of selected subcarrier indices
num_subcarriersNumber of selected subcarriers (max 12)
Returns
Turbulence value

Definition at line 351 of file csi_format.h.

◆ lowpass_filter_init()

void espectre::lowpass_filter_init ( lowpass_filter_state_t * state,
float cutoff_hz,
float sample_rate_hz,
bool enabled )

◆ lowpass_filter_apply()

float espectre::lowpass_filter_apply ( lowpass_filter_state_t * state,
float value )

◆ lowpass_filter_reset()

void espectre::lowpass_filter_reset ( lowpass_filter_state_t * state)

◆ hampel_turbulence_init()

void espectre::hampel_turbulence_init ( hampel_turbulence_state_t * state,
uint8_t window_size,
float threshold,
bool enabled )

◆ hampel_filter()

float espectre::hampel_filter ( const float * window,
size_t window_size,
float current_value,
float threshold )

Stateless Hampel decision over a caller-owned window.

Shared numeric core: hampel_filter_turbulence() pushes into its ring and then defers here, so the outlier rule exists in exactly one place. The scratch is two stack arrays bounded by HAMPEL_TURBULENCE_WINDOW_MAX (11 floats each), which is small enough for the CSI callback stack.

Returns
median when current_value is an outlier, otherwise current_value

◆ hampel_filter_turbulence()

float espectre::hampel_filter_turbulence ( hampel_turbulence_state_t * state,
float turbulence )

◆ calculate_mean()

float espectre::calculate_mean ( const float * values,
size_t n )
inline

Calculate mean of an array.

Parameters
valuesArray of float values
nNumber of values
Returns
Mean (0.0 if n == 0)

Definition at line 31 of file utils.h.

◆ calculate_median_float()

float espectre::calculate_median_float ( float * arr,
size_t size )
inline

Calculate median of a float array (sorts array in-place).

Parameters
arrArray of float values (will be sorted)
sizeNumber of values
Returns
Median value (0.0 if size == 0)

Definition at line 47 of file utils.h.

◆ apply_cv_normalization()

float espectre::apply_cv_normalization ( float std_dev,
float mean )
inline

Apply gain-invariant normalization to standard deviation.

CV (Coefficient of Variation) = std / mean Makes turbulence gain-invariant when AGC is not locked.

Parameters
std_devStandard deviation
meanMean value
Returns
Normalized turbulence

Definition at line 66 of file utils.h.

◆ calculate_turbulence_from_variance()

float espectre::calculate_turbulence_from_variance ( float variance,
const float * values,
size_t count )
inline

Calculate turbulence from variance with gain-invariant normalization.

Combines variance → std → normalization in one call.

Parameters
variancePre-calculated variance
valuesArray used for mean calculation
countNumber of values
Returns
Turbulence value

Definition at line 80 of file utils.h.

◆ calculate_mean_variance_two_pass()

MeanVariance espectre::calculate_mean_variance_two_pass ( const float * values,
size_t n )
inline

Calculate mean and variance in one two-pass sweep (numerically stable).

Two-pass algorithm: variance = sum((x - mean)^2) / n More stable than single-pass E[X²] - E[X]² for float32 arithmetic.

The single definition matters beyond DRY. Both detectors feed these values into a threshold comparison, and the C++/Python parity gate requires the two runtimes to decide identically, so the accumulation order has to be fixed in exactly one place. Three hand-rolled copies of these loops used to exist.

Parameters
valuesArray of float values
nNumber of values
Returns
Mean and variance (both 0.0 if n == 0)

Definition at line 108 of file utils.h.

◆ calculate_variance_two_pass()

float espectre::calculate_variance_two_pass ( const float * values,
size_t n )
inline

Calculate variance using the two-pass algorithm.

Parameters
valuesArray of float values
nNumber of values
Returns
Variance (0.0 if n == 0)

Definition at line 141 of file utils.h.

◆ calculate_magnitude()

float espectre::calculate_magnitude ( int8_t i,
int8_t q )
inline

Calculate magnitude (amplitude) from I/Q components.

Parameters
iIn-phase component
qQuadrature component
Returns
Magnitude = sqrt(I² + Q²)

Definition at line 152 of file utils.h.

◆ normalize_amplitude_profile() [1/2]

uint8_t espectre::normalize_amplitude_profile ( const float * amplitudes,
uint8_t count,
float mean,
float * out )
inline

Write the mean-normalized amplitude profile into out.

Shared numeric core for the C++ L1-delta tracker. The MicroPython tracker performs the same normalization directly in its packet loop.

Parameters
amplitudesInput amplitude values
countNumber of input values
meanPrecomputed arithmetic mean of the input values
outOutput buffer (at least count elements)
Returns
Number of values written (0 when the profile is invalid)

Definition at line 170 of file utils.h.

◆ normalize_amplitude_profile() [2/2]

uint8_t espectre::normalize_amplitude_profile ( const float * amplitudes,
uint8_t count,
float * out )
inline

Definition at line 186 of file utils.h.

◆ ml_feature_source()

MLFeatureSource espectre::ml_feature_source ( MLFeatureId id)
inline

Definition at line 52 of file csi_features.h.

◆ ml_feature_needs_l1_tracker()

bool espectre::ml_feature_needs_l1_tracker ( uint8_t id)
inline

Definition at line 75 of file csi_features.h.

◆ ml_feature_needs_channel_shape_trajectory_tracker()

bool espectre::ml_feature_needs_channel_shape_trajectory_tracker ( uint8_t id)
inline

Definition at line 81 of file csi_features.h.

◆ ml_feature_needs_aggregated_turbulence()

bool espectre::ml_feature_needs_aggregated_turbulence ( uint8_t id)
inline

Definition at line 86 of file csi_features.h.

◆ median_from_sorted()

float espectre::median_from_sorted ( const float * sorted_values,
uint16_t count )
inline

Definition at line 91 of file csi_features.h.

◆ percentile_from_sorted()

float espectre::percentile_from_sorted ( const float * sorted_values,
uint16_t count,
float quantile )
inline

Definition at line 99 of file csi_features.h.

◆ order_statistic_in_place()

float espectre::order_statistic_in_place ( float * values,
uint16_t count,
uint16_t index )
inline

Definition at line 110 of file csi_features.h.

◆ percentile_in_place()

float espectre::percentile_in_place ( float * values,
uint16_t count,
float quantile )
inline

Definition at line 116 of file csi_features.h.

◆ calc_autocorrelation()

float espectre::calc_autocorrelation ( const float * values,
uint16_t count,
float mean,
float variance,
uint16_t lag = 1 )
inline

Definition at line 129 of file csi_features.h.

◆ calc_zero_crossing_rate()

float espectre::calc_zero_crossing_rate ( const float * values,
uint16_t count,
float center )
inline

Definition at line 150 of file csi_features.h.

◆ ml_series_needs()

MLStatNeeds espectre::ml_series_needs ( const uint8_t * feature_ids,
uint8_t num_features,
MLFeatureSource wanted )
inline

Definition at line 207 of file csi_features.h.

◆ compute_ml_series_stats()

void espectre::compute_ml_series_stats ( const float * values,
uint16_t count,
MLSeriesStats * out,
const MLStatNeeds & needs,
const MLSeriesScratch & scratch )
inline

Definition at line 238 of file csi_features.h.

◆ ml_feature_value_from_stats()

float espectre::ml_feature_value_from_stats ( uint8_t id,
const MLSeriesStats & turb,
const MLSeriesStats & aggregated_turb,
float l1_delta_lag_ratio,
float chan_shape_spread_subband,
float chan_shape_coherent_innovation_energy,
float chan_shape_excess_path,
float chan_shape_subband_kendall_lag_excess )
inline

Resolve one exported ML feature from precomputed series and tracker stats.

Parameters
idExported MLFeatureId value to resolve.
turbStatistics for the packet-level turbulence series.
aggregated_turbStatistics for the aggregated turbulence series.
l1_delta_lag_ratioPreprocessed tracker metric for ML_FEAT_L1_DELTA_LAG_RATIO. Deliberately without a default: the no-motion value of the ratio is 1.0, so a forgotten argument would read as a plausible measurement rather than as an error. The Python extractor raises for the same reason; here the compiler does it.
chan_shape_spread_subbandCurrent physical-time subband spread.
chan_shape_coherent_innovation_energyCurrent coherent innovation energy from the channel-shape trajectory tracker.
chan_shape_excess_pathCurrent channel-shape excess-path metric.
chan_shape_subband_kendall_lag_excessCurrent guarded Kendall lag-excess of the same eight-subband trajectory.
Returns
The requested feature value, or 0.0f for an unknown identifier.

Definition at line 318 of file csi_features.h.

◆ extract_ml_features_by_id()

void espectre::extract_ml_features_by_id ( const float * turb_buffer,
uint16_t turb_count,
const float * aggregated_turb_buffer,
uint16_t aggregated_turb_count,
const uint8_t * feature_ids,
uint8_t num_features,
float * features_out,
const MLSeriesScratch & series_scratch,
float l1_delta_lag_ratio,
float chan_shape_spread_subband,
float chan_shape_coherent_innovation_energy,
float chan_shape_excess_path,
float chan_shape_subband_kendall_lag_excess )
inline

Definition at line 342 of file csi_features.h.

◆ motion_participation()

float espectre::motion_participation ( const float * energy,
uint8_t count )
inline

Definition at line 54 of file ml_feature_trackers.h.

◆ is_valid_threshold()

bool espectre::is_valid_threshold ( float threshold,
float min_threshold,
float max_threshold )
inline

Validate threshold value against finite/range constraints.

Definition at line 42 of file threshold.h.

◆ clamp_threshold()

float espectre::clamp_threshold ( float threshold,
float min_threshold,
float max_threshold )
inline

Clamp threshold to [min, max] and recover non-finite values.

Definition at line 51 of file threshold.h.

Variable Documentation

◆ RUNTIME_TRAFFIC_GENERATOR_MODE_DNS_NAME

const char* const espectre::RUNTIME_TRAFFIC_GENERATOR_MODE_DNS_NAME = "dns"
constexpr

Definition at line 66 of file runtime_sensing_schema.h.

◆ RUNTIME_TRAFFIC_GENERATOR_MODE_PING_NAME

const char* const espectre::RUNTIME_TRAFFIC_GENERATOR_MODE_PING_NAME = "ping"
constexpr

Definition at line 67 of file runtime_sensing_schema.h.

◆ RUNTIME_TRAFFIC_GENERATOR_MODE_DEFAULT_NAME

const char* const espectre::RUNTIME_TRAFFIC_GENERATOR_MODE_DEFAULT_NAME = "ping"
constexpr

Definition at line 68 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TRAFFIC_MODE_INTERNAL_NAME

const char* const espectre::RUNTIME_CSI_TRAFFIC_MODE_INTERNAL_NAME = "internal"
constexpr

Definition at line 70 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TRAFFIC_MODE_EXTERNAL_NAME

const char* const espectre::RUNTIME_CSI_TRAFFIC_MODE_EXTERNAL_NAME = "external"
constexpr

Definition at line 71 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TRAFFIC_MODE_PACING_NAME

const char* const espectre::RUNTIME_CSI_TRAFFIC_MODE_PACING_NAME = "pacing"
constexpr

Definition at line 72 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TRAFFIC_MODE_DISABLED_NAME

const char* const espectre::RUNTIME_CSI_TRAFFIC_MODE_DISABLED_NAME = "disabled"
constexpr

Definition at line 73 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TRAFFIC_MODE_DEFAULT_NAME

const char* const espectre::RUNTIME_CSI_TRAFFIC_MODE_DEFAULT_NAME = "internal"
constexpr

Definition at line 74 of file runtime_sensing_schema.h.

◆ RUNTIME_DETECTION_ALGORITHM_LIGHTWEIGHT_NAME

const char* const espectre::RUNTIME_DETECTION_ALGORITHM_LIGHTWEIGHT_NAME = "lightweight"
constexpr

Definition at line 76 of file runtime_sensing_schema.h.

◆ RUNTIME_DETECTION_ALGORITHM_HIGH_ACCURACY_NAME

const char* const espectre::RUNTIME_DETECTION_ALGORITHM_HIGH_ACCURACY_NAME = "high_accuracy"
constexpr

Definition at line 77 of file runtime_sensing_schema.h.

◆ RUNTIME_DETECTION_ALGORITHM_DEFAULT_NAME

const char* const espectre::RUNTIME_DETECTION_ALGORITHM_DEFAULT_NAME = "lightweight"
constexpr

Definition at line 78 of file runtime_sensing_schema.h.

◆ RUNTIME_THRESHOLD_MIN

float espectre::RUNTIME_THRESHOLD_MIN = 0.0f
constexpr

Definition at line 80 of file runtime_sensing_schema.h.

◆ RUNTIME_THRESHOLD_MAX

float espectre::RUNTIME_THRESHOLD_MAX = 1.0f
constexpr

Definition at line 81 of file runtime_sensing_schema.h.

◆ RUNTIME_HIGH_ACCURACY_THRESHOLD_MAX

float espectre::RUNTIME_HIGH_ACCURACY_THRESHOLD_MAX = 1.0f
constexpr

Definition at line 82 of file runtime_sensing_schema.h.

◆ RUNTIME_SEGMENTATION_THRESHOLD_DEFAULT

float espectre::RUNTIME_SEGMENTATION_THRESHOLD_DEFAULT = LIGHTWEIGHT_DEFAULT_THRESHOLD
constexpr

Definition at line 83 of file runtime_sensing_schema.h.

◆ RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_MIN

uint32_t espectre::RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_MIN = 1000U
constexpr

Definition at line 85 of file runtime_sensing_schema.h.

◆ RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_MAX

uint32_t espectre::RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_MAX = 2000U
constexpr

Definition at line 86 of file runtime_sensing_schema.h.

◆ RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_DEFAULT

uint32_t espectre::RUNTIME_SEGMENTATION_WINDOW_SIZE_MS_DEFAULT = 1000U
constexpr

Definition at line 87 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TARGET_PPS_MIN

uint32_t espectre::RUNTIME_CSI_TARGET_PPS_MIN = 1U
constexpr

Definition at line 89 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TARGET_PPS_MAX

uint32_t espectre::RUNTIME_CSI_TARGET_PPS_MAX = 500U
constexpr

Definition at line 92 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TARGET_PPS_DEFAULT

uint32_t espectre::RUNTIME_CSI_TARGET_PPS_DEFAULT = 100U
constexpr

Definition at line 93 of file runtime_sensing_schema.h.

◆ RUNTIME_PUBLISH_INTERVAL_MS_MIN

uint32_t espectre::RUNTIME_PUBLISH_INTERVAL_MS_MIN = 100
constexpr

Definition at line 95 of file runtime_sensing_schema.h.

◆ RUNTIME_PUBLISH_INTERVAL_MS_MAX

uint32_t espectre::RUNTIME_PUBLISH_INTERVAL_MS_MAX = 60000
constexpr

Definition at line 96 of file runtime_sensing_schema.h.

◆ RUNTIME_PUBLISH_INTERVAL_MS_DEFAULT

uint32_t espectre::RUNTIME_PUBLISH_INTERVAL_MS_DEFAULT = 1000
constexpr

Definition at line 97 of file runtime_sensing_schema.h.

◆ RUNTIME_EVALUATION_INTERVAL_MS_MIN

uint32_t espectre::RUNTIME_EVALUATION_INTERVAL_MS_MIN = 10
constexpr

Definition at line 98 of file runtime_sensing_schema.h.

◆ RUNTIME_EVALUATION_INTERVAL_MS_MAX

uint32_t espectre::RUNTIME_EVALUATION_INTERVAL_MS_MAX = 10000
constexpr

Definition at line 99 of file runtime_sensing_schema.h.

◆ RUNTIME_EVALUATION_INTERVAL_MS_DEFAULT

uint32_t espectre::RUNTIME_EVALUATION_INTERVAL_MS_DEFAULT = 250
constexpr

Definition at line 100 of file runtime_sensing_schema.h.

◆ RUNTIME_MOTION_HITS_MIN

uint8_t espectre::RUNTIME_MOTION_HITS_MIN = 1
constexpr

Definition at line 102 of file runtime_sensing_schema.h.

◆ RUNTIME_MOTION_HITS_MAX

uint8_t espectre::RUNTIME_MOTION_HITS_MAX = 20
constexpr

Definition at line 103 of file runtime_sensing_schema.h.

◆ RUNTIME_MOTION_ON_HITS_DEFAULT

uint8_t espectre::RUNTIME_MOTION_ON_HITS_DEFAULT = 4
constexpr

Definition at line 104 of file runtime_sensing_schema.h.

◆ RUNTIME_MOTION_OFF_HITS_DEFAULT

uint8_t espectre::RUNTIME_MOTION_OFF_HITS_DEFAULT = 3
constexpr

Definition at line 105 of file runtime_sensing_schema.h.

◆ RUNTIME_LOWPASS_ENABLED_DEFAULT

bool espectre::RUNTIME_LOWPASS_ENABLED_DEFAULT = false
constexpr

Definition at line 107 of file runtime_sensing_schema.h.

◆ RUNTIME_LOWPASS_CUTOFF_MIN

float espectre::RUNTIME_LOWPASS_CUTOFF_MIN = 5.0f
constexpr

Definition at line 108 of file runtime_sensing_schema.h.

◆ RUNTIME_LOWPASS_CUTOFF_MAX

float espectre::RUNTIME_LOWPASS_CUTOFF_MAX = 20.0f
constexpr

Definition at line 109 of file runtime_sensing_schema.h.

◆ RUNTIME_LOWPASS_CUTOFF_DEFAULT

float espectre::RUNTIME_LOWPASS_CUTOFF_DEFAULT = 11.0f
constexpr

Definition at line 110 of file runtime_sensing_schema.h.

◆ RUNTIME_HAMPEL_ENABLED_DEFAULT

bool espectre::RUNTIME_HAMPEL_ENABLED_DEFAULT = true
constexpr

Definition at line 112 of file runtime_sensing_schema.h.

◆ RUNTIME_HAMPEL_WINDOW_MIN

uint8_t espectre::RUNTIME_HAMPEL_WINDOW_MIN = 3
constexpr

Definition at line 113 of file runtime_sensing_schema.h.

◆ RUNTIME_HAMPEL_WINDOW_MAX

uint8_t espectre::RUNTIME_HAMPEL_WINDOW_MAX = 11
constexpr

Definition at line 114 of file runtime_sensing_schema.h.

◆ RUNTIME_HAMPEL_WINDOW_DEFAULT

uint8_t espectre::RUNTIME_HAMPEL_WINDOW_DEFAULT = 7
constexpr

Definition at line 115 of file runtime_sensing_schema.h.

◆ RUNTIME_HAMPEL_THRESHOLD_MIN

float espectre::RUNTIME_HAMPEL_THRESHOLD_MIN = 1.0f
constexpr

Definition at line 116 of file runtime_sensing_schema.h.

◆ RUNTIME_HAMPEL_THRESHOLD_MAX

float espectre::RUNTIME_HAMPEL_THRESHOLD_MAX = 10.0f
constexpr

Definition at line 117 of file runtime_sensing_schema.h.

◆ RUNTIME_HAMPEL_THRESHOLD_DEFAULT

float espectre::RUNTIME_HAMPEL_THRESHOLD_DEFAULT = 5.0f
constexpr

Definition at line 118 of file runtime_sensing_schema.h.

◆ RUNTIME_STREAM_COLLECTOR_PORT_DEFAULT

uint16_t espectre::RUNTIME_STREAM_COLLECTOR_PORT_DEFAULT = 5001
constexpr

Definition at line 120 of file runtime_sensing_schema.h.

◆ RUNTIME_NETWORK_PORT_MIN

uint16_t espectre::RUNTIME_NETWORK_PORT_MIN = 1U
constexpr

Definition at line 121 of file runtime_sensing_schema.h.

◆ RUNTIME_NETWORK_PORT_MAX

uint16_t espectre::RUNTIME_NETWORK_PORT_MAX = UINT16_MAX
constexpr

Definition at line 122 of file runtime_sensing_schema.h.

◆ RUNTIME_STREAM_LOG_INTERVAL_MS_MIN

uint32_t espectre::RUNTIME_STREAM_LOG_INTERVAL_MS_MIN = 100U
constexpr

Definition at line 123 of file runtime_sensing_schema.h.

◆ RUNTIME_STREAM_LOG_INTERVAL_MS_MAX

uint32_t espectre::RUNTIME_STREAM_LOG_INTERVAL_MS_MAX = 60000U
constexpr

Definition at line 124 of file runtime_sensing_schema.h.

◆ RUNTIME_STREAM_LOG_INTERVAL_MS_DEFAULT

uint32_t espectre::RUNTIME_STREAM_LOG_INTERVAL_MS_DEFAULT = 1000
constexpr

Definition at line 125 of file runtime_sensing_schema.h.

◆ RUNTIME_STREAM_TX_BATCH_RECORDS_MIN

uint8_t espectre::RUNTIME_STREAM_TX_BATCH_RECORDS_MIN = 1U
constexpr

Definition at line 126 of file runtime_sensing_schema.h.

◆ RUNTIME_STREAM_TX_BATCH_RECORDS_MAX

uint8_t espectre::RUNTIME_STREAM_TX_BATCH_RECORDS_MAX = 7U
constexpr

Definition at line 127 of file runtime_sensing_schema.h.

◆ RUNTIME_STREAM_TX_BATCH_RECORDS_DEFAULT

uint8_t espectre::RUNTIME_STREAM_TX_BATCH_RECORDS_DEFAULT = 4
constexpr

Definition at line 128 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TRAFFIC_UDP_PORT_DEFAULT

uint16_t espectre::RUNTIME_CSI_TRAFFIC_UDP_PORT_DEFAULT = 5555
constexpr

Definition at line 130 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TRAFFIC_MULTICAST_GROUP_DEFAULT

const char* const espectre::RUNTIME_CSI_TRAFFIC_MULTICAST_GROUP_DEFAULT = "239.255.0.1"
constexpr

Definition at line 131 of file runtime_sensing_schema.h.

◆ RUNTIME_CSI_TRAFFIC_EXPECTED_PAYLOAD_MAX

size_t espectre::RUNTIME_CSI_TRAFFIC_EXPECTED_PAYLOAD_MAX = 16U
constexpr

Definition at line 132 of file runtime_sensing_schema.h.

◆ ESPECTRE_PROTOCOL_VERSION

const char* espectre::ESPECTRE_PROTOCOL_VERSION = "1.0"
inlineconstexpr

Protocol version reported in payloads.

Bumped on a wire-format change.

Definition at line 44 of file espectre_protocol.h.

◆ ESPECTRE_TOPIC_PREFIX

const char* espectre::ESPECTRE_TOPIC_PREFIX = "espectre/v1/devices"
inlineconstexpr

Default MQTT topic root.

Override per device with EspectreDeviceConfig::topic_prefix.

Definition at line 46 of file espectre_protocol.h.

◆ ESPECTRE_OTA_CHANNEL_RELEASE

const char* espectre::ESPECTRE_OTA_CHANNEL_RELEASE = "release"
inlineconstexpr

Official tagged GitHub Release OTA channel.

Definition at line 48 of file espectre_protocol.h.

◆ ESPECTRE_OTA_CHANNEL_PREVIEW

const char* espectre::ESPECTRE_OTA_CHANNEL_PREVIEW = "preview"
inlineconstexpr

Rolling main OTA channel.

Fetches GitHub Releases tag snapshot.

Definition at line 50 of file espectre_protocol.h.

◆ ESPECTRE_OTA_CHANNEL_DEVELOP

const char* espectre::ESPECTRE_OTA_CHANNEL_DEVELOP = "develop"
inlineconstexpr

Rolling develop OTA channel.

Fetches GitHub Releases tag snapshot-dev.

Definition at line 52 of file espectre_protocol.h.

◆ ESPECTRE_OTA_RELEASE_TAG_PREVIEW

const char* espectre::ESPECTRE_OTA_RELEASE_TAG_PREVIEW = "snapshot"
inlineconstexpr

GitHub Releases tag for the preview OTA channel.

Distinct from branch main.

Definition at line 54 of file espectre_protocol.h.

◆ ESPECTRE_OTA_RELEASE_TAG_DEVELOP

const char* espectre::ESPECTRE_OTA_RELEASE_TAG_DEVELOP = "snapshot-dev"
inlineconstexpr

GitHub Releases tag for the develop OTA channel.

Distinct from branch develop.

Definition at line 56 of file espectre_protocol.h.

◆ ESPECTRE_DEFAULT_DEVICE_ID

uint64_t espectre::ESPECTRE_DEFAULT_DEVICE_ID = 0U
inlineconstexpr

Sentinel meaning "use the runtime-generated device id".

Definition at line 58 of file espectre_protocol.h.

◆ ESPECTRE_DEFAULT_DEVICE_LABEL

const char* espectre::ESPECTRE_DEFAULT_DEVICE_LABEL = ""
inlineconstexpr

Empty label, meaning the device id is used as the display name.

Definition at line 60 of file espectre_protocol.h.

◆ ESPECTRE_DIRECT_WEBSOCKET_ENDPOINT

const char* espectre::ESPECTRE_DIRECT_WEBSOCKET_ENDPOINT = "/espectre/v1/ws"
inlineconstexpr

Definition at line 20 of file direct_websocket_protocol.h.

◆ ESPECTRE_DIRECT_WEBSOCKET_SUBPROTOCOL

const char* espectre::ESPECTRE_DIRECT_WEBSOCKET_SUBPROTOCOL = "espectre.v1"
inlineconstexpr

Definition at line 21 of file direct_websocket_protocol.h.

◆ ESPECTRE_DIRECT_ENVELOPE_VERSION

unsigned espectre::ESPECTRE_DIRECT_ENVELOPE_VERSION = 1U
inlineconstexpr

Definition at line 22 of file direct_websocket_protocol.h.

◆ ESPECTRE_DIRECT_MAX_FRAME_SIZE

size_t espectre::ESPECTRE_DIRECT_MAX_FRAME_SIZE = 4096U
inlineconstexpr

Definition at line 23 of file direct_websocket_protocol.h.

◆ ESPECTRE_DIRECT_MAX_REQUEST_ID_SIZE

size_t espectre::ESPECTRE_DIRECT_MAX_REQUEST_ID_SIZE = 64U
inlineconstexpr

Definition at line 24 of file direct_websocket_protocol.h.

◆ ESPECTRE_DIRECT_MAX_METHOD_SIZE

size_t espectre::ESPECTRE_DIRECT_MAX_METHOD_SIZE = 64U
inlineconstexpr

Definition at line 25 of file direct_websocket_protocol.h.

◆ LIGHTWEIGHT_DEFAULT_THRESHOLD

float espectre::LIGHTWEIGHT_DEFAULT_THRESHOLD = 0.6621854538596202f
constexpr

Definition at line 21 of file detector_types.h.

◆ LIGHTWEIGHT_MIN_THRESHOLD

float espectre::LIGHTWEIGHT_MIN_THRESHOLD = 0.0f
constexpr

Definition at line 22 of file detector_types.h.

◆ LIGHTWEIGHT_MAX_THRESHOLD

float espectre::LIGHTWEIGHT_MAX_THRESHOLD = 1.0f
constexpr

Definition at line 23 of file detector_types.h.

◆ LIGHTWEIGHT_STARTUP_THRESHOLD_FACTOR

float espectre::LIGHTWEIGHT_STARTUP_THRESHOLD_FACTOR = 1.0f
constexpr

Definition at line 24 of file detector_types.h.

◆ HIGH_ACCURACY_DEFAULT_THRESHOLD

float espectre::HIGH_ACCURACY_DEFAULT_THRESHOLD = 0.5f
constexpr

Definition at line 26 of file detector_types.h.

◆ HIGH_ACCURACY_MIN_THRESHOLD

float espectre::HIGH_ACCURACY_MIN_THRESHOLD = 0.0f
constexpr

Definition at line 27 of file detector_types.h.

◆ HIGH_ACCURACY_MAX_THRESHOLD

float espectre::HIGH_ACCURACY_MAX_THRESHOLD = 1.0f
constexpr

Definition at line 28 of file detector_types.h.

◆ HIGH_ACCURACY_METRIC_SCALE

float espectre::HIGH_ACCURACY_METRIC_SCALE = 1.0f
constexpr

Definition at line 29 of file detector_types.h.

◆ LOWPASS_CUTOFF_DEFAULT

float espectre::LOWPASS_CUTOFF_DEFAULT = 11.0f
constexpr

Definition at line 16 of file filter_config.h.

◆ LOWPASS_CUTOFF_MIN

float espectre::LOWPASS_CUTOFF_MIN = 5.0f
constexpr

Definition at line 17 of file filter_config.h.

◆ LOWPASS_CUTOFF_MAX

float espectre::LOWPASS_CUTOFF_MAX = 20.0f
constexpr

Definition at line 18 of file filter_config.h.

◆ LOWPASS_SAMPLE_RATE

float espectre::LOWPASS_SAMPLE_RATE = 100.0f
constexpr

Definition at line 19 of file filter_config.h.

◆ HAMPEL_TURBULENCE_WINDOW_MIN

uint8_t espectre::HAMPEL_TURBULENCE_WINDOW_MIN = 3U
constexpr

Definition at line 21 of file filter_config.h.

◆ HAMPEL_TURBULENCE_WINDOW_MAX

uint8_t espectre::HAMPEL_TURBULENCE_WINDOW_MAX = 11U
constexpr

Definition at line 22 of file filter_config.h.

◆ HAMPEL_TURBULENCE_WINDOW_DEFAULT

uint8_t espectre::HAMPEL_TURBULENCE_WINDOW_DEFAULT = 7U
constexpr

Definition at line 23 of file filter_config.h.

◆ HAMPEL_TURBULENCE_THRESHOLD_DEFAULT

float espectre::HAMPEL_TURBULENCE_THRESHOLD_DEFAULT = 5.0f
constexpr

Definition at line 24 of file filter_config.h.

◆ HT20_NUM_SUBCARRIERS

uint16_t espectre::HT20_NUM_SUBCARRIERS = 64U
constexpr

Definition at line 18 of file csi_types.h.

◆ HT20_CSI_LEN

uint16_t espectre::HT20_CSI_LEN = 128U
constexpr

Definition at line 19 of file csi_types.h.

◆ HT20_CSI_LEN_DOUBLE

uint16_t espectre::HT20_CSI_LEN_DOUBLE = 256U
constexpr

Definition at line 20 of file csi_types.h.

◆ HT20_CSI_LEN_SHORT

uint16_t espectre::HT20_CSI_LEN_SHORT = 114U
constexpr

Definition at line 21 of file csi_types.h.

◆ HT20_CSI_LEN_SHORT_DOUBLE

uint16_t espectre::HT20_CSI_LEN_SHORT_DOUBLE = 228U
constexpr

Definition at line 22 of file csi_types.h.

◆ HT20_CSI_LEN_SHORT_LEFT_PAD

uint8_t espectre::HT20_CSI_LEN_SHORT_LEFT_PAD = 8U
constexpr

Definition at line 23 of file csi_types.h.

◆ HT20_GUARD_BAND_LOW

uint8_t espectre::HT20_GUARD_BAND_LOW = 4U
constexpr

Definition at line 24 of file csi_types.h.

◆ HT20_GUARD_BAND_HIGH

uint8_t espectre::HT20_GUARD_BAND_HIGH = 60U
constexpr

Definition at line 25 of file csi_types.h.

◆ HT20_DC_SUBCARRIER

uint8_t espectre::HT20_DC_SUBCARRIER = 32U
constexpr

Definition at line 26 of file csi_types.h.

◆ HT20_SELECTED_BAND_SIZE

uint8_t espectre::HT20_SELECTED_BAND_SIZE = 12U
constexpr

Definition at line 27 of file csi_types.h.

◆ DEFAULT_SUBCARRIERS

uint8_t espectre::DEFAULT_SUBCARRIERS[HT20_SELECTED_BAND_SIZE]
constexpr
Initial value:
= {
4U, 8U, 13U, 18U, 23U, 28U, 36U, 41U, 46U, 51U, 56U, 60U,
}

Definition at line 29 of file csi_types.h.

◆ LIGHTWEIGHT_AUTOCORR_CENTER

float espectre::LIGHTWEIGHT_AUTOCORR_CENTER = 0.3919344866784947f
constexpr

Definition at line 25 of file lightweight_detector.h.

◆ LIGHTWEIGHT_AUTOCORR_SCALE

float espectre::LIGHTWEIGHT_AUTOCORR_SCALE = 0.3798648330757351f
constexpr

Definition at line 26 of file lightweight_detector.h.

◆ LIGHTWEIGHT_AUTOCORR_WEIGHT

float espectre::LIGHTWEIGHT_AUTOCORR_WEIGHT = 5.083034533668216f
constexpr

Definition at line 27 of file lightweight_detector.h.

◆ LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_CENTER

float espectre::LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_CENTER = 0.24612139211074338f
constexpr

Definition at line 28 of file lightweight_detector.h.

◆ LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_SCALE

float espectre::LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_SCALE = 0.20056599613462603f
constexpr

Definition at line 29 of file lightweight_detector.h.

◆ LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_WEIGHT

float espectre::LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_WEIGHT = 4.997501915217463f
constexpr

Definition at line 30 of file lightweight_detector.h.

◆ LIGHTWEIGHT_INTERCEPT

float espectre::LIGHTWEIGHT_INTERCEPT = 1.0776769868761f
constexpr

Definition at line 31 of file lightweight_detector.h.

◆ LIGHTWEIGHT_TRAIN_IDLE_Q95_LOGIT

float espectre::LIGHTWEIGHT_TRAIN_IDLE_Q95_LOGIT = -2.253902812716911f
constexpr

Definition at line 33 of file lightweight_detector.h.

◆ LIGHTWEIGHT_STARTUP_QUANTILE

float espectre::LIGHTWEIGHT_STARTUP_QUANTILE = 0.95f
constexpr

Definition at line 34 of file lightweight_detector.h.

◆ LIGHTWEIGHT_STARTUP_STRENGTH

float espectre::LIGHTWEIGHT_STARTUP_STRENGTH = 0.5f
constexpr

Definition at line 35 of file lightweight_detector.h.

◆ LIGHTWEIGHT_STARTUP_SAMPLE_LIMIT

uint8_t espectre::LIGHTWEIGHT_STARTUP_SAMPLE_LIMIT = 64U
constexpr

Definition at line 36 of file lightweight_detector.h.

◆ LIGHTWEIGHT_SETTLE_BLOCKS

uint8_t espectre::LIGHTWEIGHT_SETTLE_BLOCKS = 12U
constexpr

Definition at line 44 of file lightweight_detector.h.

◆ LIGHTWEIGHT_SETTLE_BLOCK_EVALUATIONS

uint8_t espectre::LIGHTWEIGHT_SETTLE_BLOCK_EVALUATIONS = 20U
constexpr

Definition at line 45 of file lightweight_detector.h.

◆ LIGHTWEIGHT_SETTLE_MARGIN_LOGITS

float espectre::LIGHTWEIGHT_SETTLE_MARGIN_LOGITS = 2.7f
constexpr

Definition at line 46 of file lightweight_detector.h.

◆ HT20_CLASSIC_ONLY_NULL_BINS

uint8_t espectre::HT20_CLASSIC_ONLY_NULL_BINS[] = {29, 30, 31, 33, 34, 35}
constexpr

Definition at line 45 of file csi_format.h.

◆ HT20_CENTERED_ONLY_NULL_BINS

uint8_t espectre::HT20_CENTERED_ONLY_NULL_BINS[] = {1, 2, 3, 61, 62, 63}
constexpr

Definition at line 46 of file csi_format.h.

◆ DETECTOR_WINDOW_SIZE_MS_MIN

uint32_t espectre::DETECTOR_WINDOW_SIZE_MS_MIN = 1000U
constexpr

Definition at line 18 of file detector_limits.h.

◆ DETECTOR_WINDOW_SIZE_MS_MAX

uint32_t espectre::DETECTOR_WINDOW_SIZE_MS_MAX = 2000U
constexpr

Definition at line 19 of file detector_limits.h.

◆ DETECTOR_WINDOW_SIZE_MS_DEFAULT

uint32_t espectre::DETECTOR_WINDOW_SIZE_MS_DEFAULT = 1000U
constexpr

Definition at line 20 of file detector_limits.h.

◆ DETECTOR_DEFAULT_WINDOW_SIZE

uint16_t espectre::DETECTOR_DEFAULT_WINDOW_SIZE = 100
constexpr

Definition at line 21 of file detector_limits.h.

◆ DETECTOR_MIN_WINDOW_SIZE

uint16_t espectre::DETECTOR_MIN_WINDOW_SIZE = 1
constexpr

Definition at line 24 of file detector_limits.h.

◆ DETECTOR_MAX_WINDOW_SIZE

uint16_t espectre::DETECTOR_MAX_WINDOW_SIZE = 1000
constexpr

Definition at line 28 of file detector_limits.h.

◆ CALIBRATION_NUM_WINDOWS

uint16_t espectre::CALIBRATION_NUM_WINDOWS = 10
constexpr

Definition at line 30 of file detector_limits.h.

◆ CALIBRATION_DEFAULT_BUFFER_SIZE

uint16_t espectre::CALIBRATION_DEFAULT_BUFFER_SIZE
constexpr
Initial value:
=
constexpr uint16_t DETECTOR_DEFAULT_WINDOW_SIZE
constexpr uint16_t CALIBRATION_NUM_WINDOWS

Definition at line 31 of file detector_limits.h.

◆ EVALUATION_INTERVAL_US

uint32_t espectre::EVALUATION_INTERVAL_US = 250000U
constexpr

Definition at line 38 of file detector_limits.h.

◆ L1_DELTA_LAG_US

uint32_t espectre::L1_DELTA_LAG_US = 100000U
constexpr

Definition at line 39 of file detector_limits.h.

◆ TURB_AUTOCORR_LAG_US

uint32_t espectre::TURB_AUTOCORR_LAG_US = 10000U
constexpr

Definition at line 40 of file detector_limits.h.

◆ DETECTOR_L1_DELTA_LAG_DEFAULT

uint16_t espectre::DETECTOR_L1_DELTA_LAG_DEFAULT = 10U
constexpr

Definition at line 41 of file detector_limits.h.

◆ DETECTOR_AUTOCORR_LAG_DEFAULT

uint16_t espectre::DETECTOR_AUTOCORR_LAG_DEFAULT = 1U
constexpr

Definition at line 42 of file detector_limits.h.

◆ L1_DELTA_LAG_MAX

uint16_t espectre::L1_DELTA_LAG_MAX = 32
constexpr

Definition at line 53 of file detector_limits.h.

◆ MIN_PLAUSIBLE_PACKET_INTERVAL_US

uint32_t espectre::MIN_PLAUSIBLE_PACKET_INTERVAL_US = 200U
constexpr

Definition at line 59 of file detector_limits.h.

◆ MAD_SCALE_FACTOR

float espectre::MAD_SCALE_FACTOR = 1.4826f
constexpr

Definition at line 41 of file filters.h.

◆ L1_DELTA_LAG

uint8_t espectre::L1_DELTA_LAG = 10
constexpr

Definition at line 25 of file csi_features.h.

◆ L1_DELTA_STARTUP_THRESHOLD_FACTOR

float espectre::L1_DELTA_STARTUP_THRESHOLD_FACTOR = 1.1f
constexpr

Definition at line 26 of file csi_features.h.

◆ TURB_IQR_AGGREGATION_WIDTH

uint8_t espectre::TURB_IQR_AGGREGATION_WIDTH = 5U
constexpr

Definition at line 27 of file csi_features.h.

◆ HT20_LIVE_BAND_SIZE

uint8_t espectre::HT20_LIVE_BAND_SIZE = 56U
constexpr

Definition at line 24 of file ml_feature_trackers.h.

◆ HT20_LIVE_BINS

std::array<uint8_t, HT20_LIVE_BAND_SIZE> espectre::HT20_LIVE_BINS
constexpr
Initial value:
= {
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
}

Definition at line 25 of file ml_feature_trackers.h.

◆ CHANNEL_SHAPE_SUBBAND_COUNT

uint8_t espectre::CHANNEL_SHAPE_SUBBAND_COUNT = 8U
constexpr

Definition at line 30 of file ml_feature_trackers.h.

◆ CHANNEL_SHAPE_SUBBAND_SIZE

uint8_t espectre::CHANNEL_SHAPE_SUBBAND_SIZE
constexpr
Initial value:
=
constexpr uint8_t HT20_LIVE_BAND_SIZE
constexpr uint8_t CHANNEL_SHAPE_SUBBAND_COUNT

Definition at line 31 of file ml_feature_trackers.h.

◆ CHANNEL_SHAPE_BIN_US

uint32_t espectre::CHANNEL_SHAPE_BIN_US = 80000U
constexpr

Definition at line 33 of file ml_feature_trackers.h.

◆ CHANNEL_SHAPE_WINDOW_US

uint32_t espectre::CHANNEL_SHAPE_WINDOW_US = 1000000U
constexpr

Definition at line 34 of file ml_feature_trackers.h.

◆ CHANNEL_SHAPE_WINDOW_BINS

uint8_t espectre::CHANNEL_SHAPE_WINDOW_BINS
constexpr
Initial value:
=
static_cast<uint8_t>((CHANNEL_SHAPE_WINDOW_US + CHANNEL_SHAPE_BIN_US - 1U) /
constexpr uint32_t CHANNEL_SHAPE_WINDOW_US
constexpr uint32_t CHANNEL_SHAPE_BIN_US

Definition at line 35 of file ml_feature_trackers.h.

◆ CHANNEL_SHAPE_MAX_PROFILES_PER_BIN

uint8_t espectre::CHANNEL_SHAPE_MAX_PROFILES_PER_BIN = L1_DELTA_LAG_MAX
constexpr

Definition at line 38 of file ml_feature_trackers.h.

◆ CHANNEL_SHAPE_KENDALL_RELATIVE_DEADBAND

float espectre::CHANNEL_SHAPE_KENDALL_RELATIVE_DEADBAND = 0.02f
constexpr

Definition at line 39 of file ml_feature_trackers.h.

◆ CHANNEL_SHAPE_KENDALL_MIN_COMPARABLE_PAIRS

uint8_t espectre::CHANNEL_SHAPE_KENDALL_MIN_COMPARABLE_PAIRS = 8U
constexpr

Definition at line 40 of file ml_feature_trackers.h.

◆ CHANNEL_SHAPE_DCT

std::array<std::array<float, CHANNEL_SHAPE_SUBBAND_COUNT>, CHANNEL_SHAPE_SUBBAND_COUNT> espectre::CHANNEL_SHAPE_DCT
constexpr
Initial value:
= {{
{{0.3535533906f, 0.4903926402f, 0.4619397663f, 0.4157348062f, 0.3535533906f, 0.2777851165f, 0.1913417162f, 0.0975451610f}},
{{0.3535533906f, 0.4157348062f, 0.1913417162f, -0.0975451610f, -0.3535533906f, -0.4903926402f, -0.4619397663f, -0.2777851165f}},
{{0.3535533906f, 0.2777851165f, -0.1913417162f, -0.4903926402f, -0.3535533906f, 0.0975451610f, 0.4619397663f, 0.4157348062f}},
{{0.3535533906f, 0.0975451610f, -0.4619397663f, -0.2777851165f, 0.3535533906f, 0.4157348062f, -0.1913417162f, -0.4903926402f}},
{{0.3535533906f, -0.0975451610f, -0.4619397663f, 0.2777851165f, 0.3535533906f, -0.4157348062f, -0.1913417162f, 0.4903926402f}},
{{0.3535533906f, -0.2777851165f, -0.1913417162f, 0.4903926402f, -0.3535533906f, -0.0975451610f, 0.4619397663f, -0.4157348062f}},
{{0.3535533906f, -0.4157348062f, 0.1913417162f, 0.0975451610f, -0.3535533906f, 0.4903926402f, -0.4619397663f, 0.2777851165f}},
{{0.3535533906f, -0.4903926402f, 0.4619397663f, -0.4157348062f, 0.3535533906f, -0.2777851165f, 0.1913417162f, -0.0975451610f}},
}}

Definition at line 43 of file ml_feature_trackers.h.

◆ SEGMENTATION_DEFAULT_THRESHOLD

float espectre::SEGMENTATION_DEFAULT_THRESHOLD = 1.0f
constexpr

Definition at line 34 of file threshold.h.

◆ SEGMENTATION_MIN_THRESHOLD

float espectre::SEGMENTATION_MIN_THRESHOLD = 1e-9f
constexpr

Definition at line 36 of file threshold.h.

◆ SEGMENTATION_MAX_THRESHOLD

float espectre::SEGMENTATION_MAX_THRESHOLD = 10.0f
constexpr

Definition at line 37 of file threshold.h.

◆ DEFAULT_ADAPTIVE_FACTOR

float espectre::DEFAULT_ADAPTIVE_FACTOR = 1.3f
constexpr

Definition at line 65 of file threshold.h.

◆ STARTUP_GATE_CHUNKS

uint8_t espectre::STARTUP_GATE_CHUNKS = 6
constexpr

Definition at line 69 of file threshold.h.

◆ STARTUP_GATE_SPREAD_RATIO

float espectre::STARTUP_GATE_SPREAD_RATIO = 1.10f
constexpr

Definition at line 70 of file threshold.h.

◆ STARTUP_GATE_ANCHOR_RATIO

float espectre::STARTUP_GATE_ANCHOR_RATIO = 1.5f
constexpr

Definition at line 71 of file threshold.h.

◆ STARTUP_MOTION_CHUNK_SIZE

uint8_t espectre::STARTUP_MOTION_CHUNK_SIZE = 25
constexpr

Definition at line 72 of file threshold.h.

◆ STARTUP_MOTION_MIN_QUIET_CHUNKS

uint8_t espectre::STARTUP_MOTION_MIN_QUIET_CHUNKS = 2
constexpr

Definition at line 73 of file threshold.h.

◆ STARTUP_MOTION_CONFIRM_CHUNKS

uint8_t espectre::STARTUP_MOTION_CONFIRM_CHUNKS = 2
constexpr

Definition at line 74 of file threshold.h.

◆ STARTUP_POST_MOTION_QUIET_CHUNKS

uint8_t espectre::STARTUP_POST_MOTION_QUIET_CHUNKS = 2
constexpr

Definition at line 75 of file threshold.h.

◆ STARTUP_QUIET_STABILITY_RATIO

float espectre::STARTUP_QUIET_STABILITY_RATIO = 1.20f
constexpr

Definition at line 76 of file threshold.h.

◆ STARTUP_MOTION_TRIGGER_RATIO

float espectre::STARTUP_MOTION_TRIGGER_RATIO = 1.80f
constexpr

Definition at line 77 of file threshold.h.

◆ STARTUP_QUIET_RETURN_RATIO

float espectre::STARTUP_QUIET_RETURN_RATIO = 1.25f
constexpr

Definition at line 78 of file threshold.h.

◆ STARTUP_MOTION_GAP_RATIO

float espectre::STARTUP_MOTION_GAP_RATIO = 1.35f
constexpr

Definition at line 79 of file threshold.h.

◆ STARTUP_NO_MOTION_FALLBACK_MARGIN

float espectre::STARTUP_NO_MOTION_FALLBACK_MARGIN = 1.03f
constexpr

Definition at line 80 of file threshold.h.

◆ STARTUP_MOTION_MAX_LEVELS

uint8_t espectre::STARTUP_MOTION_MAX_LEVELS = 40
constexpr

Definition at line 81 of file threshold.h.