Commit 1a9c8fc
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 1a9c8fc
13 files changed
Lines changed: 550 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 | + | |
| 189 | + | |
172 | 190 | | |
173 | 191 | | |
174 | 192 | | |
| |||
267 | 285 | | |
268 | 286 | | |
269 | 287 | | |
270 | | - | |
271 | 288 | | |
272 | | - | |
| 289 | + | |
273 | 290 | | |
274 | 291 | | |
275 | 292 | | |
| |||
280 | 297 | | |
281 | 298 | | |
282 | 299 | | |
283 | | - | |
| 300 | + | |
284 | 301 | | |
285 | | - | |
| 302 | + | |
286 | 303 | | |
287 | | - | |
| 304 | + | |
288 | 305 | | |
| 306 | + | |
289 | 307 | | |
290 | 308 | | |
291 | | - | |
| 309 | + | |
292 | 310 | | |
293 | 311 | | |
294 | 312 | | |
295 | 313 | | |
296 | 314 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
302 | 321 | | |
303 | 322 | | |
304 | 323 | | |
| |||
363 | 382 | | |
364 | 383 | | |
365 | 384 | | |
366 | | - | |
367 | 385 | | |
368 | | - | |
| 386 | + | |
369 | 387 | | |
370 | 388 | | |
371 | 389 | | |
| |||
391 | 409 | | |
392 | 410 | | |
393 | 411 | | |
394 | | - | |
| 412 | + | |
395 | 413 | | |
396 | 414 | | |
397 | 415 | | |
398 | 416 | | |
399 | 417 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
405 | 424 | | |
406 | 425 | | |
407 | 426 | | |
| |||
443 | 462 | | |
444 | 463 | | |
445 | 464 | | |
446 | | - | |
447 | 465 | | |
448 | | - | |
| 466 | + | |
449 | 467 | | |
450 | 468 | | |
451 | 469 | | |
| |||
466 | 484 | | |
467 | 485 | | |
468 | 486 | | |
469 | | - | |
| 487 | + | |
470 | 488 | | |
471 | 489 | | |
472 | 490 | | |
473 | 491 | | |
474 | 492 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
480 | 499 | | |
481 | 500 | | |
482 | 501 | | |
| |||
| 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 | + | |
| 358 | + | |
349 | 359 | | |
350 | 360 | | |
351 | 361 | | |
352 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
353 | 371 | | |
354 | 372 | | |
355 | 373 | | |
| |||
389 | 407 | | |
390 | 408 | | |
391 | 409 | | |
| 410 | + | |
| 411 | + | |
392 | 412 | | |
0 commit comments