2006/11/2, Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>:> > Today I tried speex echo cancellation on my VoIP application running > > on a windows mobile based PDA (OMAP1510 168MHz). The result is > > disappointing: it takes 150-250 ms to do echo cancellation (by calling > > speex_echo_capture() ) for a 20 ms frame! > > Are you by any chance using an insane sampling rate and/or tail length. > Try a sampling rate of 8000 Hz, 128-sample frame size and 1028-sample > tail length.In my appliation, the sampling rate is 8000 Hz, and time stamp is 20ms, doesn't it mean I should initialize echo_state like speex_echo_init_state(160,n*160)?> > > I've defined the FIXED_POINT macro. Is there anyway to do some > > optimization? > > Probably. With the params above, the AEC should be able to run in > real-time on an ARM CPU. > > Jean-Marc > >
>> Are you by any chance using an insane sampling rate and/or tail length. >> Try a sampling rate of 8000 Hz, 128-sample frame size and 1028-sample >> tail length. > In my appliation, the sampling rate is 8000 Hz, and time stamp is > 20ms, doesn't it mean I should initialize echo_state like > speex_echo_init_state(160,n*160)?That's fine -- as long as n is reasonable, let's say in the order of 8. Are you using just the echo canceller or the preprocessor too (try just the echo canceller). Jean-Marc
I did the test on another PDA which runs XScale 416Mhz CPU, the EAC
arithmetic could be done in 1ms, but for the previous PDA (TI OMAP
168Mhz), it take more than 100ms!
Though EAC could run in time on the new PDA, it did no help to cancel
the echo, here is my test scenario:
Init echo_state:
echo_state=speex_echo_state_init(160,1120);
int tmp=8000;
speex_echo_ctl(echo_state,SPEEX_ECHO_SET_SAMPLING_RATE,&tmp);
In playing thread:
receive incoming RTP packet;
decode(encoded_buf,decoded_buf);
speex_echo_playback(echo_state,decoded_buf);
add_in_play_queue(decoded_buf)
In Recording thread
wait for recorded data coming (every 20ms);
short* mic = reinterpret_cast<short*>(recorded_buf);
speex_echo_capture(echo_state,mic,mic,NULL);
decode(recorded_buf,encoded_buf);
add_in_output_queue(encoded_buf);
2006/11/3, Jean-Marc Valin
<jean-marc.valin@usherbrooke.ca>:> >> Are you by any chance using an insane sampling rate and/or tail
length.
> >> Try a sampling rate of 8000 Hz, 128-sample frame size and
1028-sample
> >> tail length.
> > In my appliation, the sampling rate is 8000 Hz, and time stamp is
> > 20ms, doesn't it mean I should initialize echo_state like
> > speex_echo_init_state(160,n*160)?
>
> That's fine -- as long as n is reasonable, let's say in the order
of 8.
> Are you using just the echo canceller or the preprocessor too (try just
> the echo canceller).
>
> Jean-Marc
>