ESPHome 2026.5.1
Loading...
Searching...
No Matches
preprocessor_settings.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_ESP32
4
5#include <cstdint>
6
8
9// Settings for controlling the spectrogram feature generation by the preprocessor.
10// These must match the settings used when training a particular model.
11// All microWakeWord models have been trained with these specific paramters.
12
13// The number of features the audio preprocessor generates per slice
14static const uint8_t PREPROCESSOR_FEATURE_SIZE = 40;
15// Duration of each slice used as input into the preprocessor
16static const uint8_t FEATURE_DURATION_MS = 30;
17
18static const float FILTERBANK_LOWER_BAND_LIMIT = 125.0;
19static const float FILTERBANK_UPPER_BAND_LIMIT = 7500.0;
20
21static const uint8_t NOISE_REDUCTION_SMOOTHING_BITS = 10;
22static const float NOISE_REDUCTION_EVEN_SMOOTHING = 0.025;
23static const float NOISE_REDUCTION_ODD_SMOOTHING = 0.06;
24static const float NOISE_REDUCTION_MIN_SIGNAL_REMAINING = 0.05;
25
26static const bool PCAN_GAIN_CONTROL_ENABLE_PCAN = true;
27static const float PCAN_GAIN_CONTROL_STRENGTH = 0.95;
28static const float PCAN_GAIN_CONTROL_OFFSET = 80.0;
29static const uint8_t PCAN_GAIN_CONTROL_GAIN_BITS = 21;
30
31static const bool LOG_SCALE_ENABLE_LOG = true;
32static const uint8_t LOG_SCALE_SCALE_SHIFT = 6;
33} // namespace esphome::micro_wake_word
34
35#endif