Skip to content

Move the speech-SNR floor from the timing gate to the pitch estimate - #29

Merged
logannye merged 1 commit into
mainfrom
fix/voice-snr-gate
Jul 26, 2026
Merged

Move the speech-SNR floor from the timing gate to the pitch estimate#29
logannye merged 1 commit into
mainfrom
fix/voice-snr-gate

Conversation

@logannye

Copy link
Copy Markdown
Owner

Three measured sessions reported zero voice segments and withheld all seven
voice metrics. The cause is arithmetic, not luck.

The measurement

eligibleSegments ends a segment on any unusable frame, and 32% of
speech-active frames sat below the 15 dB SNR floor, scattered through:

speech frames failing SNR      32%
expected contiguous usable run  3.1 frames = 31 ms
segment minimum                 2000 ms = 200 frames
P(a segment surviving)          1.5e-34

Zero segments was certain, in every session, before anyone spoke.

The floor was also in the wrong place

It exists so f0 is not estimated from speech buried in noise — a pitch
concern. Timing metrics need only reliable voice-activity detection, which is
robust well below 15 dB, and a noisy speech frame is still evidence that speech
occurred.

validPitch did not check SNR at all. So the gate was applied only where it did
harm and was absent where it belonged. It now lives in validPitch.

This is the same defect the face lane had twice: a gate built for one
measurement class applied to all of them. There it cost every bin; here it cost
every segment.

Tests

Drive 32%, 50%, and 95% of speech frames below the floor:

  • timing measures through the first
  • pitched duration falls at the second
  • pitch withholds entirely at the third

The floor is relocated, not abandoned.

Contract

Pack 3.2.0 → 3.3.0, voice algorithm versions to 1.1.0. Voice
measurements are not interchangeable across this bump. The registry/pack parity
test caught the version mismatch before it shipped.

Deliberately not changed

The face lane. Its remaining failures are genuine head movement rather than
a structural gate, and the resting-pose fix has not yet been exercised on a real
session. Changing more before that data arrives would be guessing — the same
mistake the corrected acceptance curve already made once in this project.

Verification

277 unit tests, typecheck, structure + digest check, build, 6 browser e2e.

🤖 Generated with Claude Code

…mate

Three measured sessions reported zero voice segments and withheld all seven
voice metrics. The cause is arithmetic, not luck: eligibleSegments ends a
segment on ANY unusable frame, and 32% of speech-active frames sat below the
15 dB SNR floor, scattered. Expected contiguous usable run is about 3 frames,
or 31 ms, against a 2000 ms segment minimum -- P(a segment surviving) is
1.5e-34.

The floor was also in the wrong place. It exists so f0 is not estimated from
speech buried in noise, which is a PITCH concern. Timing metrics need only
reliable voice-activity detection, robust well below 15 dB, and a noisy speech
frame is still evidence that speech occurred. validPitch did not check SNR at
all, so the gate was applied only where it did harm and absent where it
belonged. It now lives in validPitch.

This is the same defect the face lane had twice over: a gate built for one
measurement class applied to all of them. There it cost every bin; here it cost
every segment.

Tests drive 32%, 50%, and 95% of speech frames below the floor: timing measures
through the first, pitched duration falls at the second, and pitch withholds
entirely at the third. The floor is relocated, not abandoned.

Pack 3.3.0, voice algorithm versions to 1.1.0. Voice measurements are not
interchangeable across this bump.

NOT changed: the face lane. Its remaining failures are genuine head movement
rather than a structural gate, and the resting-pose fix from the previous
commit has not yet been exercised on a real session. Changing more before that
data arrives would be guessing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@logannye
logannye merged commit 22caba7 into main Jul 26, 2026
6 checks passed
@logannye
logannye deleted the fix/voice-snr-gate branch July 26, 2026 00:23
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