Commit ff89574
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 ff89574
13 files changed
Lines changed: 561 additions & 75 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 | + | |
172 | 186 | | |
173 | 187 | | |
174 | 188 | | |
| |||
267 | 281 | | |
268 | 282 | | |
269 | 283 | | |
270 | | - | |
271 | 284 | | |
272 | | - | |
| 285 | + | |
273 | 286 | | |
274 | 287 | | |
275 | 288 | | |
| |||
280 | 293 | | |
281 | 294 | | |
282 | 295 | | |
283 | | - | |
| 296 | + | |
284 | 297 | | |
285 | | - | |
| 298 | + | |
286 | 299 | | |
287 | | - | |
| 300 | + | |
288 | 301 | | |
| 302 | + | |
289 | 303 | | |
290 | 304 | | |
291 | | - | |
| 305 | + | |
292 | 306 | | |
293 | 307 | | |
294 | 308 | | |
295 | 309 | | |
296 | 310 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
302 | 317 | | |
303 | 318 | | |
304 | 319 | | |
| |||
363 | 378 | | |
364 | 379 | | |
365 | 380 | | |
366 | | - | |
367 | 381 | | |
368 | | - | |
| 382 | + | |
369 | 383 | | |
370 | 384 | | |
371 | 385 | | |
| |||
391 | 405 | | |
392 | 406 | | |
393 | 407 | | |
394 | | - | |
| 408 | + | |
395 | 409 | | |
396 | 410 | | |
397 | 411 | | |
398 | 412 | | |
399 | 413 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
405 | 420 | | |
406 | 421 | | |
407 | 422 | | |
| |||
443 | 458 | | |
444 | 459 | | |
445 | 460 | | |
446 | | - | |
447 | 461 | | |
448 | | - | |
| 462 | + | |
449 | 463 | | |
450 | 464 | | |
451 | 465 | | |
| |||
466 | 480 | | |
467 | 481 | | |
468 | 482 | | |
469 | | - | |
| 483 | + | |
470 | 484 | | |
471 | 485 | | |
472 | 486 | | |
473 | 487 | | |
474 | 488 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
480 | 495 | | |
481 | 496 | | |
482 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
328 | 330 | | |
329 | 331 | | |
330 | 332 | | |
331 | | - | |
332 | | - | |
| 333 | + | |
| 334 | + | |
333 | 335 | | |
334 | 336 | | |
335 | | - | |
| 337 | + | |
336 | 338 | | |
337 | 339 | | |
338 | 340 | | |
| |||
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
348 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
352 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
353 | 365 | | |
354 | 366 | | |
355 | 367 | | |
| |||
389 | 401 | | |
390 | 402 | | |
391 | 403 | | |
| 404 | + | |
| 405 | + | |
392 | 406 | | |
0 commit comments