dsPIC ? DSC Acoustic Echo Cancellation Library User’s Guide
4.4
LIBRARY USAGE
The AEC algorithm has been designed to be usable in a re-entrant environment. This
enables the algorithm to process many independent channels of audio, each channel
having its own setting and parameters. The following coding steps need to be
performed to enable use of the AEC library:
1. Set the Echo Tail Length: In the file ec_api.h , set the EC_ECHOTAIL value to
the desired echo tail length. The valid values are 8 ms, 16 ms, 32 ms, 64 ms
and 128 ms. Note that setting an invalid value will cause the EC_init()
function to return a EC_ORDERERROR value. This coding step is shown in
EXAMPLE 4-1:
SETTING THE ECHO TAIL LENGTH
.
.
.
#ifndef __EC_API_H__
#define __EC_API_H__
/* Set the desired echo tail length */
#define EC_ECHOTAIL 64 /* Step 1 */
// Nothing below this line should be changed
#define EC_FRAME 80
#define EC_FALSE 0
#define EC_TRUE 1
.
.
.
Steps 2 through 6 should be performed in the user application. Refer to
Example 4-2 for the actual code required.
2. Allocate the memory for the AEC algorithm state holder: This memory is an
integer array in X memory aligned at an address boundary of 2 bytes. The
EC_XSTATE_MEM_SIZE_INT macro specifies the size of this array. Every audio
channel to be processed will requires it own state holder.
3. Allocate the memory for the AEC algorithm X and Y scratch memories: The
X scratch memory is an integer array in X memory aligned at an address
boundary of 4 bytes. The Y scratch memory is an integer array in Y memory
aligned at an address boundary of 2 bytes. Multiple audio channels can share
the same scratch memories.
Note:
In some dsPIC33E devices, the Y memory is located in the EDS. In
such cases, the Y scratch memory array must be tagged with the
__eds__ keyword and assigned an eds attribute.
4. Initialize the AEC algorithm state for each audio channel: Use the
EC_init() function for initializing the acoustic echo cancellation state for each
audio channel.
5. Apply the AEC to an audio frame: Use the EC_apply() function to perform
echo cancellation on an audio frame. If a frame is not required to be processed
by the AEC algorithm, the function should still be called with the enable
parameter set to EC_FALSE . This will allow the AEC algorithm to continue
adapting to the echo in the audio frame. The audio frame stays unaffected.
6. Use the NLP function: Use the EC_applyNLP() function to suppress residual
echo.
DS70134F-page 36
? 2004-2011 Microchip Technology Inc.
相关PDF资料
ACM-16 CABLE MODULE FR3 16BIT 40-DIP
ACM-2X8 ACTIVE CABLE MODULE DUAL 8 BIT
ACM-8 CABLE MODULE FR3 8BIT 28/32-DIP
ACS9510EVB EVALUATION BOARD FOR ACS9510
ACS9550EVB EVALUATION BOARD FOR ACS9550
ACS9593EVB EVALUATION BOARD FOR ACS9593
AD-CCES-CORP-UNL CORP LICENSE FOR CCES UNLIMITED
AD-UCFS-SPRD PRD LIC UCFS CORE CCES 1 PROD
相关代理商/技术参数
AC300031 制造商:Microchip Technology Inc 功能描述:ACOUSTIC ACCESSORY KIT SPEECH RECOGNITION - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:SPEECH RECOGNIZE KIT ACOUSTIC
AC3000-52 制造商:GE Energy (formerly Lineage Power) 功能描述:Front-End Power Supply 制造商:Lineage Power 功能描述:Front-End Power Supply
AC3000A 制造商:Black Box Corporation 功能描述:HD VIEW TRANSMITTER
AC3000A-R2 制造商:Black Box Corporation 功能描述:HD VIEW TRANSMITTER
AC3000A-R2-W1 制造商:Black Box Corporation 功能描述:1 YEAR WARRANTY FOR AC3000A-R2
AC3000A-R2-W3 制造商:Black Box Corporation 功能描述:3 YEAR WARRANTY FOR AC3000A-R2
AC3000A-W1 制造商:Black Box Corporation 功能描述:1 year warranty for AC3000A
AC3000A-W3 制造商:Black Box Corporation 功能描述:3 year warranty for AC3000A