Experimental (do not merge) - gain tuning for mWW microhone#410
Experimental (do not merge) - gain tuning for mWW microhone#410
Conversation
|
Firmware built successfully! 🎉 Download and extract the firmware to install with https://web.esphome.io Make sure to choose |
|
Firmware built successfully! 🎉 Download and extract the firmware to install with https://web.esphome.io Make sure to choose |
|
I've been testing it for a few days. I haven't had to tweak the target RMS value so far. I see that the gain is adjusted (when the radio is on it is at 2, when it is quiet it is at 6) but I haven't noticed any improvement of the wake word detection. To be honest it was already working well for me before this PR. But at least I can contribute that this change does not make things worse. I use "okay Nabu" and have sensitivy on "slightly sensitive" (old default). |
|
I have disabled it again. Detection rates got worse when I upped the threshold. I could not find a setting where it worked better than without it. |
|
Can this be rebased onto the lastest branch? Is there still value in experimenting with this FW? |
This is an experimental firmware for testing purposes only, do not merge!
The audio fed into microWakeWord does not use the XMOS's Automatic Gain Control (AGC) algorithm as it interferes with mWW's own autogain. mWW's autogain works only on short timescales, but it does seem beneficial for wake word accuracy to increase the gain of the incoming audio on longer timescales.
This experimental firmware attempts to find the noise floor of the room by comparing the peak and RMS sound levels. If they are close enough, then we assume the RMS value is the noise floor. This PR attempts to tune the gain factor, in the long term, so that the RMS value matches the target RMS level. This is meant to be a slow tuning effect, so it won't rapidly change or even change at all while there are loud noises in the room. It should settle near the target RMS level once the sound levels are stable for long periods of time. Note that it will log gain factor adjustments in case you are monitoring them.
This exposes 4 new entities in Home Assistant: a switch enabling or disabling the new algorithm, a number entity allowing you to configure the target RMS level, and two sensors reporting the peak and RMS sound levels for the mWW audio.
For anyone testing this firmware, we are interested in the following questions (though other observations are also encouraged!):