Generate stateless chirplet timeline fingerprints

This commit is contained in:
Meta Vens 2026-05-22 12:54:56 +01:00
commit 7f804ad5da
9 changed files with 169 additions and 50 deletions

View file

@ -50,17 +50,23 @@ produced zero WASAPI packets until that Eye was unplugged and replugged.
The full probe runtime config now enables sample-bearing blocks for every local
audio source. `MimirChirpletCalibrationPhrase` owns the emitted calibration
phrase and the matched-filter shape used to analyze it. The default phrase is a
short harmonic-ish pattern around 8 kHz, 10 kHz, 12 kHz, and 16 kHz, repeated
every 1.5 seconds through Aquarium audio. That makes the telemetry less like a
single sterile squeal and more like a small, identifiable timing signature.
phrase and the matched-filter shape used to analyze it. The default timeline is
a stateless 16-phrase cycle. Phrase `N` is generated directly from `N`, with no
registry or remembered random state. Each phrase is a spread-out asymmetric
motif: six short chirplets over about 1.38 seconds, with nonuniform gaps and
high-frequency bands. A new phrase fires every 3.25 seconds through Aquarium
audio. The point is not ornament. The timing code is carried by both frequency
and rhythm, so it behaves more like a small birdsong signature than a repeated
sweep. The indexed phrase sequence has lower ambiguity when remote feeds add
network/encoding latency.
`MimirAudioSynchronizationAnalyzer` resamples candidate mic windows into the
loopback sample-rate timeline, projects loopback and candidate windows through
the same phrase, contrast-normalizes the resulting energy traces, and estimates
current delay against `loopback-scarlett-speakers`. Reports carry both rounded
integer delay and fractional delay from parabolic peak interpolation over the
chirplet correlation peak.
current delay against `loopback-scarlett-speakers`. The lag search is wide
enough for ordinary remote/network delay, not just local speaker-to-mic delay.
Reports carry both rounded integer delay and fractional delay from parabolic
peak interpolation over the chirplet correlation peak.
`MimirSynchronizationHub.BuildAlignedAudioFrame` returns a provisional aligned
mono frame: loopback is always channel zero, and other channels enter only when
@ -116,6 +122,14 @@ watching delay change over time. Per-band energy over many phrases gives the
normalization curve. The important constraint is that all three measurements
must be tied to the same emitted phrase, not three separately invented probes.
The phrase is no longer static. Mimir currently rotates a deterministic
16-phrase cycle and the analyzer searches that cycle. That is enough for a
first timeline fingerprint and ordinary remote/network delay. For higher-latency
or recorded/replayed sources, the next extension should lengthen the code or
make the phrase index explicitly recoverable from the chirplet rhythm so Mimir
can distinguish phrase N from phrase N+16 without relying only on wall-clock
arrival.
Next, replace the diagnostic bridge with native audio capture workers that
append typed blocks into `Mimir.Runtime`, then expose buffer depth, clock state,
delay estimates, and stem routing in Aquarium UI.

View file

@ -42,8 +42,11 @@ a named invariant that the native runtime cannot protect yet.
- `native/probes/wasapi_audio_cadence` captures WASAPI mic or render-loopback
block metadata and emits `audio-block` JSON events for the diagnostic runtime
adapter.
- `MimirChirpletCalibrationPhrase` owns the structured harmonic-ish calibration
- `MimirChirpletCalibrationPhrase` owns the structured birdsong-like calibration
phrase, PCM rendering, matched timing trace, and per-band response kernels.
The default timeline is a stateless 16-phrase cycle; phrase `N` is generated
from `N`, spreads six chirplets across about 1.38 seconds, and fires every
3.25 seconds to reduce repeated-sweep ambiguity.
- `MimirAudioSynchronizationAnalyzer` ports the first live sync measurement:
sample-bearing audio blocks are resampled into the Scarlett loopback timeline
and compared by chirplet-energy delay estimation with fractional peak