Skip to content

feat(server): per-node signed Doppler diagnostics - #1815

Open
clonea1 wants to merge 2 commits into
ruvnet:mainfrom
clonea1:contrib/server-doppler-deadband
Open

feat(server): per-node signed Doppler diagnostics#1815
clonea1 wants to merge 2 commits into
ruvnet:mainfrom
clonea1:contrib/server-doppler-deadband

Conversation

@clonea1

@clonea1 clonea1 commented Sep 4, 2026

Copy link
Copy Markdown

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.


Rebased onto current main before opening: staged before today's seven merges, so it needed replaying to avoid reading as a revert of them. Clean rebase, no files deleted.

Joe and others added 2 commits September 4, 2026 15:01
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant