The dsPIC DSC Line Echo Cancellation (LEC) Library is compatible with the ITU-T G.168 standard. It provides a function to eliminate echo generated in telephone or digital network components such as telephone hybrids.
Typically echoes are the result of signal reflections caused by impedance mismatch in telephone hybrids and other network components. This “far-end” line echo results in a perceptible and distracting echo effect at the near end.
Line echo cancellation is applicable in telephony applications that involve transmitting and receiving signals through a telephone hybrid. It is also useful for digital network applications such as telephony and voice-over-internet protocol. Although the dsPIC DSC Line Echo Cancellation Library is targeted to eliminate far-end echo, the library function are equally applicable to eliminate near end echo.
Line echo cancellation is especially suitable for applications such as:
- Hands-free Cell Phone Kits
- Speaker Phones
- Intercoms
- Teleconferencing Systems
- Voice-over-internet Protocol
Description
The Line Echo Cancellation (LEC) Library is written almost entirely in assembly language and is highly optimized to make extensive use of the dsPIC DSC device instruction set and advanced addressing modes. The algorithm avoids data overflow. The LEC Library provides an LEC_init function for initializing the various data structures required by the algorithm and an LEC_apply function to remove the line echo component from a 10 ms block of sampled 16-bit speech data. You can easily call both functions through a well-documented Application Programmer’s Interface.
The Line Echo Cancellation algorithm is primarily a Time Domain algorithm. The received near -end speech samples (typically received from a microphone) are filtered using an adaptive Finite Impulse Response (FIR) filter, and then subtracted from the far-end input speech signal. The coefficients of this filter are adapted using the Normalized Least Mean Square (NLMS) algorithm, such that the filter closely models the line echo path between the far-end speaker and the far-end microphone (i.e., the path traversed by the echo). A Nonlinear Processor (NLP) algorithm is available to eliminate residual echo.
Features
Key features of the AEC Library include the following:
• Simple user interface – only one library file and one header file
• All functions can be called from a C application program
• Compatible with the Microchip C30 Compiler, Assembler and Linker
• Highly optimized assembly code that uses DSP instructions and advanced addressing modes
• Line echo cancellation for 16, 32, 64 or 128 ms echo delays or “tail lengths” (configurable)
• dsPIC30F support for 16 and 32 msec tail lengths (separate library archive)
• Compatible with G.168 specifications for in-car applications
• Audio Bandwidth: 0 to 4 kHz at 8 kHz sampling rate
• Convergence Rate: Up to 60 dB/sec., typically greater than 30 dB/sec
• Acoustic Echo Cancellation: Up to 70 dB, typically > 40 dB
• Can be used together with the Noise Suppression (NS) Library
• Demo application source code is provided with the Library
• Can be instantiated multiple times to support multiple input audio streams.
• NLP attenuation level can be adjusted to suit application requirements
• Line Echo Cancellation adaptation can be force-enabled or disabled by the user application
• Tone detection for disabling LEC during test or measurement processes.
• Run-time control of key algorithm parameters is provided