AC300030 Microchip Technology, AC300030 Datasheet

KIT ACOUSTIC ACCESSORY

AC300030

Manufacturer Part Number
AC300030
Description
KIT ACOUSTIC ACCESSORY
Manufacturer
Microchip Technology
Datasheets

Specifications of AC300030

Accessory Type
Accessory Kit
Product
Audio Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Noise Suppression/Acoustic Echo Cancellation Library
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
®
dsPIC
DSC Acoustic Echo
Cancellation Library
User’s Guide
© 2011 Microchip Technology Inc.
DS70134E

Related parts for AC300030

AC300030 Summary of contents

Page 1

... Microchip Technology Inc. ® DSC Acoustic Echo Cancellation Library User’s Guide DS70134E ...

Page 2

... PICtail, REAL ICE, rfLAB, Select Mode, Total Endurance, TSHARC, UniWinDriver, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. ...

Page 3

... Library Usage ............................................................................................... 34 4.5 Register Usage ............................................................................................. 35 4.6 Resource Requirements ............................................................................... 36 4.7 Acoustic Echo Cancellation Library API Functions ...................................... 38 4.8 Application Tips ............................................................................................ 60 Index ............................................................................................................................. 61 Worldwide Sales and Service .................................................................................... 62 © 2011 Microchip Technology Inc. ® dsPIC DSC ACOUSTIC ECHO CANCELLATION LIBRARY Table of Contents USER’S GUIDE ...

Page 4

... DSC Acoustic Echo Cancellation Library User’s Guide NOTES: DS70134E-page 4 © 2011 Microchip Technology Inc. ...

Page 5

... Chapter 4. Application Programming Interface (API) how the API functions provided in the dsPIC DSC Acoustic Echo Cancellation Library can be included in your application software via the API. © 2011 Microchip Technology Inc. ® dsPIC DSC ACOUSTIC ECHO CANCELLATION LIBRARY ...

Page 6

... Optional arguments mcc18 [options] file [options] Choice of mutually exclusive errorlevel {0|1} arguments selection Replaces repeated text var_name [, var_name...] Represents code supplied by void main (void) user { ... } © 2011 Microchip Technology Inc. Examples ® IDE User’s Guide ...

Page 7

... For the latest information on using other tools, read the tool-specific Readme files in the Readmes subdirectory of the MPLAB IDE installation directory. The Readme files contain update information and known issues that may not be included in this user’s guide. © 2011 Microchip Technology Inc. Preface DS70134E-page 7 ...

Page 8

... Local sales offices are also available to help customers. A listing of sales offices and locations is included in the back of this document. Technical support is available through the web site at: DS70134E-page 8 ® C compiler; MPASM™ and MPLAB 16-bit http://support.microchip.com © 2011 Microchip Technology Inc. ® ...

Page 9

... Algorithm was consolidated and relocated to the Application Programming Interface (API) chapter. See - The information in the formerly known Resource Requirements chapter was consolidated and relocated to the Application Programming Interface (API) chapter. See © 2011 Microchip Technology Inc. ® DSC Acoustic Echo Cancellation Library Section 2.1 “Installation Procedure”. ...

Page 10

... Additional minor corrections such as language and formatting updates were incorporated throughout the document DS70134E-page 10 Table 2-1 Section 3.3 “Demonstration Procedure” Section 3.4 “Demonstration Code Description” Chapter 4. “Application Programming Interface Section 4.6.4 “Computational Speed” as follows: © 2011 Microchip Technology Inc. ...

Page 11

... FIGURE 1-1: Far-End Speech Near-End Speech FAR-END © 2011 Microchip Technology Inc. ® dsPIC DSC ACOUSTIC ECHO CANCELLATION LIBRARY ACOUSTIC ECHO CANCELLATION IN A SPEECH AND TELEPHONY APPLICATION ...

Page 12

... Demo application source code is provided with the Library • NLP attenuation level can be adjusted to suit application requirements • Acoustic Echo Cancellation adaptation can be force-enabled or disabled by the user application • Run-time control of key algorithm parameters is provided DS70134E-page 12 © 2011 Microchip Technology Inc. ...

Page 13

... The Acoustic Echo Cancellation Library requires a PC-compatible system with these attributes: ® • Intel Pentium • HTML browser • RAM (minimum) • available hard drive space (minimum) ® • Microsoft Windows © 2011 Microchip Technology Inc. ® class or higher processor, or equivalent ® 98, Windows 2000, or Windows XP Introduction DS70134E-page 13 ...

Page 14

... DSC Acoustic Echo Cancellation Library User’s Guide NOTES: DS70134E-page 14 © 2011 Microchip Technology Inc. ...

Page 15

... Insert the library CD into the appropriate drive. The installation screen appears in your HTML browser. FIGURE 2-1: INSTALLATION SCREEN 2. Select Click to Install Files. A file download dialog appears, as shown in Figure 2-2. © 2011 Microchip Technology Inc. ® dsPIC DSC ACOUSTIC ECHO CANCELLATION LIBRARY USER’S GUIDE DS70134E-page 15 ...

Page 16

... Evaluation version. 5. Browse to the saved location and double click the file to start the installation. The installation location dialog appears, which allows you to choose a directory location for the library. FIGURE 2-3: DS70134E-page 16 FILE DOWNLOAD DIALOG INSTALLATION LOCATION DIALOG © 2011 Microchip Technology Inc. ...

Page 17

... Click OK to close the dialog. This completes the Acoustic Echo Cancellation Library installation. The installation process creates the folder named EC v5.0, which contains the files described in Section 2.2 “Acoustic Echo Cancellation Library © 2011 Microchip Technology Inc. PROGRAM LICENSE AGREEMENT INSTALLATION COMPLETE DIALOG Installation Files”. ...

Page 18

... C source file containing code for the UART peripheral. C source file containing the code for the Si3000 Codec. Assembly routines for communicating with the LCD controller. Assembly routines implementing the G.711 library functions. describes the files in this Description © 2011 Microchip Technology Inc. ...

Page 19

... This folder contains a library archive file for the Acoustic Echo Cancellation Library as listed in Table TABLE 2-3: File Name eclibv5_0.a © 2011 Microchip Technology Inc. INCLUDE FILE Include file that contains the interface to the Acoustic Echo Cancellation Library. This file must be included in the application to use the library. 2-3. ...

Page 20

... DSC Acoustic Echo Cancellation Library User’s Guide NOTES: DS70134E-page 20 © 2011 Microchip Technology Inc. ...

Page 21

... This combination of speech and echo can be heard on the headset connected to board 2. In this example, board 1 represents the near-end and board 2 represents the far-end. © 2011 Microchip Technology Inc. ® dsPIC DSC ACOUSTIC ECHO CANCELLATION LIBRARY 3-1 ...

Page 22

... Connect one end of the DB9M-DB9M Null Modem Adapter to PORTB (J5) on board 1. Then, connect one end of the RS-232 cable to the Null Modem Adapter. 7. Connect the other end foot DB9 M/F RS-232 cable to the ‘PORTB’ (J5) port on board 2. FIGURE 3-2: DS70134E-page 22 DEMONSTRATION BOARD SETUP Set J9 to SLAVE © 2011 Microchip Technology Inc. ...

Page 23

... Repeat steps 2 through 7 for the second board. 9. Make sure that the two boards are not located too close to each other to avoid any acoustic coupling between the two boards. The programming status is shown in © 2011 Microchip Technology Inc. AEC Demonstration Figure 3-3. ...

Page 24

... DSC Acoustic Echo Cancellation Library User’s Guide FIGURE 3-4: PROGRAMMING STATUS IN OUTPUT WINDOW DS70134E-page 24 © 2011 Microchip Technology Inc. ...

Page 25

... The amount of nonlinear processing can be increased steps ( dB) by pressing SW3. It can be reduced steps (down to 0 dB) by pressing SW2. The default level for most applications is 18 dB. The Acoustic Echo Cancellation can be reinitialized by pressing SW4. © 2011 Microchip Technology Inc. AEC Demonstration DEMONSTRATION RUN-TIME LCD SCREEN ON BOARD 1 Echo Cancellation ...

Page 26

... In the main loop, the value of applyAEC is read and passed to EC_apply() as the enable flag. If applyAEC is ‘0’, the Acoustic Echo Cancellation is still called, but the input/output buffer is not changed. This enables the Acoustic Echo Cancellation to maintain adaptation to changes in echo path, while it is not enabled. DS70134E-page 26 © 2011 Microchip Technology Inc. ...

Page 27

... Window and select Add files. FIGURE 4-1: 2. Browse to the location of the eclibv5_0.a file (available in the libs folder in the installation directory). 3. Select the file and click Open © 2011 Microchip Technology Inc. ® dsPIC DSC ACOUSTIC ECHO CANCELLATION LIBRARY USER’S GUIDE (Figure 4-2) ...

Page 28

... The library is now added to the application. FIGURE 4-3: To use the library functions, include the file, ec_api.h, in the application source code. This file can be copied from the h folder (located in the installation directory) to the application project folder. DS70134E-page 28 © 2011 Microchip Technology Inc. ...

Page 29

... From the MPLAB IDE menu, select Project>Build Options>Project as shown in Figure 4-4. FIGURE 4-4: 2. Click the MPLAB C30 tab and set the following options: a) From the Categories drop-down list, select Memory Model, as shown in Figure © 2011 Microchip Technology Inc. 4-5. DS70134E-page 29 ...

Page 30

... DSC Acoustic Echo Cancellation Library User’s Guide FIGURE 4- the Data Model section, select Large data model, as shown in DS70134E-page 30 Figure 4-6. © 2011 Microchip Technology Inc. ...

Page 31

... Application Programming Interface (API) FIGURE 4-6: 3. Click Apply, and then click OK. This completes the procedure. © 2011 Microchip Technology Inc. DS70134E-page 31 ...

Page 32

... Nonlinear Processor, and Howling Control. DS70134E-page 32 Nonlinear Processor Howling Control (NLP) Double Talk Detector (DTD OUT ), usually sent to a local speaker OUT ), usually received from a local microphone IN signal not only contains the microphone input (presumably IN © 2011 Microchip Technology Inc. Figure 4-7. S OUT R IN ...

Page 33

... NLP again. The adaptation hangover is controlled by EC_setAdaptionHangover(). The default value for this function is ‘1’, so that adaptation resumes one frame after the end of double talk. © 2011 Microchip Technology Inc. signal ...

Page 34

... 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. DS70134E-page for the actual code required. Example 4-1. © 2011 Microchip Technology Inc. ...

Page 35

... It is suggested that the application explicitly manage PSV oper- ations while using the AEC Library. The application should ensure that PSV access is enabled and that the PSVPAG register contains the required value. © 2011 Microchip Technology Inc. _XBSS(2); /* Step 2 */ _XBSS(2); /* Step 2 */ ...

Page 36

... Total Data Memory DS70134E-page 36 Size (bytes) 6753 2154 8907 Size (bytes) Alignment 2240 2 1504 2 1184 2 160 2 160 2 5248 — © 2011 Microchip Technology Inc. Section .libec .const — Section X data memory X data memory Y data memory data memory data memory — ...

Page 37

... Enabling the Howling control feature requires an additional 8 MIPS. 4.6.5 Data Format The data type of nearEndIn and farEndIn can be 10-, 12- or 16-bit linear PCM data. The AEC algorithm automatically adjusts for the data format used. © 2011 Microchip Technology Inc. Section Function Echo Tail All ...

Page 38

... EC_setInhibitAdaption • EC_getInhibitAdaption • EC_estimateERLE • EC_TRUE • EC_FALSE • EC_FRAME • EC_ECHOTAIL • EC_ORDER • EC_XSTATE_MEM_SIZE_INT • EC_XSCRATCH_MEM_SIZE_INT • EC_YSCRATCH_MEM_SIZE_INT • EC_DOUBLETALKHANGOVERDEFAULT • EC_ADAPTIONHANGOVERDEFAULT • EC_NLPLEVELDEFAULT • EC_HOWLINGCONTROLDEFAULT • EC_FORCEADAPTDEFAULT • EC_ORDERERROR • EC_OK DS70134E-page 38 © 2011 Microchip Technology Inc. ...

Page 39

... EC_init(ecStateMemX, ecScratchX, EC_ORDER); © 2011 Microchip Technology Inc. a pointer to the state memory for this instance of AEC a pointer to an area of scratch memory in X RAM used by the AEC algorithm an integer representing the filter order (EC_ORDER) If the value of EC_ORDER is correct ...

Page 40

... The AEC Algorithm is now using ecScratchX2 for its scratch memory. DS70134E-page 40 a pointer to the state memory for this instance of AEC a pointer to the new X scratch memory to be used by the AEC algorithm [EC_XSTATE_MEM_SIZE_INT] [EC_XSCRATCH_MEM_SIZE_INT] [EC_XSCRATCH_MEM_SIZE_INT] [EC_YSCRATCH_MEM_SIZE_INT] _XBSS(2); _XBSS(2); _XBSS(2); _YBSS(2); © 2011 Microchip Technology Inc. ...

Page 41

... EC_init(ecStateMemX, ecScratchX, EC_ORDER EC_apply(ecStateMemX, ecScratchY, nearEndIn, farEndIn, EC_TRUE); © 2011 Microchip Technology Inc. a pointer to the X memory for this instance of AEC a pointer to an area of scratch memory in Y RAM used by the AEC algorithm a pointer to the near-end speech input (S size EC_FRAME. This buffer can memory a pointer to the far-end speech receive input (R buffer of size EC_FRAME ...

Page 42

... EC_apply(ecStateMemX, ecScratchY, nearEndIn, farEndIn, EC_TRUE); EC_applyNLP(ecStateMemX, nearEndIn, EC_TRUE); DS70134E-page 42 a pointer to the state memory for this instance of AEC a pointer to the input/output buffer of size EC_FRAME a flag to indicate if NLP is required for this buffer (EC_TRUE or EC_FALSE) [EC_YSCRATCH_MEM_SIZE_INT] _YBSS(2); [EC_XSCRATCH_MEM_SIZE_INT] _XBSS(2); _XBSS(2); © 2011 Microchip Technology Inc. ...

Page 43

... NLP level of 18 dB. Code Example EC_setNLPLevel(ecStateMemX, 3); Sets the desired NLP level to 3 for the instance of the algorithm ecStateMemX. © 2011 Microchip Technology Inc. a pointer to the state memory for this instance of AEC an integer value between 0 and 15 representing the desired NLP level ...

Page 44

... The current NLP level as an integer for the instance of the algorithm ecStateMemX. Remarks None. Code Example int nlpLevel; nlpLevel = EC_getNLPLevel(ecStateMemX); nlpLevel contains the current NLP level for the instance of the algorithm ecStateMemX. DS70134E-page 44 a pointer to the state memory for this instance of AEC © 2011 Microchip Technology Inc. ...

Page 45

... Sets the desired double talk hangover to 10 frames (representing 100 ms of data) for the instance of the algorithm ecStateMemX. © 2011 Microchip Technology Inc. a pointer to the state memory for this instance of AEC an integer value from 1 to 100 representing the desired double talk ...

Page 46

... The current double talk detection hangover value. Remarks None. Code Example int doubleTalkHangover; doubleTalkHangover = EC_getDoubleTalkHangover(ecStateMemX); doubleTalkHangover contains the double talk detection hangover value set for the instance of the algorithm ecStateMemX. DS70134E-page 46 a pointer to the state memory for this instance of AEC © 2011 Microchip Technology Inc. ...

Page 47

... Code Example EC_setAdaptionHangover(ecStateMemX, 3); Sets the desired adaptation hangover to 3 frames (representing data) for the instance of the algorithm ecStateMemX. © 2011 Microchip Technology Inc. a pointer to the state memory for this instance of AEC an integer value from 1 to 100 representing the adaptation hangover DS70134E-page 47 ...

Page 48

... The current adaptation hangover value. Remarks None. Code Example int adaptionHangover; adaptionHangover = EC_getAdaptionHangover(ecStateMemX); adaptionHangover contains the adaptation hangover value set for the instance of the algorithm ecStateMemX. DS70134E-page 48 a pointer to the state memory for this instance of AEC © 2011 Microchip Technology Inc. ...

Page 49

... Return Value None. Remarks None. Code Example EC_setHowlingControl(ecStateMemX, EC_TRUE); Enables the howling control for the instance of the algorithm ecStateMemX. © 2011 Microchip Technology Inc. a pointer to the state memory for this instance of AEC (EC_TRUE or EC_FALSE) DS70134E-page 49 ...

Page 50

... Returns the current state of howling control. Remarks None. Code Example int howlingControl; howlingControl = EC_getHowlingControl(ecStateMemX); howlingControl contains the howling control state set for the instance of the algorithm ecStateMemX. DS70134E-page 50 a pointer to the state memory for this instance of AEC © 2011 Microchip Technology Inc. ...

Page 51

... EC_setForceAdapt(int* ptrStateX, int state); Arguments ptrStateX state Return Value None. Remarks None. Code Example EC_setForceAdapt(ecStateMemX, EC_TRUE); Sets forced adaptation for the instance of the algorithm ecStateMemX. © 2011 Microchip Technology Inc. a pointer to the state memory for this instance of AEC either EC_TRUE or EC_FALSE DS70134E-page 51 ...

Page 52

... The current state of forced adaptation. Remarks None. Code Example int forceAdapt; forceAdapt = EC_getForceAdapt(ecStateMemX); forceAdapt contains the forced adaptation value set for the instance of the algorithm ecStateMemX, either EC_TRUE or EC_FALSE. DS70134E-page 52 a pointer to the state memory for this instance of AEC © 2011 Microchip Technology Inc. ...

Page 53

... EC_setInhibitAdaption(int* ptrStateX, int state); Arguments ptrStateX state Return Value None. Remarks None. Code Example EC_setInhibitAdaption(ecStateMemX, EC_TRUE); Prevents adaptation of the instance of the algorithm ecStateMemX. © 2011 Microchip Technology Inc. a pointer to the state memory for this instance of AEC either EC_TRUE or EC_FALSE DS70134E-page 53 ...

Page 54

... Code Example long inhibitAdaption; inhibitAdaption = EC_getInhibitAdaption(ecStateMemX); inhibitAdaption contains the inhibit adaptation value set for the instance of the algorithm ecStateMemX, either EC_TRUE or EC_FALSE. DS70134E-page 54 a pointer to the state memory for this instance of AEC If adaptation is inhibited If adaptation is not inhibited © 2011 Microchip Technology Inc. ...

Page 55

... EC_apply(ecStateMemX, ecScratchY, nearEndIn, farEndIn, EC_TRUE); EC_applyNLP(ecStateMemX, nearEndIn, EC_TRUE); erle = EC_estimateSNR(nearEndBefore, nearEndIn); erle contains the estimate of the ERLE (in dB). © 2011 Microchip Technology Inc. a pointer to the buffer of data before the AEC algorithm has been applied a pointer to the buffer of data after the AEC algorithm has been ...

Page 56

... Used to indicate true to the AEC algorithm. Value 1 EC_FALSE Description Used to indicate false to the AEC algorithm. Value 0 EC_FRAME Description The size of the input buffer processed. Value 80 EC_ECHOTAIL Description The length of the echo tail length required (8, 16, 32 128 ms). Value 64 DS70134E-page 56 © 2011 Microchip Technology Inc. ...

Page 57

... Size in integers of the memory location required for the X-State memory. Value ((EC_ORDER * 2) + 96) EC_XSCRATCH_MEM_SIZE_INT Description Size in integers of the memory location required for the X-Scratch memory. Value (EC_ORDER + (EC_FRAME * 3)) EC_YSCRATCH_MEM_SIZE_INT Description Size in integers of the memory location required for the Y-Scratch memory. Value (EC_ORDER + EC_FRAME) © 2011 Microchip Technology Inc. DS70134E-page 57 ...

Page 58

... Value in frames for the double talk hangover. Value 3 EC_ADAPTIONHANGOVERDEFAULT Description Value in frames for the default adaptation hangover. Value 1 EC_NLPLEVELDEFAULT Description Value of the default NLP attenuation (EC_NLPLEVELDEFAULT * 6 dB). Value 3 EC_HOWLINGCONTROLDEFAULT Description Boolean value of the state of the howling control module. Value EC_FALSE DS70134E-page 58 © 2011 Microchip Technology Inc. ...

Page 59

... Boolean value to enable forced adaptation. Value EC_FALSE EC_ORDERERROR Description Return value from EC_init to indicate that the specified order is not valid. Value 0x8001 EC_OK Description Return value from EC_init to indicate that the specified order is valid. Value 0x0000 © 2011 Microchip Technology Inc. DS70134E-page 59 ...

Page 60

... In such cases, the AEC algorithm can be forced to adapt all the time which may improve the overall system performance. 6. The user application should never inhibit adaptation. This feature is only provided for test and compliance checking purposes. DS70134E-page 60 © 2011 Microchip Technology Inc. ...

Page 61

... EC_YSCRATCH_MEM_SIZE_INT C Customer Notification Service.................................... 8 Customer Support ...................................................... 8 D Demo Code Description ........................................... 26 Demonstration Procedure ........................................ 25 Demonstration Setup ............................................... 22 Demonstration Summary ......................................... 21 Device Support ........................................................ 13 Documentation © 2011 Microchip Technology Inc. ® dsPIC DSC ACOUSTIC ECHO CANCELLATION LIBRARY Index Conventions ........................................................ 6 Layout ................................................................. 5 F FIR Filter .................................................................. 12 H Host System Requirements ..................................... 13 I ...

Page 62

... Philippines - Manila Tel: 63-2-634-9065 Fax: 63-2-634-9069 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan - Hsin Chu Tel: 886-3-6578-300 Fax: 886-3-6578-370 Taiwan - Kaohsiung Tel: 886-7-213-7830 Fax: 886-7-330-9305 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 © 2011 Microchip Technology Inc. 08/04/10 ...

Related keywords