Jean-Marc Valin wrote:>> I've had a small case with noise suppression and AGC. I have a fairly >> noisy environment here, and with the default parameters, noise >> suppression works fairly well while I talk. However, when I shut up, AGC >> starts slowly increasing the gain until it has amplified whatever noise >> is left to levels about equal to having no filtering at all. As soon as >> I talk, AGC backs down fairly quick and the noise is again gone. > > Are you using 1.2beta2? There's been lots of changes in both noise > suppression and AGC since 1.2beta1. So make sure you use 1.2beta2 if > that's not already the case. > >> Decreasing the AGC max gain and increasing the ammount of noise >> suppression fixed things, but it might be an idea to change the defaults >> slightly? > > It's actually possible to make noise suppression more aggressive, with a > price in quality. But in the end, it's mainly a matter of making sure > the AGC does the right thing. After you speak, does the level of the > noise start going up again? >Ah, apologies, I should have mentioned that. This is against current SVN (rev 12997), built on Win32 with mingw gcc 3.4.5 using SSE. Yes, after I stop speaking, the noise slowly starts climbing again, and if I peek at st->agc_gain, that's slowly climbing too. I think part of the trouble is that the noise in here isn't uniform white noise; there's traffic outside the window and people walking in the hallway outside my door. Each little event is enough to cause the AGC to increase a little bit. If I understood the math behind this, the default noise suppression is -15 dB and the default max gain is *30, which should be.. uh. 29 dB? Anyway, the point being that the max gain is allowed to amplify more than the noise suppression is allowed to suppress. Alternately, perhaps it could be made so that noise suppression scales with agc_gain? (IE, if you're multiplying by 10 for the gain, multiply noise reduction by 10 as well). Although I haven't tested, I imagine a similar case could exist for echo suppression.
> Yes, after I stop speaking, the noise slowly starts climbing again, and > if I peek at st->agc_gain, that's slowly climbing too. I think part of > the trouble is that the noise in here isn't uniform white noise; there's > traffic outside the window and people walking in the hallway outside my > door. Each little event is enough to cause the AGC to increase a little > bit.Hmm, I guess it's sort of the expected behaviour. It's pretty hard for the AGC to know whether these "events" are desirable or not and whether it should adapt to them.> If I understood the math behind this, the default noise suppression is > -15 dB and the default max gain is *30, which should be.. uh. 29 dB? > Anyway, the point being that the max gain is allowed to amplify more > than the noise suppression is allowed to suppress.No, that's not the problem. The problem is only with the AGC's adaptation, not the max gain.> Alternately, perhaps it could be made so that noise suppression scales > with agc_gain? (IE, if you're multiplying by 10 for the gain, multiply > noise reduction by 10 as well).Well, you can always force the values yourself. Look for SPEEX_PREPROCESS_SET_NOISE_SUPPRESS and SPEEX_PREPROCESS_SET_AGC_MAX_GAIN Both are in dB (integer)> Although I haven't tested, I imagine a similar case could exist for echo > suppression.Echo suppression is also tricky and depends on having a bit of foreground speech as well. Jean-Marc
>> Yes, after I stop speaking, the noise slowly starts climbing again, and >> if I peek at st->agc_gain, that's slowly climbing too. I think part of >> the trouble is that the noise in here isn't uniform white noise; there's >> traffic outside the window and people walking in the hallway outside my >> door. Each little event is enough to cause the AGC to increase a little >> bit. > > Hmm, I guess it's sort of the expected behaviour. It's pretty hard for > the AGC to know whether these "events" are desirable or not and whether > it should adapt to them.Aye. I have some silent hope that some day a perfect VAD will arrive, and then that could be used to adapt the AGC :)>> Alternately, perhaps it could be made so that noise suppression scales >> with agc_gain? (IE, if you're multiplying by 10 for the gain, multiply >> noise reduction by 10 as well). > > Well, you can always force the values yourself. Look for > SPEEX_PREPROCESS_SET_NOISE_SUPPRESS > and > SPEEX_PREPROCESS_SET_AGC_MAX_GAIN > Both are in dB (integer)I did that (set noise suppress to -30 and the max gain to 15), and that fixes the problem for me. But as this seems to be a fairly common environment, I thought perhaps it would make sense to tune the defaults slightly.