ex

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

SpeexEchoState: Acoustic echo canceller

SpeexEchoState: Acoustic echo canceller

This is the acoustic echo canceller module. More...

Data Structures

class  SpeexEchoState
 This holds the state of the echo canceller. More...

Typedefs

typedef struct SpeexEchoState_ SpeexEchoState
 Internal echo canceller state.

Functions

SpeexEchoStatespeex_echo_state_init (int frame_size, int filter_length)
 Creates a new echo canceller state.
void speex_echo_state_destroy (SpeexEchoState *st)
 Destroys an echo canceller state.
void speex_echo_cancellation (SpeexEchoState *st, const spx_int16_t *rec, const spx_int16_t *play, spx_int16_t *out)
 Performs echo cancellation a frame, based on the audio sent to the speaker (no delay is added to playback ni this form)
void speex_echo_cancel (SpeexEchoState *st, const spx_int16_t *rec, const spx_int16_t *play, spx_int16_t *out, spx_int32_t *Yout)
 Performs echo cancellation a frame (deprecated)
void speex_echo_capture (SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t *out)
 Perform echo cancellation using internal playback buffer, which is delayed by two frames to account for the delay introduced by most soundcards (but it could be off!)
void speex_echo_playback (SpeexEchoState *st, const spx_int16_t *play)
 Let the echo canceller know that a frame was just queued to the soundcard.
void speex_echo_state_reset (SpeexEchoState *st)
 Reset the echo canceller to its original state.
int speex_echo_ctl (SpeexEchoState *st, int request, void *ptr)
 Used like the ioctl function to control the echo canceller parameters.

Detailed Description

This is the acoustic echo canceller module.


Typedef Documentation

typedef struct SpeexEchoState_ SpeexEchoState

Internal echo canceller state.

Should never be accessed directly.

Definition at line 62 of file speex_echo.h.


Function Documentation

void speex_echo_cancel ( SpeexEchoState st,
const spx_int16_t *  rec,
const spx_int16_t *  play,
spx_int16_t *  out,
spx_int32_t *  Yout 
)

Performs echo cancellation a frame (deprecated)

void speex_echo_cancellation ( SpeexEchoState st,
const spx_int16_t *  rec,
const spx_int16_t *  play,
spx_int16_t *  out 
)

Performs echo cancellation a frame, based on the audio sent to the speaker (no delay is added to playback ni this form)

Parameters:
stEcho canceller state
recsignal from the microphone (near end + far end echo)
playSignal played to the speaker (received from far end)
outReturns near-end signal with echo removed
void speex_echo_capture ( SpeexEchoState st,
const spx_int16_t *  rec,
spx_int16_t *  out 
)

Perform echo cancellation using internal playback buffer, which is delayed by two frames to account for the delay introduced by most soundcards (but it could be off!)

Parameters:
stEcho canceller state
recsignal from the microphone (near end + far end echo)
outReturns near-end signal with echo removed
int speex_echo_ctl ( SpeexEchoState st,
int  request,
void *  ptr 
)

Used like the ioctl function to control the echo canceller parameters.

Parameters:
stEcho canceller state
requestioctl-type request (one of the SPEEX_ECHO_* macros)
ptrData exchanged to-from function
Returns:
0 if no error, -1 if request in unknown
void speex_echo_playback ( SpeexEchoState st,
const spx_int16_t *  play 
)

Let the echo canceller know that a frame was just queued to the soundcard.

Parameters:
stEcho canceller state
playSignal played to the speaker (received from far end)
void speex_echo_state_destroy ( SpeexEchoState st )

Destroys an echo canceller state.

Parameters:
stEcho canceller state
SpeexEchoState* speex_echo_state_init ( int  frame_size,
int  filter_length 
)

Creates a new echo canceller state.

Parameters:
frame_sizeNumber of samples to process at one time (should correspond to 10-20 ms)
filter_lengthNumber of samples of echo to cancel (should generally correspond to 100-500 ms)
Returns:
Newly-created echo canceller state
void speex_echo_state_reset ( SpeexEchoState st )

Reset the echo canceller to its original state.

Parameters:
stEcho canceller state