77 const uint8_t* selected_subcarriers =
nullptr,
78 uint8_t num_subcarriers = 0,
79 int8_t rssi_dbm = INT8_MIN);
uint16_t get_buffer_count() const
Get number of valid samples in buffer.
virtual 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)
Process a CSI packet and update internal state.
static float * alloc_zeroed_floats(uint16_t count)
Allocate a zeroed float buffer on the heap.
virtual void on_startup_calibration_begin()
Hook called immediately before startup calibration begins.
BaseDetector & operator=(const BaseDetector &)=delete
BaseDetector(const BaseDetector &)=delete
virtual void update_state()=0
Update state machine (call at publish interval).
const float * ordered_turbulence(uint16_t &count) const
View the turbulence ring in chronological order.
virtual uint32_t get_total_packets() const
Get total packets processed.
BaseDetector & operator=(BaseDetector &&other) noexcept
BaseDetector(BaseDetector &&other) noexcept
virtual void advance_missing_slots(uint32_t count)
Advance packet-indexed feature rings for absent temporal slots.
virtual void configure_lowpass(bool enabled, float cutoff_hz=LOWPASS_CUTOFF_DEFAULT)
Configure low-pass filter.
uint16_t minimum_valid_samples_
virtual bool set_adaptive_threshold(float threshold)
Apply a detector-specific startup-calibrated threshold.
float * turbulence_buffer_
uint64_t packet_timestamp_us_
uint16_t get_window_size() const
Get configured window size.
virtual void clear_buffer()
Clear turbulence buffer (cold restart).
float * ordered_turbulence_
lowpass_filter_state_t lowpass_state_
uint16_t get_valid_buffer_count() const
virtual MotionState get_state() const
Get current motion state.
uint64_t packet_timestamp_us_or(uint64_t fallback) const
virtual bool is_ready() const
Check if detector is ready (buffer filled).
void add_turbulence_to_buffer(float turbulence)
Add turbulence value to buffer (with filtering).
virtual bool set_threshold(float threshold)=0
Set detection threshold.
void set_minimum_valid_samples(uint16_t count)
Set the valid-slot occupancy floor used by is_ready().
virtual void configure_hampel(bool enabled, uint8_t window_size=HAMPEL_TURBULENCE_WINDOW_DEFAULT, float threshold=HAMPEL_TURBULENCE_THRESHOLD_DEFAULT)
Configure Hampel filter.
bool is_lowpass_enabled() const
Check if low-pass filter is enabled.
const float * get_turbulence_buffer() const
Get turbulence buffer pointer.
virtual float get_threshold() const =0
Get current threshold.
virtual float get_startup_threshold_factor() const
Get the detector-specific automatic startup multiplier.
uint16_t valid_buffer_count_
float get_motion_metric() const
Get current motion metric value.
bool is_hampel_enabled() const
Check if Hampel filter is enabled.
bool has_packet_timestamp_
BaseDetector(uint16_t window_size=DETECTOR_DEFAULT_WINDOW_SIZE)
Constructor.
void process_amplitudes(const float *amplitudes, uint8_t count)
void set_packet_timestamp_us(uint64_t timestamp_us)
Supply the monotonic arrival timestamp consumed by time-binned features.
virtual bool startup_gate_enabled() const
Whether startup calibration uses the consistency gate (threshold.h).
void clear_evaluation_state_()
Drop the last evaluation result.
hampel_filter_state_t hampel_state_
float get_last_turbulence() const
Get last turbulence value.
virtual void on_startup_calibration_complete()
Hook called when startup calibration completes successfully.
virtual const char * get_name() const =0
Get detector name for logging.
virtual void reset()
Reset detector state.
constexpr uint16_t DETECTOR_DEFAULT_WINDOW_SIZE
constexpr uint8_t HAMPEL_TURBULENCE_WINDOW_DEFAULT
MotionState
Debounced detector state.
constexpr float HAMPEL_TURBULENCE_THRESHOLD_DEFAULT
hampel_turbulence_state_t hampel_filter_state_t
constexpr float LOWPASS_CUTOFF_DEFAULT