[Speex-dev] echo cancellation

Jean-Marc Valin
Thu, 30 Dec 2004 13:15:55 -0000

Le jeudi 30 d?cembre 2004 ? 21:35 +0100, Alfredo Moreira a ?crit
:
> I'm going to test the echo cancellation...
> but before doing something wrong, i want to know what is the right way
> to use it...

The best I can suggest is to *not* use it... unless you know how to
debug/tune it.

	Jean-Marc

>
-------------------------------------------------------------------------------------
> short * speakerSample; //will contain what the speakers are going to play
> short * microphoneSample; //what the microphone is going to register
> short*  cancelledSample; //the ouput without echo
> int*      cancelledSpectrum; //output cancelled spectrum
>
> //now i assume that i should initialise everything like that:
>
> SpeexEchoState* pechoState = speex_echo_state_init(160,x*160); //do the
> second parameter need to be a multiple of the frame size?
>
AllocBuffers(SpeakerSample,microphoneSample,cancelledSample,cancelledSpectrum);
>
> do{
> captureSpeaker(speakerSample);
> captureMicrophone(microphoneSample);
> speex_echo_cancel(pechoState, microphoneSample, speakerSample,
> cancelledSample, cancelledSpectrum);
> while (!keypressed());
>
>
-------------------------------------------------------------------------------------
>
> so, do i need to deal with the cancelledSpectrum variable to perform
> echo cancellation in a proper way?
> do i need to deal with the delay between the sound being registered by
> the microphone and the one going out of the speakers? (i don't know you
> anderstand what i mean, sorry for my poor english)
> also, there is an echo parameter to the preprocess function : int
> speex_preprocess(SpeexPreprocessState *st, short *x, int *echo);
> do i need to provide to it my cancelledSpectrum variable?
>
> best regards,
> fredo
>
>
>
>

--
Jean-Marc Valin <Jean-Marc.Valin@USherbrooke.ca>
Universit? de Sherbrooke