[Speex-dev] Acoustic echo cancellation

Mark Pietras mpietras at yahoo.com
Wed Jun 22 07:27:04 PDT 2011

Yeah I tried to do a drop-in replacement for the speex echo stuff as a comparison test but my results were poor... haven't had time to research why yet, I'm guessing I did something wrong.  Perhaps my total lack of understanding of the bands nearendH/outH or what I'm supposed to do with skew (how would I know that?).  It's also not clear I have interfaced at the right layer.  For those interested:



if ( ( echoCancellationState = speex_echo_state_init( stageSamples, 24 * stageSamples ) ) ) {
speex_echo_ctl( (struct SpeexEchoState_*)echoCancellationState, SPEEX_ECHO_SET_SAMPLING_RATE, &samplesPerSecond );
if ( 0 == WebRtcAec_Create( &echoCancellationState ) ) {
WebRtcAec_Init( echoCancellationState, samplesPerSecond, samplesPerSecond );


speex_echo_cancellation( (struct SpeexEchoState_*)echoCancellationState, (const spx_int16_t*)stageProduced, (const spx_int16_t*)playedBuffer->data, (spx_int16_t*)stageProduced );
WebRtcAec_BufferFarend( echoCancellationState, (WebRtc_Word16*)playedBuffer->data, stageBytes / 2 );

// yeah i realize this is completely inefficient but it's just a test and apparently i can't use the same buffer in+out here
unsigned char *c = new unsigned char[stageBytes];
memcpy( c, stageProduced, stageBytes );
WebRtcAec_Process( echoCancellationState, (WebRtc_Word16*)c, 0, (WebRtc_Word16*)stageProduced, 0, stageBytes / 2, 0, 0 );
delete [] c;


speex_echo_state_destroy( (struct SpeexEchoState_*)echoCancellationState );
WebRtcAec_Free( echoCancellationState );
echoCancellationState = 0;

From: Steve Underwood <steveu at coppice.org>
To: Steve Kann <stevek at stevek.com>
Cc: speex-dev at xiph.org
Sent: Wednesday, June 22, 2011 9:08 AM
Subject: Re: [Speex-dev] Acoustic echo cancellation

On 06/22/2011 09:30 AM, Steve Kann wrote:
> Speaking of AEC (thought not quite on topic for this thread),
> Has anyone on this list played with the GIPS code that google just 
> open-sourced? It looks like their AEC also has code to handle 
> differential sample rates, though I haven't really evaluated it 
> thoroughly.
> There is really a lot of code in the drop — basically all of the GIPS 
> DSP stuff (AGC, VAD, Denoise, echo canceller, etc), their transport 
> layer, hardware access (audio/video capture), etc. It's all wrapped up 
> to be part of a javascript API in the browser, but it seems like the 
> individual components are useable without the rest.
> https://sites.google.com/site/webrtc/
> -SteveK
As I said last week on this very list.... yes.


Speex-dev mailing list
Speex-dev at xiph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20110622/0b96023c/attachment-0001.htm 

More information about the Speex-dev mailing list