From a194143819be3225f1b5d8a5d0f41f0bef393296 Mon Sep 17 00:00:00 2001 From: ruv Date: Tue, 9 Jun 2026 12:27:48 -0400 Subject: [PATCH] fix(cli): keep proven mean-amplitude carrier for room features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The max-variance-subcarrier carrier locked onto motion artifacts (not breathing) and also had an out-of-bounds bug on variable CSI subcarrier counts. Reverted to the mean-amplitude carrier, which is validated live to detect breathing. Phase-based extraction on a stable subcarrier remains the proper higher-SNR refinement (ADR-151 §4). Co-Authored-By: claude-flow --- v2/crates/wifi-densepose-cli/src/room.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/v2/crates/wifi-densepose-cli/src/room.rs b/v2/crates/wifi-densepose-cli/src/room.rs index 1949a40d..4ebbbb2b 100644 --- a/v2/crates/wifi-densepose-cli/src/room.rs +++ b/v2/crates/wifi-densepose-cli/src/room.rs @@ -32,8 +32,12 @@ fn now_unix() -> i64 { .unwrap_or(0) } -/// One scalar per frame: mean amplitude across all subcarriers/streams. -/// Carries presence/motion energy and the breathing amplitude modulation. +/// Per-frame scalar: mean amplitude across all subcarriers/streams. +/// +/// Carries presence/motion energy plus the breathing amplitude modulation. +/// (Validated live on the ESP32 — picks up breathing where a max-variance +/// subcarrier instead locks onto motion artifacts. A phase-based carrier on a +/// *stable* subcarrier is the proper higher-SNR refinement — ADR-151 §4.) fn frame_scalar(frame: &CsiFrame) -> f32 { let a = &frame.amplitude; if a.is_empty() {