Commit 0908aed
committed
Audio: MFCC: Add Voice Activity Detection based on Mel spectrum
Add mfcc_vad module with A-weighted energy-based voice activity
detection that operates on the Mel log spectrum produced by the MFCC
component. The algorithm tracks a per-bin noise floor with instant-down
and slow-rise behavior, then computes a weighted energy delta above
the floor. Speech is declared when the delta exceeds a threshold
(0.35 in Q9.23) with a 20-frame hangover to prevent rapid toggling.
The VAD is gated on the new enable_vad flag in sof_mfcc_config.
Add struct mfcc_data_header with six int32 fields (magic,
frame_number, reserved, energy, noise_energy, vad_flag) prepended to
every output frame in all format paths (S16, S24, S32). This replaces
the previous magic-word-only header. The header carries the VAD
decision and energy values from the DSP for downstream consumers.
Extend sof_mfcc_config in user/mfcc.h with reserved16[3] padding for
32-bit alignment, and new boolean fields enable_vad, enable_dtx,
update_controls, and reserved_bool[5]. The config blob size increases
from 104 to 116 bytes.
Update Matlab/Octave decode scripts (decode_mel.m, decode_ceps.m,
decode_all.m) and setup_mfcc.m for the expanded header and config
struct. Regenerate topology2 configuration blobs (default.conf,
mel80.conf) with the new blob size.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>1 parent e35a7ef commit 0908aed
13 files changed
Lines changed: 574 additions & 72 deletions
File tree
- src
- audio/mfcc
- tune
- include
- sof/audio/mfcc
- user
- tools/topology/topology2/include/components/mfcc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
172 | 189 | | |
173 | 190 | | |
174 | 191 | | |
| |||
267 | 284 | | |
268 | 285 | | |
269 | 286 | | |
270 | | - | |
271 | 287 | | |
272 | | - | |
| 288 | + | |
273 | 289 | | |
274 | 290 | | |
275 | 291 | | |
| |||
280 | 296 | | |
281 | 297 | | |
282 | 298 | | |
283 | | - | |
| 299 | + | |
284 | 300 | | |
285 | | - | |
| 301 | + | |
286 | 302 | | |
287 | | - | |
| 303 | + | |
288 | 304 | | |
| 305 | + | |
289 | 306 | | |
290 | 307 | | |
291 | | - | |
| 308 | + | |
292 | 309 | | |
293 | 310 | | |
294 | 311 | | |
295 | 312 | | |
296 | 313 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
302 | 320 | | |
303 | 321 | | |
304 | 322 | | |
| |||
363 | 381 | | |
364 | 382 | | |
365 | 383 | | |
366 | | - | |
367 | 384 | | |
368 | | - | |
| 385 | + | |
369 | 386 | | |
370 | 387 | | |
371 | 388 | | |
| |||
391 | 408 | | |
392 | 409 | | |
393 | 410 | | |
394 | | - | |
| 411 | + | |
395 | 412 | | |
396 | 413 | | |
397 | 414 | | |
398 | 415 | | |
399 | 416 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
405 | 423 | | |
406 | 424 | | |
407 | 425 | | |
| |||
443 | 461 | | |
444 | 462 | | |
445 | 463 | | |
446 | | - | |
447 | 464 | | |
448 | | - | |
| 465 | + | |
449 | 466 | | |
450 | 467 | | |
451 | 468 | | |
| |||
466 | 483 | | |
467 | 484 | | |
468 | 485 | | |
469 | | - | |
| 486 | + | |
470 | 487 | | |
471 | 488 | | |
472 | 489 | | |
473 | 490 | | |
474 | 491 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
480 | 498 | | |
481 | 499 | | |
482 | 500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
| |||
328 | 335 | | |
329 | 336 | | |
330 | 337 | | |
331 | | - | |
332 | | - | |
| 338 | + | |
| 339 | + | |
333 | 340 | | |
334 | 341 | | |
335 | | - | |
| 342 | + | |
336 | 343 | | |
337 | 344 | | |
338 | 345 | | |
| |||
345 | 352 | | |
346 | 353 | | |
347 | 354 | | |
348 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
349 | 358 | | |
350 | 359 | | |
351 | 360 | | |
352 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
353 | 370 | | |
354 | 371 | | |
355 | 372 | | |
| |||
389 | 406 | | |
390 | 407 | | |
391 | 408 | | |
| 409 | + | |
| 410 | + | |
392 | 411 | | |
0 commit comments