[Speex-dev] Residual Echo Suppression by the Preprocessor

Coffey, Michael mcoffey at avistar.com
Tue Jun 26 17:27:53 PDT 2007

What is the current status of the residual echo suppressor in the

I ask this because I have occasional problems with the AEC, in which it
fails to cancel echo. I think the problems have to do with samples being
dropped by the audio IO system, which is effectively impossible to
detect and counteract reliably.

A colleague recommended using an echo suppression technique (which he
meant as synonymous with "nonlinear processor" and "loss control"). I
wouldn't want the program to do anything drastic unless it knows that
cancellation is not working.

I'll probably just try it out and see how it works. Still, I figure it's
a good idea to ask what the known problems are, in case there are any.

BTW, just to check my understanding... Do I need only the following
initialization code (along with my already-working code that calls the
AEC and preprocessor) to get the echo suppressor working? (Some
declarations omitted, to save labor.)

    // m_EchoState = speex_echo_state_init( ... );

    // m_PreProc = speex_preprocess_state_init( ... );

        m_PreProc, SPEEX_PREPROCESS_SET_ECHO_STATE, m_EchoState );

    INT32 maxEchoAttenuationDB = -40; //use negative; default is -40
        m_PreProc, PREPROCESS_SET_ECHO_SUPPRESS, &maxEchoAttenuationDB

    INT32 maxNearEndEchoAttenuationDB = -15; //use negative; default is
        & maxNearEndEchoAttenuationDB);

Oh, I've been turning the noise suppressor on, as well, although some of
our users don't like some of the artifacts.

My processing code passes the main output of the echo canceller to the
preprocessor, of course, and also the echo residuals, as the manual
says. I'd assume those residuals are important for the echo suppressor,

        speex_echo_cancel( m_EchoState, &micSamples, &speakerSamples
            , &output, &m_Noise );
        speex_preprocess( m_PreProc, &output, &m_Noise);


More information about the Speex-dev mailing list