feat(server): per-node signed Doppler diagnostics - #1815
Open
clonea1 wants to merge 2 commits into
Open
Conversation
extract_bvp takes a real-valued, amplitude-only input and keeps only the
magnitude of the FFT output, then folds doppler_freq.abs() into the velocity
bins. Direction is therefore unavailable from that path -- and not as a tuning
shortcut that a better post-processing step could undo.
A real-valued signal's FFT magnitude is symmetric about zero frequency:
|X(-f)| == |X(f)| for real x
So approach and retreat produce identical spectra. The information is not
attenuated or noisy, it is absent, and no amount of downstream work recovers
it. Anything built on that output can report that motion occurred but never
which way it went.
extract_bvp_signed takes temporal COMPLEX CSI -- amplitude and phase together
-- so the spectrum is no longer constrained to be symmetric and the sign of the
Doppler shift is preserved. Added alongside the existing function rather than
replacing it: callers with only amplitude available keep working unchanged, and
the choice of which to use is made where the input format is known.
Three tests cover the property that matters: a synthetic approaching source and
a receding one must produce opposite signs, which the amplitude-only path
cannot distinguish by construction.
Co-Authored-By: claude-flow <ruv@ruv.net>
Reports two figures per node on /api/v1/nodes: the moving energy in its Body
Velocity Profile, and the signed, energy-weighted mean radial velocity.
Retains sanitized per-node phase alongside amplitude, in lockstep so the two
can be zipped by index. Without phase there is no complex CSI, and without
complex CSI a BVP cannot carry direction at all.
The zero-velocity deadband is expressed in BINS, not m/s, and this is the part
worth reviewing. The natural way to write it is a velocity threshold -- exclude
anything slower than 0.05 m/s. That is wrong whenever the threshold is narrower
than one bin: with the default BvpConfig the spacing is
max_velocity * 2 / n_velocity_bins = 2.0 * 2 / 64 = 0.0625 m/s, so a 0.05 m/s
threshold excludes only the single exact-zero bin, and the immediate
neighbours, into which a Hann-windowed STFT always leaks real DC and static
energy, count as motion by construction. The result is a saturated metric that
reports near-maximum movement for a still room -- and a saturated metric looks
like a working one on a dashboard.
Excluding a bin COUNT, derived from each call's actual velocity_resolution,
stays correct if BvpConfig ever changes. The zero bin is found by minimum
absolute velocity rather than an equality test, so it is robust to even/odd bin
counts and float rounding.
MEASURED with the accompanying fixtures, static (0.05 Hz) against moving (2 Hz),
which differ only in rate so the deadband is the only thing separating them:
deadband = 0 bins: 19.13 / 310.89 = 6.2%
deadband = 2 bins: 0.56 / 122.59 = 0.45%
These are DIAGNOSTICS, not a position estimate. A magnitude alone carries no
directional information, and no position tier is built on them here.
Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reports two figures per node on /api/v1/nodes: the moving energy in its Body
Velocity Profile, and the signed, energy-weighted mean radial velocity.
Retains sanitized per-node phase alongside amplitude, in lockstep so the two
can be zipped by index. Without phase there is no complex CSI, and without
complex CSI a BVP cannot carry direction at all.
The zero-velocity deadband is expressed in BINS, not m/s, and this is the part
worth reviewing. The natural way to write it is a velocity threshold -- exclude
anything slower than 0.05 m/s. That is wrong whenever the threshold is narrower
than one bin: with the default BvpConfig the spacing is
max_velocity * 2 / n_velocity_bins = 2.0 * 2 / 64 = 0.0625 m/s, so a 0.05 m/s
threshold excludes only the single exact-zero bin, and the immediate
neighbours, into which a Hann-windowed STFT always leaks real DC and static
energy, count as motion by construction. The result is a saturated metric that
reports near-maximum movement for a still room -- and a saturated metric looks
like a working one on a dashboard.
Excluding a bin COUNT, derived from each call's actual velocity_resolution,
stays correct if BvpConfig ever changes. The zero bin is found by minimum
absolute velocity rather than an equality test, so it is robust to even/odd bin
counts and float rounding.
MEASURED with the accompanying fixtures, static (0.05 Hz) against moving (2 Hz),
which differ only in rate so the deadband is the only thing separating them:
These are DIAGNOSTICS, not a position estimate. A magnitude alone carries no
directional information, and no position tier is built on them here.
Rebased onto current
mainbefore opening: staged before today's seven merges, so it needed replaying to avoid reading as a revert of them. Clean rebase, no files deleted.