Skip to content

audio: mfcc: run VAD on unclamped log Mel spectrum with PCAN - #11564

Merged
lgirdwood merged 2 commits into
thesofproject:intel/wov-d0i3-002from
singalsu:intel_wov-d0i3-002_pcan_vad_fix
Nov 30, 2026
Merged

lgirdwood merged 2 commits into
thesofproject:intel/wov-d0i3-002from
singalsu:intel_wov-d0i3-002_pcan_vad_fix

Conversation

@singalsu

Copy link
Copy Markdown
Collaborator

No description provided.

In the PCAN mode the output features are computed from the linear
Mel energies and the Q9.23 log Mel values are only read by the VAD.
The Mel-only mmax tracking, top_db clamp, offset and scale were
still applied to them. The PCAN configuration has top_db = 0 and
mmax = 0, so every log Mel value below zero was raised to zero and
the VAD saw max(ln(Mel power), 0). This made the VAD an absolute
level gate: the weighted energy stayed at zero in room noise and
quiet speech, and the VAD reported speech only for loud input.

MicroWakeWord gates its detections with the VAD flag, so a keyword
spoken below about -38 LUFS at the MFCC input was never detected even
when the model scored it at 99%. On a PTL SoundWire DMIC device a
3 dB quieter talker turned a reliable detection into a miss, with
27 inferences of the keyword gated.

Skip the clamp, offset and scale in the PCAN mode so the VAD sees the
unclamped natural log Mel power, and use a separate threshold for it.
MFCC_VAD_ENERGY_THRESHOLD_PCAN is 2.2, i.e. 9.6 dB above the tracked
noise floor. In sof-testbench4 runs with noise at -56 LUFS the VAD
stays off in pink and white noise and detects the keyword down to
-53 LUFS. With fan-like exercise bike noise the VAD is active for
about 20% of the noise-only time. A threshold of 2.5 avoided that
but on the device missed weak words such as "front" with a desk fan
running. The int8 PCAN output features are bit-exact with the
previous version. The other MFCC modes are not changed.

Document the VAD input and thresholds in the README.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
With PCAN the MFCC VAD energy is the weighted natural log Mel power,
which is negative. The debug statistics started the maximum from zero,
so the shutdown summary always printed max_E=0. Start it from
INT32_MIN instead.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
singalsu marked this pull request as ready for review November 30, 2026 17:07
@lgirdwood
lgirdwood merged commit 4af6fd7 into thesofproject:intel/wov-d0i3-002 Nov 30, 2026
33 of 39 checks passed
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.

2 participants