96 uint16_t autocorr_lag = 1U);
105 const uint8_t* selected_subcarriers =
nullptr,
106 uint8_t num_subcarriers = 0,
107 int8_t rssi_dbm = INT8_MIN)
override;
121 const char*
get_name()
const override {
return "Lightweight"; }
134 float calculate_turb_autocorr_()
const;
135 float calculate_turb_iqr_over_mean_aggr_()
const;
136 float calculate_logit_(
float turb_autocorr,
float turb_iqr_over_mean_aggr)
const;
137 void add_aggregated_turbulence_(
float turbulence);
138 static float sigmoid_(
float value);
139 static float quantile_(
const float* values, uint8_t count,
float quantile);
140 float startup_quantile_()
const;
141 void observe_settled_level_();
142 void reset_settled_level_();
143 void clear_fusion_inputs_();
146 float current_logit_;
147 float current_turb_autocorr_;
148 float current_turb_iqr_over_mean_aggr_;
150 uint8_t startup_logit_count_;
151 float adapted_threshold_;
152 bool adapted_threshold_ready_;
153 uint16_t autocorr_lag_;
155 float settle_block_max_;
156 uint8_t settle_block_evaluations_;
157 uint8_t settle_block_count_;
158 uint8_t settle_block_index_;
159 std::vector<float> aggregated_turbulence_buffer_;
160 FilteredTurbulenceRing aggregated_turbulence_;
BaseDetector(uint16_t window_size=DETECTOR_DEFAULT_WINDOW_SIZE)
Constructor.
bool set_threshold(float threshold) override
Set detection threshold.
bool startup_gate_enabled() const override
Whether startup calibration uses the consistency gate (threshold.h).
LightweightDetector(uint16_t window_size=DETECTOR_DEFAULT_WINDOW_SIZE, float threshold=LIGHTWEIGHT_DEFAULT_THRESHOLD, uint16_t autocorr_lag=1U)
void update_state() override
Update state machine (call at publish interval).
~LightweightDetector() override=default
void on_startup_calibration_complete() override
Hook called when startup calibration completes successfully.
void configure_lowpass(bool enabled, float cutoff_hz=LOWPASS_CUTOFF_DEFAULT) override
Configure low-pass filter.
LightweightDetector(LightweightDetector &&other) noexcept=default
void configure_hampel(bool enabled, uint8_t window_size=HAMPEL_TURBULENCE_WINDOW_DEFAULT, float threshold=HAMPEL_TURBULENCE_THRESHOLD_DEFAULT) override
Configure Hampel filter.
void on_startup_calibration_begin() override
Hook called immediately before startup calibration begins.
float get_threshold() const override
Get current threshold.
float get_turb_iqr_over_mean_aggr() const
float get_startup_threshold_factor() const override
Get the detector-specific automatic startup multiplier.
float get_turb_autocorr() const
LightweightDetector(const LightweightDetector &)=delete
const char * get_name() const override
Get detector name for logging.
void advance_missing_slots(uint32_t count) override
Advance packet-indexed feature rings for absent temporal slots.
void reset() override
Reset detector state.
bool set_adaptive_threshold(float threshold) override
Apply a detector-specific startup-calibrated threshold.
LightweightDetector & operator=(LightweightDetector &&other) noexcept=default
void process_packet(const int8_t *csi_data, size_t csi_len, const uint8_t *selected_subcarriers=nullptr, uint8_t num_subcarriers=0, int8_t rssi_dbm=INT8_MIN) override
Process a CSI packet and update internal state.
LightweightDetector & operator=(const LightweightDetector &)=delete
void clear_buffer() override
Clear turbulence buffer (cold restart).
bool is_ready() const override
Check if detector is ready (buffer filled).
constexpr uint8_t LIGHTWEIGHT_SETTLE_BLOCKS
constexpr float LIGHTWEIGHT_DEFAULT_THRESHOLD
constexpr float LIGHTWEIGHT_INTERCEPT
constexpr float LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_SCALE
constexpr uint16_t DETECTOR_DEFAULT_WINDOW_SIZE
constexpr uint8_t LIGHTWEIGHT_STARTUP_SAMPLE_LIMIT
constexpr float LIGHTWEIGHT_STARTUP_STRENGTH
constexpr float LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_WEIGHT
constexpr float LIGHTWEIGHT_SETTLE_MARGIN_LOGITS
constexpr float LIGHTWEIGHT_AUTOCORR_WEIGHT
constexpr uint8_t HAMPEL_TURBULENCE_WINDOW_DEFAULT
constexpr float LIGHTWEIGHT_STARTUP_THRESHOLD_FACTOR
constexpr float LIGHTWEIGHT_STARTUP_QUANTILE
constexpr float HAMPEL_TURBULENCE_THRESHOLD_DEFAULT
constexpr float LIGHTWEIGHT_TURB_IQR_OVER_MEAN_AGGR_CENTER
constexpr uint8_t LIGHTWEIGHT_SETTLE_BLOCK_EVALUATIONS
constexpr float LIGHTWEIGHT_TRAIN_IDLE_Q95_LOGIT
constexpr float LOWPASS_CUTOFF_DEFAULT
constexpr float LIGHTWEIGHT_AUTOCORR_SCALE
constexpr float LIGHTWEIGHT_AUTOCORR_CENTER