[Speex-dev] Re: [Iaxclient-devel] iaxclient & speex

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Thu May 3 17:02:31 PDT 2007

>    As you can tell, the AAGC integration with speex was really a classic
> hack.  Instead of re-creating the hack, what's probably best here is to
> integrate AAGC back into speex, and have a proper API.

Agreed here. If you can come up with a clean patch to add that feature,
it's something I'd like to see in Speex.

>    For those of you just tuning in, what I call "AAGC" is an AGC
> implementation where analog gains are manipulated instead, or in
> addition to the AGC within speex (where levels are normalized via
> multiplication).  The benefits of AAGC are:  (1) (most important),
> reducing the analog gain can prevent clipping, which can't be done with
> speex' current AGC, and (2) when raising levels, you get better quality
> by raising the mixer levels, as opposed to just multiplying.

It's a good thing to do, but you need to be really careful when doing
that because:
1) Any change in the analogue gain automatically de-adapts the echo
canceller so you only want to do that when really necessary (e.g.
clipping screws up the EC anyway)
2) The processing chain goes "AEC -> noise suppressor -> AGC", but for
the analog gain, you really want to measure the signal that goes into
the echo cancellation, not at the AGC. Otherwise, you risk increasing
the analog gain to a level that creates clipping before the AEC (even if
the signal at the AGC is lower.

Hmm, or does that mean the analogue AGC is actually completely
independent from the "real" AGC. Any thoughts?

> (1) is really the most important reason.
>    Now, the API I'd envision for this would be one where you could tell
> speex that you would like to use AAGC, and then register some callbacks
> that speex_preprocess() could call to query or set the input or mixer
> level.  Further, a more intellegent implementation within speex could
> consider the requested changes in the rest of the preprocessor chain
> (i.e. it would know that if it asked for a 3dB increase in input gain,
> to expect that input levels would rise by 3dB within a few frames).  The
> hacky implementation I did inside of iaxclient gave speex no such
> information.

This is probably things we'll want to consider one we decide on where to
put the AAGC in the first place.


> -SteveK
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev

More information about the Speex-dev mailing list