TI - Acoustic Echo Canceller Design
TI - Acoustic Echo Canceller Design
TI - Acoustic Echo Canceller Design
Design Resources
AEC Convergence
COM3:115200baud ± Tera Term VT
End Equipment File
Menu
Edit Setup Control Window Help
40
TMS320C6748 LCDK HELP
SET 35
SHOW
USB-UART Transceiver START
30
ERLE (dB)
STOP
RESTART
USB STATS
QUIT 25
DDR2 DDR
TMS320C6748 20
DSP 15
NAND 10
Flash EMIF McASP Terminal
(Command Line Interface) 5
AIC 0
0 0.5 1 1.5 2 2.5
Time (s)
An IMPORTANT NOTICE at the end of this TI reference design addresses authorized use, intellectual property matters and other
important disclaimers and information.
2 System Description
Figure 1 shows a block diagram of a typical product that employs the AEC.
JTAG Emulator
AIC
Because the AEC is designed for use in hands-free equipment such as speakerphones and intercoms, a
typical design includes a speaker and microphone. The speaker and microphone are connected to one of
the many TI analog interface chips (AICs). The AIC includes a microphone interface and a speaker
amplifier, which eliminates additional circuitry. The AIC has integrated anti-aliasing filters.
The AIC is connected to the TMS320C6748 DSP through the multichannel audio serial port (McASP). The
McASP can support the commonly used I2S interface. The typical design includes the TMS320C6748
DSP and a host processor. In the TMS320C6748 LCDK-based demonstration, a PC emulates a host
processor. The PC is connected to the DSP through a USB-serial interface. When the AEC is used in an
embedded system, a typical host processor can be connected to the DSP through a number of
TMS320C6748 peripherals such as the host port interface (HPI), inter-integrated circuit bus (I2C), or
Ethernet media access controller (EMAC). If an ARM® ARM9™ core is an appropriate host processor, the
designer can choose the OMAP-L138 or OMAP-L132, which include an ARM9 core and a TMS320C674X
core. This additional integration saves cost and board space, and allows for sharing external memory
between the DSP and ARM-9 core.
In this example, a DDR2 is connected to the DDR interface of the DSP, providing external RAM. A NAND
flash memory is connected to the external memory interface (EMIF). The JTAG interface is crucial for
bringing up hardware, developing software, and debugging.
3 Block Diagram
Figure 2 shows the block diagram of the TMS320C6748 DSP processor.
4 Highlighted Products
The C6748 LCDK design is based on the TI TMS320C6748 DSP processor and its associated peripherals
and is the engine of the design. The TMS320C6748 C6000™ DSP processor is a low-power applications
processor based on a C674x DSP core. This processor provides significantly lower power than other
members of the TMS320C6000 platform of DSPs.
The TMS320C6748 processor includes the following features:
• 375- and 456-MHz C674x fixed- and floating-point VLIW DSP
• C674x instruction set features:
– Superset of the C67x+ and C64x+ ISAs
– Up to 3648 MIPS and 2746 MFLOPS
– Byte-addressable capability (8-, 16-, 32-, and 64-bit data)
– 8-bit overflow protection
– Bit field extract, set, clear
– Normalization, saturation, and bit-counting
– Compact 16-bit instructions
• C674x 2-level cache memory architecture:
– 32KB of L1P program RAM/cache
– 32KB of L1D data RAM/cache
– 256KB of L2 unified Mapped RAM/cache
– Flexible RAM/cache partition (L1 and L2)
• Enhanced direct memory access controller 3 (EDMA3):
– 2 channel controllers
– 3 transfer controllers
– 64 independent DMA channels
– 16 quick DMA channels
– Programmable transfer burst size
• TMS320C674x floating-point VLIW DSP core
– Load-store architecture with nonaligned support
– 64 general-purpose registers (32-bit)
– Six ALU (32- and 40-bit) functional units
• 32-bit integer, SP (IEEE single precision/32-bit) and DP (IEEE double precision/64-bit) floating
point
• Up to four SP additions per clock and four DP additions every two clocks
• Up to two floating-point (SP or DP), reciprocal approximation (RCPxP), and square-root
reciprocal approximation (RSQRxP) operations per cycle
– Two multiply functional units:
• Mixed-precision IEEE floating-point multiply supported up to the following:
• 2 SP × SP → SP per clock
• 2 SP × SP → DP every two clocks
• 2 SP × DP → DP every three clocks
• 2 DP × DP → DP every four clocks
• Fixed-point multiply that supports two 32 × 32-bit multiplies, four 16 x 16-bit multiplies, or eight 8
x 8-bit multiplies per clock cycle, and complex multiples
– Instruction packing that reduces code size
– All instructions as conditional
– Hardware support for modulo loop operation
5 System Theory
Whenever using a hands-free device, there are acoustic impairments. The following sections discuss the
impairments and the methods used to combat them.
Conference Room
Noise
Phone
Reverberation
Echo Clean
Speech
Figure 3 shows reverberation in red and blue. A direct path (blue) between the presenter and the
speakerphone and indirect path (red) reflects before reaching the speakerphone. The fan on the right wall
with its signal moving toward the speakerphone shows background noise.
Without acoustic echo cancellation to cancel the echo, dereverberation to mitigate the reverberation, and
noise reduction to reduce the noise, the person at the other end of the phone connection can experience
severely degraded voice quality and intelligibility.
Even a moderate amount of echo can be a serious impairment to voice quality. The degree of the
impairment depends on the loudness of the echo and the delay between the original speech and the
incidence of the echo.
When you speak in an enclosed space, your speech travels directly from your mouth to your ears with
almost no delay. Your speech also reflects off of walls and so forth and you hear a slightly delayed signal.
Multiple reflections occur at different delays. The delay is typically so small that you cannot perceive the
reflections as an echo.
In the case of a voice communication system, the sources of delay follow:
• Network: A network can be the traditional public-switched telephone network (PSTN), the internet (in
the case of voice over IP [VoIP]), or some other type. There is always a finite amount of time for a
speech signal to pass through a network. Longer delays are attributable to propagation delay when
using satellites and packet transmission delay in packet networks.
• Buffering: In a digital system, speech samples may be buffered into frames— each frame is usually the
same duration. Buffering can occur in a software operating system or some other layer of an
embedded software system. Buffering occurs in both directions of transmission.
• Packetization: In the case of a packet-switched network, speech data is sent in bursts that comprise
many frames worth of speech. Each frame contains a segment of speech—each segment is usually of
the same duration. Before sending a packet, all the frames of speech must be collected and
sometimes processed. This process causes a delay.
• Acoustic: Acoustic delay is caused by the finite speed of sound. This delay is typically short for the
direct paths (mouth to microphone and speaker to ears), but the indirect paths through reflections can
be longer.
If the total round-trip delay is short, the echo is imperceptible. If the delay becomes longer, the echo
becomes perceptible. This effect is known as the precedence effect. When a sound and a delayed copy is
heard, the two copies are perceptually linked if the delay is short enough. As the delay increases, a
person becomes more aware of the echo; the echo (and reverberation) must be removed more effectively
to achieve acceptable voice quality.
Hands-Free Equipment
Adaptive
TELR ERL
Filter AIC
NLP ± +
Tx Out Tx In
CNG
NR +
DEREVERB
ERLE
Transmit (Tx) and receive (Rx) are defined with respect to the person (blue) using the hands-free device
that contains the echo canceller. He is speaking into the microphone of the device and listening to the
speaker of the device. His speech is being transmitted to the other party (red) and he is listening to the
signal that is received from the other party. Specifically, the inputs and outputs are defined as follows:
• Tx In (transmit input) is the signal coming from the local microphone.
• Tx Out (transmit output) is the signal transmitted to the person at the other end of the link.
• Rx In (receive input) is the signal that is received from the person at the other end of the link.
• Rx Out (receive output) is the signal that is sent to the local speaker.
Follow the path of the signal path. The signal of the far-end talker is sent through the network (shown as a
cloud in Figure 4) and enters the AEC through the Rx In port. The signal passes through a nonlinear
processor (NLP) that can attenuate the signal somewhat when both parties are speaking (double-talk).
The output of the NLP is sent to the Rx Out port, which is connected to the local speaker and is also sent
to an adaptive filter described later.
An acoustic path exists between the speaker and microphone. The speech of the far-end talker passes
from the Rx Out port (speaker) to the Tx In port (microphone). The loss (gain) between the speaker and
microphone is echo return loss (ERL), which is usually expressed in dB. If the local talker is quiet and
there is no background noise in the room, the Tx In port consists only of echo. This condition is far-end
single talk.
The Tx In port is connected to the adaptive filter. The filter estimates the acoustic echo characteristics and
formulates a filter that estimates the echo, when excited by the Rx Out signal. The echo estimate is
subtracted from the Tx In port to form the residual signal, sometimes called the residual echo signal.
During far-end single-talk, the goal of the adaptive filter is for the residual echo to be zero. Adaptive
filtering techniques are imperfect for the following reasons:
• Near-end speech or background noise interferes with adaptation.
• Approximations are made by the algorithm.
• Computational Precision can result in small numerical errors.
Echo return loss enhancement (ERLE) is the echo attenuation achieved by the adaptive filter. An
important figure of merit for an AEC, ERLE is usually expressed in dB. A higher ERLE translates to a
lower-level echo, which results in less-perceptible echo.
The sum of the ERLE of the adaptive filter and the ERL of the acoustic loss cannot sufficiently remove the
echo. Some NLP must be incorporated to further suppress the echo. Avoid engaging the NLP during
double-talk to avoid making the conversation half-duplex.
A higher ERLE leads to less reliance on NLP. The International Telecommunications Union (ITU)
categorizes hands-free equipment in terms of how much it relies NLP or according to the degree of full-
duplex operation that it can achieve.
There are NLP blocks in both the receive and transmit paths of the block diagram. The transmit NLP does
the majority of the work. Because the perceived echo at the far end is the sum of all losses (receive NLP,
ERL, ERLE, and transmit NLP), some benefit can be gained by applying an NLP in the receive direction.
Noise reduction (NR), comfort noise generation (CNG), and dereverberation are included in the same
block as the NLP. When the NLP activates, it suppresses not only the residual echo but the background
noise returns. When the NLP disengages, the attenuation is removed and the background noise returns.
As a result, the far-end talker hears no background noise each time they speak but the background noise
returns each time they pause. This effect is noise pumping and can be annoying. The CNG replaces the
suppressed noise with artificially generated noise that matches the background noise in level and spectral
characteristics.
Talker echo loudness rating (TELR) is the echo loudness as perceived by the far-end talker. The loudness
is a function of the all the signal processing components of the AEC and by the ERL of the speaker-to-
microphone loss.
6 Performance
Table 1 lists characterization data measured using the TMS320C6748 LCDK with L2 configured as all
(256KB) cache, 300-MHz CPU clock, and 150-MHz DDR2. The AEC was configured at a sampling rate of
16 kHz.
7 Getting Started
7.1 Equipment
To run the demonstration, the following is required:
• The DSP Soundware Algorithm Demonstration Kit
• The TMS320C6748 LCDK
• The Flashburn utility
• An audio source
• An audio listening device (speaker or headphones)
• A PC with USB serial port and terminal program (such as Tera Term)
8 Design Files
This TI Design highlights the audio subsystem on the TMS320C6748 LCDK. Download the design files
including schematics, schematic source, and bill-of-materials for the audio subsystem at
http://www.ti.com/tool/TIDEP0071.
9 References
Texas Instruments E2E Community, http://e2e.ti.com/
Texas Instruments Incorporated ("TI") reference designs are solely intended to assist designers (“Buyers”) who are developing systems that
incorporate TI semiconductor products (also referred to herein as “components”). Buyer understands and agrees that Buyer remains
responsible for using its independent analysis, evaluation and judgment in designing Buyer’s systems and products.
TI reference designs have been created using standard laboratory conditions and engineering practices. TI has not conducted any
testing other than that specifically described in the published documentation for a particular reference design. TI may make
corrections, enhancements, improvements and other changes to its reference designs.
Buyers are authorized to use TI reference designs with the TI component(s) identified in each particular reference design and to modify the
reference design in the development of their end products. HOWEVER, NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL
OR OTHERWISE TO ANY OTHER TI INTELLECTUAL PROPERTY RIGHT, AND NO LICENSE TO ANY THIRD PARTY TECHNOLOGY
OR INTELLECTUAL PROPERTY RIGHT, IS GRANTED HEREIN, including but not limited to any patent right, copyright, mask work right,
or other intellectual property right relating to any combination, machine, or process in which TI components or services are used.
Information published by TI regarding third-party products or services does not constitute a license to use such products or services, or a
warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual
property of the third party, or a license from TI under the patents or other intellectual property of TI.
TI REFERENCE DESIGNS ARE PROVIDED "AS IS". TI MAKES NO WARRANTIES OR REPRESENTATIONS WITH REGARD TO THE
REFERENCE DESIGNS OR USE OF THE REFERENCE DESIGNS, EXPRESS, IMPLIED OR STATUTORY, INCLUDING ACCURACY OR
COMPLETENESS. TI DISCLAIMS ANY WARRANTY OF TITLE AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT, QUIET POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY
INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO TI REFERENCE DESIGNS OR USE THEREOF. TI SHALL NOT BE LIABLE
FOR AND SHALL NOT DEFEND OR INDEMNIFY BUYERS AGAINST ANY THIRD PARTY INFRINGEMENT CLAIM THAT RELATES TO
OR IS BASED ON A COMBINATION OF COMPONENTS PROVIDED IN A TI REFERENCE DESIGN. IN NO EVENT SHALL TI BE
LIABLE FOR ANY ACTUAL, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY
THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN
ANY WAY OUT OF TI REFERENCE DESIGNS OR BUYER’S USE OF TI REFERENCE DESIGNS.
TI reserves the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services per
JESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevant
information before placing orders and should verify that such information is current and complete. All semiconductor products are sold
subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI’s terms
and conditions of sale of semiconductor products. Testing and other quality control techniques for TI components are used to the extent TI
deems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not
necessarily performed.
TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products and
applications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provide
adequate design and operating safeguards.
Reproduction of significant portions of TI information in TI data books, data sheets or reference designs is permissible only if reproduction is
without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for
such altered documentation. Information of third parties may be subject to additional restrictions.
Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements
concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support
that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards that
anticipate dangerous failures, monitor failures and their consequences, lessen the likelihood of dangerous failures and take appropriate
remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components in
Buyer’s safety-critical applications.
In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is to
help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and
requirements. Nonetheless, such components are subject to these terms.
No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties
have executed an agreement specifically governing such use.
Only those TI components that TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use in
military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components that
have not been so designated is solely at Buyer's risk, and Buyer is solely responsible for compliance with all legal and regulatory
requirements in connection with such use.
TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of
non-designated products, TI will not be responsible for any failure to meet ISO/TS16949.IMPORTANT NOTICE
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2016, Texas Instruments Incorporated