Commit d495cc1
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 d495cc1
13 files changed
Lines changed: 568 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 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
302 | 327 | | |
303 | 328 | | |
304 | 329 | | |
| |||
363 | 388 | | |
364 | 389 | | |
365 | 390 | | |
366 | | - | |
367 | 391 | | |
368 | | - | |
| 392 | + | |
369 | 393 | | |
370 | 394 | | |
371 | 395 | | |
| |||
391 | 415 | | |
392 | 416 | | |
393 | 417 | | |
394 | | - | |
| 418 | + | |
395 | 419 | | |
396 | 420 | | |
397 | 421 | | |
398 | 422 | | |
399 | 423 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
405 | 436 | | |
406 | 437 | | |
407 | 438 | | |
| |||
443 | 474 | | |
444 | 475 | | |
445 | 476 | | |
446 | | - | |
447 | 477 | | |
448 | | - | |
| 478 | + | |
449 | 479 | | |
450 | 480 | | |
451 | 481 | | |
| |||
466 | 496 | | |
467 | 497 | | |
468 | 498 | | |
469 | | - | |
| 499 | + | |
470 | 500 | | |
471 | 501 | | |
472 | 502 | | |
473 | 503 | | |
474 | 504 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
480 | 517 | | |
481 | 518 | | |
482 | 519 | | |
| |||
| 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