From ed2f0a25ebb16e6a9d6432e2b989e9e562a94923 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 26 Nov 2026 17:46:22 +0200 Subject: [PATCH 1/4] audio: mfcc: tune: add AGC8 and update presets for current MFCC configurations Add the AGC8 fields to setup_mfcc.m, so that it generates the mel40_10ms_agc8_compress blob for computing AGC8 features in model training. Update the mel40_10ms preset to use log10 Mel with dynamic mmax and top_db limit, and to run VAD with control updates. The microwakeword PCAN preset now runs VAD to provide the energy and VAD flag for the MWW gating. Add an optional per preset comment that is written to the conf file header, and use it to describe the VAD and DTX choices of the WoV MFCC blobs. Signed-off-by: Seppo Ingalsuo --- src/audio/mfcc/tune/setup_mfcc.m | 75 ++++++++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 8 deletions(-) diff --git a/src/audio/mfcc/tune/setup_mfcc.m b/src/audio/mfcc/tune/setup_mfcc.m index 9ebc952e734c..95f3c8d24ccf 100644 --- a/src/audio/mfcc/tune/setup_mfcc.m +++ b/src/audio/mfcc/tune/setup_mfcc.m @@ -60,6 +60,17 @@ function setup_mfcc() setup.num_mel_bins = 40; setup.low_freq = 125; setup.high_freq = 7500; + setup.mel_log = 'log10'; + setup.top_db = 8.0; + setup.mmax_coef = 0; + setup.dynamic_mmax = true; + setup.remove_dc_offset = false; + setup.enable_vad = true; + setup.update_controls = true; + setup.pcan_strength = 0; + setup.pcan_offset = 0; + setup.pcan_gain_bits = 0; + setup.pcan_smoothing_coef = 0; setup.tplg_fn = 'mel40_10ms.conf'; export_mfcc_setup(gen_cfg, setup); @@ -77,6 +88,7 @@ function setup_mfcc() setup.enable_dtx = false; setup.dtx_trailing_silence_hops = 0; setup.dtx_silence_hops_interval = 0; + setup.comment = 'enable_vad=0 enable_dtx=0: streaming MWW must see every hop, and VAD is not run.'; setup.tplg_fn = 'mel40_10ms_compress.conf'; export_mfcc_setup(gen_cfg, setup); @@ -126,13 +138,43 @@ function setup_mfcc() setup.pcan_smoothing_coef = 819; setup.compress_output = true; setup.update_controls = false; - setup.enable_vad = false; + setup.enable_vad = true; setup.enable_dtx = false; setup.dtx_trailing_silence_hops = 0; setup.dtx_silence_hops_interval = 0; + setup.comment = ['enable_vad=1 enable_dtx=0 update_controls=0: VAD runs to populate energy/vad_flag\n' ... + '# for MWW gating; DTX off so every hop is still emitted; no kcontrol notifications.']; setup.tplg_fn = 'mel40_10ms_pcan_compress.conf'; export_mfcc_setup(gen_cfg, setup); + % 40 mel bins, 10 ms hop with soft AGC int8 output for microWakeWord, a + % light alternative to PCAN. The int8 range -1.0 .. +1.0 covers 50 dB of + % log10 Mel power below the AGC normalized peak. + setup = get_mel_spectrogram_config(); + setup.frame_length = 30.0; + setup.frame_shift = 10.0; + setup.num_mel_bins = 40; + setup.low_freq = 125; + setup.high_freq = 7500; + setup.mel_log = 'log10'; + setup.mel_offset = 0; + setup.mel_scale = 0.4; % 1.0 is 25 dB + setup.enable_agc8 = true; + setup.agc_target = 3.0; % allows +75 dB boost for quiet input + setup.agc_floor = -1.0; + setup.agc_release = 10066; % 3 dB/s at 100 hops/s + setup.agc_release_speech = 335; % 0.1 dB/s + setup.compress_output = true; + setup.update_controls = false; + setup.enable_vad = true; % slower AGC release in speech, vad_flag for MWW + setup.enable_dtx = false; + setup.dtx_trailing_silence_hops = 0; + setup.dtx_silence_hops_interval = 0; + setup.comment = ['enable_vad=1 enable_dtx=0 update_controls=0: VAD runs to populate energy/vad_flag\n' ... + '# for the AGC release and MWW gating; DTX off so every hop is still emitted.']; + setup.tplg_fn = 'mel40_10ms_agc8_compress.conf'; + export_mfcc_setup(gen_cfg, setup); + end function cfg = get_mfcc_default_config() @@ -181,6 +223,11 @@ function setup_mfcc() cfg.pcan_offset = 80.0; cfg.pcan_gain_bits = 21; cfg.pcan_smoothing_coef = 819; + cfg.enable_agc8 = false; + cfg.agc_target = 0; % 0 = default 0.25 + cfg.agc_floor = 0; % 0 = default -2.0 + cfg.agc_release = 0; % Q9.23 per hop, 0 = default 4194 + cfg.agc_release_speech = 0; % Q9.23 per hop, 0 = default 419 end function cfg = get_mel_spectrogram_config() @@ -229,6 +276,11 @@ function setup_mfcc() cfg.pcan_offset = 80.0; cfg.pcan_gain_bits = 21; cfg.pcan_smoothing_coef = 819; + cfg.enable_agc8 = false; + cfg.agc_target = 0; % 0 = default 0.25 + cfg.agc_floor = 0; % 0 = default -2.0 + cfg.agc_release = 0; % Q9.23 per hop, 0 = default 4194 + cfg.agc_release_speech = 0; % Q9.23 per hop, 0 = default 419 end function export_mfcc_setup(gen_cfg, cfg) @@ -266,8 +318,12 @@ function export_mfcc_setup(gen_cfg, cfg) v = cfg.dtx_trailing_silence_hops; [b8, j] = add_w16b(v, b8, j); % DTX trailing silence hops v = cfg.dtx_silence_hops_interval; [b8, j] = add_w16b(v, b8, j); % DTX silence frame interval v = cfg.pcan_smoothing_coef; [b8, j] = add_w32b(v, b8, j); % PCAN smoothing coef in Q14 +v = q_convert(cfg.agc_target, 7); [b8, j] = add_w16b(v, b8, j); % AGC8 target in Q8.7 +v = q_convert(cfg.agc_floor, 7); [b8, j] = add_w16b(v, b8, j); % AGC8 floor in Q8.7 +v = cfg.agc_release; [b8, j] = add_w16b(v, b8, j); % AGC8 release in Q9.23 +v = cfg.agc_release_speech; [b8, j] = add_w16b(v, b8, j); % AGC8 speech release in Q9.23 % Reserved -for i = 1:4 +for i = 1:2 [b8, j] = add_w32b(0, b8, j); end @@ -309,22 +365,25 @@ function export_mfcc_setup(gen_cfg, cfg) v = cfg.update_controls; [b8, j] = add_w8b(v, b8, j); % bool v = cfg.compress_output; [b8, j] = add_w8b(v, b8, j); % bool v = cfg.enable_pcan; [b8, j] = add_w8b(v, b8, j); % bool -% reserved_bool[3] -for i = 1:3 +v = cfg.enable_agc8; [b8, j] = add_w8b(v, b8, j); % bool +% reserved_bool[2] +for i = 1:2 [b8, j] = add_w8b(0, b8, j); end %% Export tplg_fn = [gen_cfg.mfcc_conf_path cfg.tplg_fn]; +howto = 'cd src/audio/mfcc/tune; octave setup_mfcc.m'; +if isfield(cfg, 'comment') + howto = sprintf('%s\n# %s', howto, sprintf(cfg.comment)); +end switch gen_cfg.tplg_ver case 1 sof_tplg_write(tplg_fn, b8, "DEF_MFCC_PRIV", ... - "Exported with script setup_mfcc.m", ... - "cd src/audio/mfcc/tune; octave setup_mfcc.m"); + "Exported with script setup_mfcc.m", howto); case 2 sof_tplg2_write(tplg_fn, b8, "mfcc_config", ... - "Exported MFCC configuration", ... - "cd src/audio/mfcc/tune; octave setup_mfcc.m"); + "Exported MFCC configuration", howto); otherwise error("Illegal tplg_ver, use 1 for topology v1 or 2 topology v2."); end From c54c4f091721b5737993c55bbcd71d173750f429 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 26 Nov 2026 17:46:22 +0200 Subject: [PATCH 2/4] topology2: mfcc: add mel40 10 ms, PCAN and AGC8 testbench topologies Add the sof-hda-benchmark-mfccmel40_10ms, _pcan and _agc8 testbench topologies for 16, 24 and 32 bit. The MWW model training uses them in sof-testbench4 as the feature extractor, so that training sees bit-exact firmware MFCC features. Signed-off-by: Seppo Ingalsuo --- .../topology2/cavs-benchmark-hda.conf | 30 +++++++++++++++++++ .../development/tplg-targets-bench.cmake | 6 ++++ .../include/bench/mfcc_controls_capture.conf | 3 ++ .../include/bench/mfcc_controls_playback.conf | 3 ++ .../bench/mfccmel40_10ms_agc8_s16.conf | 13 ++++++++ .../bench/mfccmel40_10ms_agc8_s24.conf | 13 ++++++++ .../bench/mfccmel40_10ms_agc8_s32.conf | 13 ++++++++ .../bench/mfccmel40_10ms_pcan_s16.conf | 13 ++++++++ .../bench/mfccmel40_10ms_pcan_s24.conf | 13 ++++++++ .../bench/mfccmel40_10ms_pcan_s32.conf | 13 ++++++++ .../include/bench/mfccmel40_10ms_s16.conf | 13 ++++++++ .../include/bench/mfccmel40_10ms_s24.conf | 13 ++++++++ .../include/bench/mfccmel40_10ms_s32.conf | 13 ++++++++ 13 files changed, 159 insertions(+) create mode 100644 tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s16.conf create mode 100644 tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s24.conf create mode 100644 tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s32.conf create mode 100644 tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s16.conf create mode 100644 tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s24.conf create mode 100644 tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s32.conf create mode 100644 tools/topology/topology2/include/bench/mfccmel40_10ms_s16.conf create mode 100644 tools/topology/topology2/include/bench/mfccmel40_10ms_s24.conf create mode 100644 tools/topology/topology2/include/bench/mfccmel40_10ms_s32.conf diff --git a/tools/topology/topology2/cavs-benchmark-hda.conf b/tools/topology/topology2/cavs-benchmark-hda.conf index d1357caa20ab..e4e09a959d19 100644 --- a/tools/topology/topology2/cavs-benchmark-hda.conf +++ b/tools/topology/topology2/cavs-benchmark-hda.conf @@ -845,6 +845,36 @@ IncludeByKey.BENCH_CONFIG { } + "mfccmel40_10ms16" { + + } + "mfccmel40_10ms24" { + + } + "mfccmel40_10ms32" { + + } + + "mfccmel40_10ms_pcan16" { + + } + "mfccmel40_10ms_pcan24" { + + } + "mfccmel40_10ms_pcan32" { + + } + + "mfccmel40_10ms_agc816" { + + } + "mfccmel40_10ms_agc824" { + + } + "mfccmel40_10ms_agc832" { + + } + # # Micsel component # diff --git a/tools/topology/topology2/development/tplg-targets-bench.cmake b/tools/topology/topology2/development/tplg-targets-bench.cmake index 2dd4f28bc07c..417dff6f1eeb 100644 --- a/tools/topology/topology2/development/tplg-targets-bench.cmake +++ b/tools/topology/topology2/development/tplg-targets-bench.cmake @@ -20,6 +20,9 @@ set(components "level_multiplier" "mfcc" "mfccmel" + "mfccmel40_10ms" + "mfccmel40_10ms_pcan" + "mfccmel40_10ms_agc8" "micsel" "phase_vocoder" "rtnr" @@ -48,6 +51,9 @@ set(component_parameters "BENCH_LEVEL_MULTIPLIER_PARAMS=default" "BENCH_MFCC_PARAMS=default" "BENCH_MFCC_PARAMS=mel80" + "BENCH_MFCC_PARAMS=mel40_10ms" + "BENCH_MFCC_PARAMS=mel40_10ms_pcan" + "BENCH_MFCC_PARAMS=mel40_10ms_agc8" "BENCH_MICSEL_PARAMS=passthrough" "BENCH_PHASE_VOCODER_PARAMS=default" "BENCH_RTNR_PARAMS=default" diff --git a/tools/topology/topology2/include/bench/mfcc_controls_capture.conf b/tools/topology/topology2/include/bench/mfcc_controls_capture.conf index 8788387ec8c7..1e1fce4dbd6d 100644 --- a/tools/topology/topology2/include/bench/mfcc_controls_capture.conf +++ b/tools/topology/topology2/include/bench/mfcc_controls_capture.conf @@ -7,6 +7,9 @@ IncludeByKey.BENCH_MFCC_PARAMS { "default" "include/components/mfcc/default.conf" "mel80" "include/components/mfcc/mel80.conf" + "mel40_10ms" "include/components/mfcc/mel40_10ms.conf" + "mel40_10ms_pcan" "include/components/mfcc/mel40_10ms_pcan_compress.conf" + "mel40_10ms_agc8" "include/components/mfcc/mel40_10ms_agc8_compress.conf" } } mixer."1" { diff --git a/tools/topology/topology2/include/bench/mfcc_controls_playback.conf b/tools/topology/topology2/include/bench/mfcc_controls_playback.conf index 007dbb91cd4f..b316223ad883 100644 --- a/tools/topology/topology2/include/bench/mfcc_controls_playback.conf +++ b/tools/topology/topology2/include/bench/mfcc_controls_playback.conf @@ -7,6 +7,9 @@ IncludeByKey.BENCH_MFCC_PARAMS { "default" "include/components/mfcc/default.conf" "mel80" "include/components/mfcc/mel80.conf" + "mel40_10ms" "include/components/mfcc/mel40_10ms.conf" + "mel40_10ms_pcan" "include/components/mfcc/mel40_10ms_pcan_compress.conf" + "mel40_10ms_agc8" "include/components/mfcc/mel40_10ms_agc8_compress.conf" } } mixer."1" { diff --git a/tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s16.conf b/tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s16.conf new file mode 100644 index 000000000000..ec89bffb90a1 --- /dev/null +++ b/tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s16.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh mfcc" + Object.Widget.mfcc.1 { + index $BENCH_PLAYBACK_HOST_PIPELINE + + + } + Object.Widget.mfcc.2 { + index $BENCH_CAPTURE_HOST_PIPELINE + + + } + + diff --git a/tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s24.conf b/tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s24.conf new file mode 100644 index 000000000000..73571fabe5f2 --- /dev/null +++ b/tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s24.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh mfcc" + Object.Widget.mfcc.1 { + index $BENCH_PLAYBACK_HOST_PIPELINE + + + } + Object.Widget.mfcc.2 { + index $BENCH_CAPTURE_HOST_PIPELINE + + + } + + diff --git a/tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s32.conf b/tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s32.conf new file mode 100644 index 000000000000..75c01eaf4a43 --- /dev/null +++ b/tools/topology/topology2/include/bench/mfccmel40_10ms_agc8_s32.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh mfcc" + Object.Widget.mfcc.1 { + index $BENCH_PLAYBACK_HOST_PIPELINE + + + } + Object.Widget.mfcc.2 { + index $BENCH_CAPTURE_HOST_PIPELINE + + + } + + diff --git a/tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s16.conf b/tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s16.conf new file mode 100644 index 000000000000..ec89bffb90a1 --- /dev/null +++ b/tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s16.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh mfcc" + Object.Widget.mfcc.1 { + index $BENCH_PLAYBACK_HOST_PIPELINE + + + } + Object.Widget.mfcc.2 { + index $BENCH_CAPTURE_HOST_PIPELINE + + + } + + diff --git a/tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s24.conf b/tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s24.conf new file mode 100644 index 000000000000..73571fabe5f2 --- /dev/null +++ b/tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s24.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh mfcc" + Object.Widget.mfcc.1 { + index $BENCH_PLAYBACK_HOST_PIPELINE + + + } + Object.Widget.mfcc.2 { + index $BENCH_CAPTURE_HOST_PIPELINE + + + } + + diff --git a/tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s32.conf b/tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s32.conf new file mode 100644 index 000000000000..75c01eaf4a43 --- /dev/null +++ b/tools/topology/topology2/include/bench/mfccmel40_10ms_pcan_s32.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh mfcc" + Object.Widget.mfcc.1 { + index $BENCH_PLAYBACK_HOST_PIPELINE + + + } + Object.Widget.mfcc.2 { + index $BENCH_CAPTURE_HOST_PIPELINE + + + } + + diff --git a/tools/topology/topology2/include/bench/mfccmel40_10ms_s16.conf b/tools/topology/topology2/include/bench/mfccmel40_10ms_s16.conf new file mode 100644 index 000000000000..ec89bffb90a1 --- /dev/null +++ b/tools/topology/topology2/include/bench/mfccmel40_10ms_s16.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh mfcc" + Object.Widget.mfcc.1 { + index $BENCH_PLAYBACK_HOST_PIPELINE + + + } + Object.Widget.mfcc.2 { + index $BENCH_CAPTURE_HOST_PIPELINE + + + } + + diff --git a/tools/topology/topology2/include/bench/mfccmel40_10ms_s24.conf b/tools/topology/topology2/include/bench/mfccmel40_10ms_s24.conf new file mode 100644 index 000000000000..73571fabe5f2 --- /dev/null +++ b/tools/topology/topology2/include/bench/mfccmel40_10ms_s24.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh mfcc" + Object.Widget.mfcc.1 { + index $BENCH_PLAYBACK_HOST_PIPELINE + + + } + Object.Widget.mfcc.2 { + index $BENCH_CAPTURE_HOST_PIPELINE + + + } + + diff --git a/tools/topology/topology2/include/bench/mfccmel40_10ms_s32.conf b/tools/topology/topology2/include/bench/mfccmel40_10ms_s32.conf new file mode 100644 index 000000000000..75c01eaf4a43 --- /dev/null +++ b/tools/topology/topology2/include/bench/mfccmel40_10ms_s32.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh mfcc" + Object.Widget.mfcc.1 { + index $BENCH_PLAYBACK_HOST_PIPELINE + + + } + Object.Widget.mfcc.2 { + index $BENCH_CAPTURE_HOST_PIPELINE + + + } + + From 8af8b470488ab066dd37b47b81bee680719047e7 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 26 Nov 2026 17:46:23 +0200 Subject: [PATCH 3/4] audio: microwakeword: tune: train int8 PCAN and AGC8 models with SOF testbench Bring the int8 feature model training updates from the MWW development branch. Training: - The trainer gets its int8 PCAN or AGC8 features (--features) from the SOF MFCC component run in sof-testbench4, so training sees bit-exact firmware features. Each clip is embedded in continuous background with a random level and hop phase, the training window covers the full streaming receptive field, and the evaluation uses the same averaged-probability trigger rule as the firmware. - Digital silence streams, also at stream start while the streaming state is zero, are trained as hard negatives (--digital-silence). - A continuous speech class, windowed over the whole clip length, is added with sof_mww_prepare_common_voice.py that selects a repeatable, bit-exact set of Mozilla Common Voice (CC0) sentences. - The default negative class weight is raised from 2.0 to 3.0 to make the models more conservative on untrained English speech. Model export: - sof_mww_int8_state.py keeps the streaming state in int8 instead of float32 resource variables, with identical outputs. The trainer applies it after the int8 quantization. - The int8 output range is calibrated with 64 whole training windows, half of them keyword windows, streamed through the streaming model. - The exported built-in header, topology and sof-ctl blobs start with struct sof_mww_model_hdr that carries the feature type, trigger threshold and averaging length. Datasets: - sof_mww_asr_transcribe.py and sof_mww_asr_filter.py screen keyword clips with an OpenVINO Whisper model and remove unrecognized ones. - The keyword synthesis uses a new piper speaker for every clip, has clearer generator noise settings, text variants for intonation, and less additive noise. - sof_mww_split_utterances.py splits recordings of a repeated keyword into one WAV per utterance, and sof_mww_anonymize_clips.py renames the clips in a shuffled order. sof_mww_pcan_train_fruits.sh trains the strawberry, banana and orange models for the 3-keyword topology with the other fruits as unknown speech, Common Voice negatives, optional Whisper screening, real recordings with trimming and augmentation, and FEATURES, BUILD_TOOLS and TRAIN_ options. The int32 Mel training flow (sof_mww_train_pipeline.sh, sof_mww_train.py, sof_mww_dataset.py and sof_mww_verify.py) for the removed in-component AGC is removed. The README documents the dataset preparation, training and deployment steps, and model_architecture.md describes the streaming network, its int8 quantization and the firmware trigger rule. Signed-off-by: Seppo Ingalsuo --- src/audio/microwakeword/README.md | 2 +- src/audio/microwakeword/tune/README.md | 123 ++- .../microwakeword/tune/model_architecture.md | 94 +++ .../tune/sof_mww_anonymize_clips.py | 68 ++ .../microwakeword/tune/sof_mww_asr_filter.py | 77 ++ .../tune/sof_mww_asr_transcribe.py | 130 +++ .../microwakeword/tune/sof_mww_dataset.py | 332 -------- .../tune/sof_mww_generate_keyword_dataset.sh | 44 +- ...f_mww_generate_keyword_dataset_from_dir.sh | 6 +- ..._mww_generate_keyword_dataset_piper_tts.sh | 2 +- .../microwakeword/tune/sof_mww_int8_state.py | 197 +++++ .../tune/sof_mww_pcan_train_fruits.sh | 442 ++++++++++ .../tune/sof_mww_prepare_common_voice.py | 158 ++++ .../tune/sof_mww_split_utterances.py | 170 ++++ src/audio/microwakeword/tune/sof_mww_train.py | 529 ------------ .../microwakeword/tune/sof_mww_train_pcan.py | 793 ++++++++++++------ .../tune/sof_mww_train_pipeline.sh | 244 ------ .../microwakeword/tune/sof_mww_verify.py | 200 ----- 18 files changed, 1991 insertions(+), 1620 deletions(-) create mode 100644 src/audio/microwakeword/tune/model_architecture.md create mode 100755 src/audio/microwakeword/tune/sof_mww_anonymize_clips.py create mode 100644 src/audio/microwakeword/tune/sof_mww_asr_filter.py create mode 100644 src/audio/microwakeword/tune/sof_mww_asr_transcribe.py delete mode 100644 src/audio/microwakeword/tune/sof_mww_dataset.py create mode 100644 src/audio/microwakeword/tune/sof_mww_int8_state.py create mode 100755 src/audio/microwakeword/tune/sof_mww_pcan_train_fruits.sh create mode 100755 src/audio/microwakeword/tune/sof_mww_prepare_common_voice.py create mode 100755 src/audio/microwakeword/tune/sof_mww_split_utterances.py delete mode 100644 src/audio/microwakeword/tune/sof_mww_train.py delete mode 100755 src/audio/microwakeword/tune/sof_mww_train_pipeline.sh delete mode 100644 src/audio/microwakeword/tune/sof_mww_verify.py diff --git a/src/audio/microwakeword/README.md b/src/audio/microwakeword/README.md index 040a595dac06..0932f9463127 100644 --- a/src/audio/microwakeword/README.md +++ b/src/audio/microwakeword/README.md @@ -191,7 +191,7 @@ The built-in models and the bytes control use the same model blob: `struct sof_m - the trigger threshold (Q0.8) and the number of averaged probabilities, so each model carries its own trigger tuning, - reserved words. -A bare TFLite flatbuffer without the header is still accepted and uses the default trigger settings `MWW_DETECT_THRESHOLD_Q8` and `MWW_DETECT_AVG_LEN`. +A bare TFLite flatbuffer without the header is still accepted and uses the default trigger settings `MWW_DETECT_THRESHOLD_Q8` and `MWW_DETECT_AVG_LEN`. The tune scripts `sof_mww_train_pcan.py` and `sof_mww_int8_state.py` emit the blobs with the header. --- diff --git a/src/audio/microwakeword/tune/README.md b/src/audio/microwakeword/tune/README.md index 8a524cb8ef2e..ac67a444fe8d 100644 --- a/src/audio/microwakeword/tune/README.md +++ b/src/audio/microwakeword/tune/README.md @@ -11,27 +11,21 @@ This directory contains offline scripts to train, quantize, verify, and export s - [sof_mww_generate_keyword_dataset_piper_tts.sh](sof_mww_generate_keyword_dataset_piper_tts.sh): Synthesizes positive keyword WAVs with single-speaker Piper TTS voices, pitch/tempo perturbation (via `sox`), Gaussian gain jitter, and Room Impulse Response (RIR) reverberation. - [sof_mww_generate_keyword_dataset.sh](sof_mww_generate_keyword_dataset.sh): Multi-speaker generation with `piper-sample-generator` (LibriTTS-R). - [sof_mww_prepare_silence_unknown.sh](sof_mww_prepare_silence_unknown.sh): Prepares negative dataset classes (`silence` and `unknown`) by slicing background noise and non-target words from Google Speech Commands v2. + - [sof_mww_prepare_common_voice.py](sof_mww_prepare_common_voice.py): Selects a repeatable set of Mozilla Common Voice (CC0) sentence clips from extracted language releases into a `speech` class of continuous speech negatives, with a per-speaker limit and a transcript exclusion regex for the keyword. Common Voice is downloaded from Mozilla Data Collective. + - [sof_mww_split_utterances.py](sof_mww_split_utterances.py): Splits recordings of a repeated keyword into one 48 kHz mono WAV per utterance. Speech is detected from the 100 - 7000 Hz band energy of 20 ms frames, and the room noise before and after each utterance is kept up to `--max-pad` and `--max-pad-after` seconds. Needs `scipy`. + - [sof_mww_anonymize_clips.py](sof_mww_anonymize_clips.py): Copies keyword clips to `