Home

Embedded SDK (Software Development Kit)

image

Contents

1. Flags 0 pClonfig gt EchoSpan 320 Statically Create the instance of G 168 res gl68Init pG168 pConfig MOTOROLA G 168 Library Interfaces 3 13 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Library Interfaces Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 3 3 3 g168Process Call s Result gl68Process 9168 sHandle pG168 Int16 pSamples Rin Int16 pSamples Sin Int16 pSamples Sout UInt16 NumSamples Required Header 68 h Arguments Table 3 3 g168Process Arguments pG168 in Handle to an instance of G 168 pSamples Rin in Pointer to the user data reference signal to be used by the G 168 algorithm pSamples Sin in Pointer to the user data for the send path signal echo of reference signal far end speech for echo cancellation by the G 168 algorithm pSamples Sout out Pointer to the array of the echo canceller output data NumSamples n The number of data words to be processed Description The g 68Process function will process the samples and cancel the echo from the data supplied by pSamples Sin The processed output is stored in the array pointed by pSamples Sout The user can call the g 66Process function any number of times as long as there is data Returns Upon successful completion g 68Process will return PASS if any error occurred gl66Process will re
2. help tutorials Bold Italic Directory name project name and contains these core directories applications contains applications software CodeWarrior project 3des mcp is Blue Text Linkable on line efer to Chapter 7 License Number Any number is considered a 3V positive value unless preceded 10 by a minus symbol to signify a i negative value DES ALL CAPITAL Variables directives defined INCLUDE DSPFUNC LETTERS constants files libraries define INCLUDE STACK CHECK ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Brackets Function keys by pressing function key F7 Quotation marks Returned messages the message Test Passed is displayed H unsuccessful for any reason it will return NULL Definitions Acronyms and Abbreviations The following list defines the acronyms and abbreviations used in this document As this template develops this list will be generated from the document As we develop more group resources these acronyms will be easily defined from a common acronym dictionary Please note that while the acronyms are in solid caps terms in the definition should be initial capped ONLY IF they are trademarked names or proper nouns DSP FFT FIR HRL Digital Signal Processor or Digital Signal Processing Fast Fourier Transforms Finite Impulse Response Hold Release logic G 168 Line Echo Canceller Library For More Information
3. 4 3 5 3 6 3 7 5 1 C Header File glos Ii osssseussbsesusrisAqerberbgaxRuu 444i mom LI EE se OF the 2168Create EE r o IH CO CR RH RC Use of gl68Init Interes b EE E dE AA Use of dl ian 4 o Gi e bereed Use of the gI63Control Interface aEA ENNER EE EE ENEE AR A Use of 10 8Destroy Jee Lis deh paco so Eeer Kg ea mee File a eege SEENEN ER List of Examples For More Information On This Product Go to www freescale com vil Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 viii Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 About This Document This manual describes the G 168 Line Echo Canceller algorithm for use with Motorola s Embedded Software Development Kit SDK Audience This document targets software developers implementing echo cancellation functions within software applications Organization This manual is arranged in the following sections e Chapter 1 Introduction provides a brief overview of this document e Chapter 2 Directory Structure provides a description of the required core directories e Chapter 3 G 168 Library Interfaces describes all of the G 168 Library functions e Chapter 4 Building t
4. G 168 previously known as the CCITT Recommendation Echo cancellers are voice operated devices placed in the four wire portion of the circuit and reduce the echo by subtracting the echo estimate from the circuit echo In this usage the echo cancellers are assumed to be half echo cancellers i e those in which cancellation takes place only in the circuit s send path due to signals present in the receive path MOTOROLA Introduction 1 1 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 1 2 1 Background Introduction Electrical echo cancellers are widely used in full duplex modems in which the transmit signal and the receive signal are sent over the same pair of telephone wires A hybrid unit is required to convert four wire communication into two wire communications and vice versa These hybrid units are located in the tele phone sets as well as at various telephone exchanges Because of the non stationary nature of various communication links the hybrids cannot be perfectly tuned using hardware adjustments Thus a part of the received signal is reflected as echo known as the electrical echo Electrical echo cancellers are designed to remove this echo from the transmitted signal and are categorized into near end echo cancellers and far end echo cancellers Echo canceller is an adaptive FIR
5. PC xi RLS xi 1 2 SDK xi SP xi SPI xi SR xi SRC xi T TD xi telephony 2 2 algorithms 2 3 test g165 2 3 Index For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Motorola reserves the right to make changes without further notice to any products herein Motorola makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Motorola assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters which may be provided in Motorola data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including Typicals must be validated for each customer application b
6. Targets Library aw B e File Code Data N mE ASM Sources AE 3X 5 M FH C Sources A2 i g 47 files K XK 7 Figure 4 2 g168 mcp Project Step 2 Execute the build by pressing function key F7 or by choosing the Make command from the Project menu see Figure 4 3 Metrowerks CodeWarrior File Edit Search SEA Debug DSP55800 Window Help Add TOC Add Files Create New Group heck syntar ils Prepracess Library Precompile v Eis Fuck ot Fey Gg ASM Sourc Disassemble HQC Sources Bring Up To Date Stop Bula tl Break Remove Object Code Ctrl Re search for files 4 files Reset project entry paths Synchronize Modification Dates Enable Debugger Figure 4 3 Execute Make At this point if the build is successful a g168 lib library file is created in the nos telephony g168 Debug directory 4 2 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Chapter 5 Linking Applications with the G 168 Library 5 1 G 168 Library The G 168 library should be called after setting the reguired EchoSpan and Flags and may be configured before calling the g 68 nit function for details on the G 168 interface see Chapter 3 The library also consists of APIs which provide an interface between t
7. This project and all the necessary components to build the G 168 library are located in the wosVelephonyM168 directory of the SDK directory structure There are two methods to execute a system library project build dependency build and direct build 4 1 1 Dependency Build Dependency build is the easiest approach and requires no additional work on the user s part If you add the G 168 library project g168 mcp to your application project as shown in Figure 4 1 the G 168 library will automatically build when the application is built m My Example mcp OP E Link Order Targets 39 application x M g 3 Dependencies 0 Dee P E w HA SDK Configuration 0 Oe D BEA SDK Projects D De m D bsp mep n a rae D CB aieo Wa wa E W tools mcp n a nae E e HA SDK Libs D Oe zu e BOMSL 0 0 PR C C Sources j D D Di E he 13 files 0 Hii Figure 4 1 Dependency Build for the G 168 Library MOTOROLA Building the G 168 Library 4 1 For More Information On This Product Go to www freescale com d Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Building the G 168 Library eescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 4 1 2 Direct Build Direct build allows you to build a G 168 Line Echo Canceller library independently of any other build Follow these steps Step 1 Open g168 mcp project as shown in Figure 4 2 m q158 mcp Link Order
8. an input to the function but the same parameter is also an output from the function Typically inout parameters are input pointer variables in which the caller passes the address of a preallocated data structure to a function The function stores its results within that data structure The actual value of the inout pointer parameter is not changed MOTOROLA G 168 Library Interfaces 3 7 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G68 Library Interfaces Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 3 3 1 g168Create Call s 9168 sHandle gl68Create 9168 sConfigure pConfig Required Header 68 h Arguments Table 3 1 g168Create Arguments pConfig in Points to the configuration data for G 168 Description The g 68Create function creates an instance of the G 168 The pConfig argument points to the g 68_sConfigure structure which configures the G 168 operation for additional information see gl68Init Section 3 3 2 Multiple instances are possible During the g 68Create call any dynamic resources required by the G 168 algorithm are allocated each call of g 68Create allocates 282 3 EchoSpan EchoSpan number of filter taps at SKHz sampling words of data memory The library allocates dynamic memory using the mem library routines shown in Code Example 3 2 Code Example 3 2 mem Library include mem h inc
9. either source code form Source or object code form Object cumulatively hereinafter Software is provided under a license agreement Agreement as described herein Any use of the Software including copying modifying or installing the Software so that it is usable by or accessible by a central processing unit constitutes acceptance of the terms of the Agreement by the person or persons making such use or if employed the employer thereof Licensee and if employed the person s making such use hereby warrants that they have the authority of their employer to enter this license agreement If Licensee does not agree with and accept the terms of this Agreement Licensee must return or destroy any media containing the Software or materials related thereto and destroy all copies of the Software The Software is licensed to Licensee by Motorola Incorporated Motorola for use under the terms of this Agreement Motorola retains ownership of the Software Motorola grants only the rights specifically granted in this Agreement and grants no other rights Title to the Software all copies thereof and all rights therein including all rights in any intellectual property including patents copyrights and trade secrets applicable thereto shall remain vested in Motorola For the Source Motorola grants Licensee a personal non exclusive non assignable revocable royalty free right to use copy and make derivatives of the Source solely in a deve
10. to Motorola s Family of Digital Signal Processors DSPs This document describes the G 168 Echo Canceller Library which is a part of Motorola s comprehensive Embedded Software Development Kit SDK for its DSPs In this manual you will find all the information reguired to use and maintain the G 168 Echo Canceller Library interface and algorithms Motorola provides these algorithms to you for use on Motorola DSPs to expedite your application develop ment and reduce the time it takes to bring your own products to market Motorola s G 168 Echo Canceller Library is licensed for your use on Motorola processors Please refer to the standard Software License Agreement in Chapter 7 for license terms and conditions please consult with your Motorola representatie for premium product licensing 1 1 Quick Start Motorola s Embedded SDK is targeted to a large variety of hardware platforms To take full advantage of a particular hardware platform use Quick Start from the appropriate Targeting DSP568xx Platform docu mentation For example the Targeting DSP56824 Platform manual provides more specific information and exam ples about this hardware architecture If you are developing an application for an DSP56824EVM board or any other DSP56824 development system refer to the Targeting DSP56824 Platform manual for Quick Start or other DSP56824 specific information 1 2 Overview of G 168 G 168 based echo cancellers conform to the ITU T Recommendation
11. tools Figure 2 1 Core Directories In this example the DSP56824EVM has no operating system nos support This platform contains the following core directories applications contains applications software that can be exercised on this platform e bsp contains board support package specific for this platform config contains default hardware and software configurations for this platform include contains SDK header files which define the Application Programming Interface e Sys contains required system components tools contains utilities used by system components Also there are some optional directories that include domain specific libraries MOTOROLA Directory Structure 2 1 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 2 2 Optional Domain Specific Directories Figure 2 2 demonstrates how the G 168 algorithm is encapsulated in the domain specific directories under the directory telephony Directory Structure Egg src H dsp55803evm H dsp56805evm E dsp56824evm Egg nos A applications a bsp 3 buildall Data E config 3 include E modem E security A signal a sys A telephony A caller id Ca dtmf det 9 9168 A telephony Data tools W Ee De H E Figure 2 2 DS
12. 1 5 2 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 F Xdata start addr in RAM G 168 Library Memory layout data for SDK INCLUDE_MEMORY mem h support FmemEXbit WRITEH EX BIT FmemNumIMpartitions WRITEH NUM IM PARTITIONS FmemNumEMpartitions WRITEH _NUM_EM PARTITIONS FmemIMpartitionList WRITEH ADDR im1 WRITEH SIZEOF iml 2 WRITEH ADDR im2 WRITEH SIZEOF im2 2 FmemEMpartitionList WRITEH ADDR em WRITEH SIZEOF em 2 data sections data fp state data rtlib data G 168 external data starts here EC_CONST data TD CONST data HRL CONST data G 168 external data ends here F Xdata ROMtoRAM length 0 F bss start addr BSS ADDR rtlib bss lo bss HE G 168 external data starts here EC CONST bss TD CONST bss HRL CONST bss G 168 external data ends here MOTOROLA Linking Applications with the G 168 Library 5 3 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Linking Ap
13. 10 4 C temp registrs in CodeWarrior iml RW ORIGIN 0x0040 LENGTH 0x07CO data 1 rom R ORIGIN 0x0800 LENGTH 0x0800 internal data ROM im2 RW ORIGIN 0x1000 LENGTH 0x0600 data 2 hole R ORIGIN 0x1600 LENGTH 0x0A00 hole data RW ORIGIN 0x2000 LENGTH 0xC000 data segment em RW ORIGIN OxE000 LENGTH 0x1000 data 3 stack RW ORIGIN OxF000 LENGTH 0x0F80 stack onchipl RW ORIGIN OxFF80 LENGTH 0x0040 on chip peripheral register onchip2 RW ORIGIN OxFFCO LENGTH 0x0040 on chip peripheral registers FORCE_ACTIVE FconfigInterruptVector SECTIONS Data X Memory Layout EX BIT 0 Internal Memory Partitions for mem h partitions NUM IM PARTITIONS 2 iml and im2 External Memory Partition for mem h partitions NUM EM PARTITIONS 1 em main application code text sections config c MUST be placed first otherwise the Interrupt Vector configInterruptVector will not be located at the correct address P 0x0000 config c text text rtlib text fp engine text user text gt pram main application data Define variables for C initialization code F_Xdata_start_addr_in_ROM ADDR rom SIZEOF rom 2 F_StackAddr ADDR stack F_StackEndAddr ADDR stack SIZEOF stack 2
14. 447 JAPAN Motorola Japan Ltd SPS Technical Information Center 3 20 1 Minami Azabu Minato ku Tokyo 106 8573 Japan 81 3 3440 3569 ASIA PACIFIC Motorola Semiconductors H K Ltd Silicon Harbour Centre 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 852 26668334 Technical Information Center 1 800 521 6274 HOME PAGE http www motorola com semiconductors MOTOROLA For More Information On This Product SDK132 D Go to www freescale com
15. EENABLE CONVERGENCE 8 ok k k kok k kok k kok k kok k Koko ko ke ke ke ek Function Prototypes Kk kk Ck k ck X kk kok ck kok ckok ck kok ke ke ke x EXPORT g168 sHandle gl68Create 9168 sConfigure pConfig EXPORT Result gl68Init g168 sHandle pG168 MOTOROLA G 168 Library Interfaces 3 5 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Library Interfaces Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 g168 sConfigure pConfig EXPORT Result gl68Process 9168 sHandle pG168 Int16 pSamples Rin Int16 pSamples Sin Int16 pSamples Sout UInt16 NumSamples EXPORT UWordl6 gl68Control 9168 sHandle pG168 UInt16 Command EXPORT void gl68Destroy g168 sHandle pG168 endif 3 6 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 3 3 Specifications Specifications The following pages describe the G 168 library functions Function arguments for each routine are described as in out or inout An in argument means that the parameter value is an input only to the function An out argument means that the parameter value is an output only from the function An inout argument means that a parameter value is
16. Freescale Semiconductor Inc MOTOROLA _ Embedded SDK Software Development Kit G 168 Line Echo Canceller Library SDK132 D Rev 1 07 19 2002 ef LA MOTOROLA ot Motorola Inc 2002 All rights reserved intelligence everywhere 3 digitaldna For More Information On This Product o to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Contents About This Document ANDE L 4234 49983 ee eee ee ee eee ree ee ee E ee ee ee 1X A P R R O PO e O R O SS 1X Suggested Bandi lt lt skduikuadk skkaiak k de eae ceeds brip REA RR EA 1X TDM ODE o onde ave dak rie E X Definitions Acronyms and Abbreviations 2 44240620ds2ceaserasreeaoen ds X o 0 R Pe XI Chapter 1 Introduction 1 1 ANT P E E EE O O de 3k edo dex eod 1 1 12 A sigo OR ge o EN k Ad E ko S es 1 1 1 2 1 EA E eg ENER E rid 1 2 122 We Oe Banco ON csi Var dd xr edid Cio Ord RU O RUN 1 2 Chapter 2 Directory Structure 2 1 Required Core Directories qa2sensyAmas4Adn pIqP RE ER sd EE RE S k n did 2 1 2 4 Optional Domain Specific Directories iisssesoetksuth eda vay rry us 2 2 Chapter 3 G 168 Library Interfaces 3 1 CIOE SON OK o oq e RE 3 1 3 2 M ee de eee k d
17. HRLtoneHigh Int16 AvgHRLtoneLow Int16 AvgHRLnoiseHigh Int16 AvgHRLnoiseLow Int16 HRLfrmFull Intl6 ReleaseFlag Int16 ReleaseCount 3 4 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 FrameCount PrevKmax PrevToneChange BufA BufPtr FrameBufPtr Temp 4 Interface In In In In In In OV OV OV OV a On a CT T Ut V It O EK In UInt16 SkipCount ECDataStruct This structure has to be initialized by the user before calling the gl68Create function typedef struct UInt16 Flags takes the values from defines described above UInt16 EchoSpan Refer to the user document for more details g168 sConfigure This is a handle for G168 instance User should not alter any member of the structure as it is maintained by G168 library typedef struct UInt16 Flags ECDataStruct EchoCancellerData Jg168 sHandle KOR KKK kok k kok k kok k kok Koko k kok k kok ck k kc k k kok k kck ck kok oko Commands for G 168 Control OKCKCKCKCKCkCk KCk kCk Ck kCk Koko Ck kok k k kc k kck kk kok kok kok kok sk ke ke xe define G168 INHIBIT CONVERGENCE 2 define G168 RESET COEFFICIENTS 4 define G168 R
18. On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 ro Input Output IDE Integrated Development Environment IIR Infinite Impulse Response LMS Least Mean Square LSB Least Significant Bit MAC Multiply Accumulate MIPS Million Instructions Per Second MSB Most Significant Bit NLMS Normalized Least Mean Square OnCE On Chip Emulation OMR Operating Mode Register PC Personal Computer RLS Recursive Least Squares SDK Software Development Kit SP Stack Pointer SPI Serial Peripheral Interface SR Status Register SRC Source TD Tone Disabler References The following sources were used to produce this book 1 DSP56800 Family Manual DSP56800FM AD 2 DSP566xx User s Manual for the DSP device you re implementing 3 Embedded SDK Programmer s Guide 4 ITU T Recommendation G 168 pre published version 04 2001 MOTOROLA Preface For More Information On This Product Go to www freescale com Xi ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Xii Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Chapter 1 Introduction Welcome
19. P56824 Directories 2 2 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor ING in specific Directories ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 The telephony directory includes telephony specific algorithms Figure 2 3 shows the g168 directory structure under telephony directory o 3 dsp56803evm G dsp56805evm a dsp56824evm Eg nos applications bsp 9 buildall Data E config 3 include E modem E security E signal a sys A telephony E caller id C dtmf det a 9168 EM asm sources A echo canceller CO 9168 3 hil logic A tone disabler rg c sources a Debug I 9168 Data test 9168 G asm sources E c sources A Config a Debug test g168 Data H A telephony Data 4 tools Figure 2 3 telephony Directory Structure Eg sr t E lb LP D H The g168 directory includes the following sub directories e asm_sources includes all asm sources required for echo canceller hold release logic tone disabler logic and complete integration module for G 168 c sources includes APIs for G 168 e fest gl68 Data includes C sources and configuration necessary for testing G 168 library modules c sources contains an example test code for the requirements mentioned in design documen
20. R INC 2005 3 3 4 g168Control Call s UWordl6 g168Control 9168 sHandle pG168 UWordl6 Command Required Header 68 h Arguments Table 3 4 g168Control Arguments pG168 in Handle to an instance of G 168 Command in The command to be executed by the g168Control procedure Description The g 68Control function provides control functions to the G 168 algorithm The parameter pG 68 must have been generated from a call to g 68Create The parameter Command determines which action the g 68Control algorithm will perform including G168 INHIBIT CONVERGENCE freezes to the current coefficients of the echo canceller G168 RESET COEFFICIENTS resets the echo canceller filter coefficients to zero G168 REENABLE CONVERGENCE enables the echo cancellation operation Note The g 66Control function can be called with only one command in the call i e no two commands can be combined to form a command for g 68Control Returns Upon successful completion g 68Control will return PASS if any error occurred FAIL will be returned Special Considerations Calling the g 68Control function does not free the memory allocated during the 168Create function if buffers are to be deallocated the g 68Destroy function must be called Code Example 3 6 Use of the g168Control Interface include g168 h include mem h void test g168 void 9168 sHandle pG168 g168 sConfigure pConfig Int16 RinBuffer 350 SinBu
21. RCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 User configuration of G 168 pConfig Flags 0 pClonfig gt EchoSpan 320 Create and init the instance of G 168 pG168 9168Create pConfig MOTOROLA G 168 Library Interfaces For More Information On This Product Go to www freescale com Specifications ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G168 Library Interfaces Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 3 3 2 g168lnit Call s Result gl68Init gl68_sHandle pG168 9168 sConfigure pConfig Required Header 68 h Arguments Table 3 2 g168lnit Arguments pG168 in Handle to an instance of G 168 pConfig in A pointer to a data structure containing data for initializing the G 168 algorithm Description The g 68 nit function will initialize the G 168 algorithm During initialization each resource will be set to its initial values in preparation for G 168 operation Before calling the g 68Init function a G 168 instance must be created either by calling the g 6SCreate function see Section 3 3 1 or by statically allocating memory which does not require calling the g 68Create function The parameter pConfig points to a data structure of type g 68_sConfigure its fields initialize G 168 operation in the following manner Flags A set of configuration options for G 168 Flags options include G168 CONFIG NL OPTION a flag for enabling non linear proces
22. Software or provide any field service of the Software Motorola reserves the right to make changes to the Software without further notice to Licensee The Software is not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the Software could create a situation where personal injury or death may occur Should Licensee purchase or use the Software for any such unintended or unauthorized application Licensee shall indemnify and hold Motorola and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Motorola was negligent regarding the design or manufacture of the Software The term of this Agreement is for as long as Licensee uses the Software for its intended purpose and is not in default of any provisions of this Agreement Motorola may terminate this Agreement if Licensee is in default of any of the terms and conditions of this Agreement This Agreement shall be governed by and construed in accordance with the laws of the State of Arizona and can only be modified in a writing signed by both parties Licensee agrees to juris
23. acl6 LengthFactor Int16 TrainLevel Intl6 NLSupress UInt16 FrameCounter Int16 SinEnergyHigh Int16 SinEnergyLow Int16 RinEnergyHigh Int16 RinEnergyLow Int16 SoutEnergyHigh Int16 SoutEnergyLow Int16 RinSample Int16 SinSample Intl6 SoutSample Int16 u Int16 uBase Int16 EcFrameFull UInt16 DisableTD UInt16 InhibitConvergence UInt16 DoubleTalk UInt16 DontAdapt 3 2 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc Interface ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 UInt16 ResetCoeff UInt16 NLOption UInt16 G168ECEnable UInt16 ChangeFlag Int16 FilterStatePtr Int16 HFiltPtr Int16 HFiltBaklPtr UInt16 EchoSpan UInt16 FiltLen Tone Disabler Variables Receive Channel specific variables Int16 ZcAmpsl Intl6 AlpStatesl Intl6 BlpStatesl Int16 DontAdaptl Int16 StateTD1 UInt16 ResetTD1 Int16 ToneCount1 UInt16 G168ToneDisablel Int16 Goertzell 2 Int16 TDFrmEnergylHigh Int16 TDFrmEnergylLow Int16 GoertzelCountl Int16 AvgTDTonelHigh Int16 AvgTDTonelLow Int16 AvgTDNoiselHigh Int16 AvgTDNoiselLow Int16 TonePassCount1 Int16 PhRevAmpl Int16 PhRevInst1 Int16 PhRevAmpll Int16 PhRevAmp21 Int16 PhRevFlagl Int16 PhRevInst11 Int16 PhRevIn
24. diction and venue in the State of Arizona By using modifying installing compiling or copying the Software Licensee acknowledges that this Agreement has been read and understood and agrees to be bound by its terms and conditions Licensee agrees that this Agreement is the complete and exclusive statement of the agreement between Licensee and Motorola and supersedes any earlier proposal or prior arrangement whether oral or written and any other communications relative to the subject matter of this Agreement 7 2 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Index A asm_source 2 3 C c sources 2 3 D Dependency Build 4 1 Direct Build 4 2 DSP x DSP56800 Family Manual xi DSP56824 User s Manual xi E EchoSpan 5 1 Electrical echo cancellers 1 2 Embedded SDK Programmer s Guide xi F Far End Echo Cancellers 1 2 FFT x FIR x Flags 5 1 G G 165 Services 3 1 gl65Control 3 16 g165Create 3 8 g165Destroy 3 18 gl 65Init 3 12 g165Process 3 14 H HRL x l T O xi IDE xi IIR xi ITU T 1 1 L Library Sections HRL CONST 5 1 TD CONST 5 1 Linking Applications 5 1 MOTOROLA LMS xi LSB xi MAC xi Metrowerks CodeWarrior 4 1 MIPS xi MSB xi N Near End Echo Cancellers 1 2 NLMS xi 1 2 o OMR xi OnCE xi P
25. ffer 350 SoutBuffer 350 Result res UInt16 Command G168 INHIBIT CONVERGENCE pConfig g168 sConfigure memMallocEM sizeof g168 sConfigure User configuration of G 168 pConfig Flags 0 pConfig gt EchoSpan 320 3 16 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Create and init the instance of G 168 pG168 gl68Create pConfig Specifications res gl68Process pG168 RinBuffer SinBuffer SoutBuffer 13 res gl68Control pG168 Command res gl68Process pG168 RinBuffer SinBuffer 350 MOTOROLA G 168 Library Interfaces 3 17 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Gba Library intartaces Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 3 3 5 g168Destroy Call s void gl68Destroy gl68_sHandle pG168 Required Header 68 h Arguments Table 3 5 g168Destroy Arguments pG168 in Handle to an instance of G 168 generated by a call to g168Create Description The g 68Destroy function destroys the instance of the G 168 originally created by a call to gl66Create Returns None Special Considerations Calling the g 68Control function frees the memory allocated during the
26. filter which synthesizes the replica of the echo path impulse response The performance of the echo canceller depends on the linearity of the echo path between the receive path and the send path Non linearity will cause degradation in the echo cancellation As the echo canceller is a linear filter it will cancel only the linear component of the echo There are various mean squared error based methods for echo cancellation including Least Mean Square LMS Normalized LMS NLMS and Recursive Least Squares RLS Considering complexity an LMS based methods is more efficient than an RLS based method In the G 168 library the NLMS algo rithm is used Basic requirements for echo cancellers are e Rapid convergence Low echo return level during single talk Low divergence during double talk 1 2 2 Features and Performance The G 168 library is multichannel and re entrant For details on Memory and MIPS for a particular DSP refer to the Libraries Chapter of the appropriate Targeting manual 1 2 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Chapter 2 Directory Structure 2 1 Required Core Directories Figure 2 1 details required platform directories ELE sic E dap55824evm E applications Eg bsp d r contig zg include Eg sys E
27. g 68 h shown in Code Example 3 1 Code Example 3 1 C Header File g168 h File g168 h ifndef X G168 H define G168 H Electronic Echo Cancellation G 168 interface ROR KKK KK IK KK OK KKK KK Foundational Include Files OR k ck kok ck kok ck ckok ck ckok ck kok ke e e e kx MOTOROLA G 168 Library Interfaces 3 1 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Gase Library Interfaces Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 include port h KOR RRR kok k oko k kok RR KK OK KK define for G 168 configuration flags Please refer to the user document for more details OK KK k kok I k kok k KI KK ke e xe kx define G168 CONFIG NL OPTION T define G168 CONFIG DISABLE TONE DETECTION 2 define G168 CONFIG INHIBIT CONVERGENCE 4 define G168 CONFIG RESET COEFFICIENTS 8 Ck Ck ck Ck Kk Ck C CC C Ck A A A CC Ck X A A Ck AZ S x KA kx HA ko ko ko AX Structure for G 168 Configuration This structure is used by G168 library and user should not alter neither any element nor disturb the order of the elements OKCKCKCKCKCkCkCK Ck kCk Ck kCk Ck kCk Ck kCk ck k kc k kck ck K kok ck kok ck ck ck kc OK ke e x typedef struct Echo Canceller Variables Intl6 FilterStates Intlo HFilt Int16 HFiltBakl Fr
28. gl68Create function The g 68Destroy function deactivates G 168 and frees the memory allocated during the g 68Create function The g 68Destroy function is called only if the g 68Create function was used to create the instance If user created the instance himself bypassing the g 6SCreate function then the user must free the memory Code Example 3 7 Use of g168Destroy Interface include g168 h include mem h void test 9168 void g168 sHandle pG168 g168 sConfigure pConfig Int16 RinBuffer 350 SinBuffer 350 SoutBuffer 350 Result res pConfig g168 sConfigure memMallocEM sizeof g168 sConfigure User configuration of G 168 pConfig Flags 0 pConfig gt EchoSpan 320 Create and init the instance of G 168 pG168 9168Create pConfig res gl68Process pG168 RinBuffer SinBuffer SoutBuffer 13 res gl68Process pG168 RinBuffer SinBuffer SoutBuffer 350 gl68Destroy pG168 3 18 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Chapter 4 Building the G 168 Library 4 1 Building the G 168 Library The G 168 library combines all of the components described in previous sections into one library g766 lib To build this library a Metrowerks CodeWarrior project g168 mcp is provided
29. he G 168 Library tells how to execute the system library project build e Chapter 5 Linking Applications with the G 168 Library describes organization of the G 168 Library e Chapter 6 G 168 Applications describes the use of G 168 Library through test demo applications e Chapter 7 License provides the license required to use this product Suggested Reading We recommend that you have a copy of the following references e DSP56800 Family Manual DSP56800FM AD e DSP568xx User s Manual for the DSP device you re implementing e Inside CodeWarrior Core Tools Metrowerks Corp MOTOROLA Preface ix For More Information On This Product Go to www freescale com Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Conventions This document uses the following notational conventions Typeface Symbol or Term Meaning Examples Courier Monospaced Type Commands command parameters code examples expressions datatypes and directives Foundational include files a data structure of type vad_tConfigure Italic Calls functions statements the pConfig argument e o 7 defined in the C header file aec h arguments file names an applications makes a call to the Callback procedure Bold Reference sources paths efer to the Targeting DSP56824 Platform emphasis manual see C Program FilesMotorola Embedded SDK
30. he user application and the G 168 modules To invoke G 168 echo cancellation APIs must be called in this order g168Create g168Init gl68Process g168Control or g168Destroy 5 1 1 Library Sections The G 168 Library contains the following data ROM section that must be placed in memory through the linker command file HRL CONST contains defined constants used in Hold Release Logic e TD CONST contains defined constants used in Tone Disabler Logic e EC CONST contains defined constants used in Echo Canceller Code Example 5 1 shows a sample linker cmd file which may be used in testing the G 168 library Code Example 5 1 inker cmd File Linker cmd file for DSP56824EVM External RAM using both internal and external data memory EX 0 and using external program memory Mode 3 MEMORY pram RWX ORIGIN 0x0000 LENGTH OxFF80 external program memory avail RW ORIGIN 0x0000 LENGTH 0x0030 available MOTOROLA Linking Applications with the G 168 Library 5 1 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Linking Applications with Fregagale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 cwregs RW ORIGIN 0x0030 LENGTH 0x00
31. k rr Te ye re ee eee H 3 1 RN slad ni aid eg o aio ORC PCR RR IUE ara PHP CC dea BO de Oa dde 3 7 3l it PTT rcp ere 3 8 2 3 4 IGM 2 d oed brin d oaa d aa ee 3 12 Be P oS n BA B B pe hon B ko Sk E 3 14 3 3 4 BIOS MO 26445496554 SEE or 5 FOS E ENG dS ie SSS eee cp sea TEs 3 16 ON Z P 0o ve o o da hr B eo dc ede 3 18 Chapter 4 Building the G 168 Library 4 1 Building the G 168 LD oo oo hh EE odds kp a ko PIX EUR 4 1 4 1 1 Denon EE 4 1 4 1 2 Dee EE o ea se P 4 2 MOTOROLA Table of Contents For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Chapter 5 Linking Applications with the G 168 Library 5 1 LM CD UTD S L LA s rrr Chapter 6 G 168 Applications 6 1 7 106 Test and Demo Applications 125 d SE e dar Rd Hua RAS A A Chapter 7 License T4 Limited Lise License Agreement 42 hoo sees EE ENEE ii G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 List of Tables Table 3 1 Table 3 2 Table 3 3 Table 3 4 Table 3 5 MOTOROLA GG ale AT QUOI ida ese GG sk dak vn bd sed KIBSDUE u lo gc dk oh eS PAD es EE plaSControl ATCO cassbxeskebasrhdkatiebdkkbetebi ah 4d R ZOD TEE List of Tables For Mo
32. lerData gt AlpStates2 3 sizeof Int16 pG168 gt EchoCancellerData gt BlpStates2 Intl16 zi memMallocAlignedEM 3 sizeof Int10 IsMemAligned amp memIsAligned pG168 gt EchoCancellerData gt BlpStates2 3 sizeof Int16 if pG168 gt EchoCancellerData amp amp pG168 gt EchoCancellerData gt FilterStates amp amp pG168 gt EchoCancellerData gt HFilt 84 pG168 gt EchoCancellerData gt HFiltBakl amp amp pG168 gt EchoCancellerData gt BufA amp amp pG168 gt EchoCancellerData gt ZcAmpsl amp amp 68 EchoCancellerData ZcAmps2 84 pG168 gt EchoCancellerData gt AlpStatesl 46 pG1 pG1 68 gt EchoCancellerData gt BlpStatesl amp amp pG168 amp amp pG168 gt EchoCancellerData gt BlpStates2 MOTOROLA G 168 Library Interfaces For More Information On This P EchoCancellerData gt AlpStates2 3 9 roduct Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Library Interfaces Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 gi68Destroy pG168 return NULL if IsMemAligned amp IsInternalMem false gl68Destroy pG168 return NULL gl68Init pG168 pConfig return pG168 For details on the g 65 sHandle structure please refer to Code Example 3 1 The preceding pConfig argument points to the g 68_sConfigure structure which configure
33. lopment system environment in order to produce object code solely for operating on a Motorola semiconductor device having a central processing unit Derivative Object For the Object and Derivative Object Motorola grants Licensee a personal non exclusive non assignable revocable royalty free right to copy use and distribute the Object and the Derivative Object solely for operating on a Motorola semiconductor device having a central processing unit Licensee agrees to a not use modify or copy the Software except as expressly provided herein b not distribute disclose transfer sell assign rent lease or otherwise make available the Software any derivatives thereof or this license to a third party except as expressly provided herein c not remove obliterate or otherwise defeat any copyright trademark patent or proprietary notices related to the MOTOROLA License 7 1 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Software d not in any form export re export resell ship or divert or cause to be exported re exported resold shipped or diverted directly or indirectly the Software or a direct product thereof to any country which the United States government or any agency thereof at the time of export or re export requires an License export license or other government appro
34. lude g168 h define HRL FRM LEN 128 g168 sHandle gl68Create g168 sConfigure pConfig g168 sHandle pG168 bool IsInternalMem true bool IsMemAligned true Allocate the memory for the handle pG168 g168 sHandle memMallocEM sizeof g168 sHandle if pG168 NULL return NULL Allocate the memory for the EchoCancellerData Struct pG168 gt EchoCancellerData ECDataStruct memMallocEM sizeof ECDataStruct Allocate Circular Buffer for EC Filter States pG168 gt EchoCancellerData gt FilterStates Intl16 zl memMallocAlignedIM pConfig EchoSpan sizeof Int10 Check whether the memory is internal IsInternalMem amp memIsIM pG168 gt EchoCancellerData gt FilterStates Check the alignment for the allocated buffer IsMemAligned amp memIsAligned pG168 gt EchoCancellerData gt FilterStates pConfig gt EchoSpan sizeof Int16 3 8 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICOND Allocate Buffer for EC Filter Coeffs pG168 gt EchoCancellerData gt HFilt Int16 memMallocIM Chec IsInternalMem amp memIsIM pG168 gt I k whether the memory is internal Allocate the mem
35. ory for H Filter Backup 1 pG168 gt I Specifications UCTOR INC 2005 pConfig EchoSpan sizeof Int10 EchoCancellerData gt HFilt EchoCancellerData gt HFiltBakl Int16 memMallocEM pConfig gt EchoSpan sizeof Int10 Allocation of memory for HRL Data Structure pG168 gt EchoCancellerData gt BufA Intl16 memMallocEM HRL FRM LEN 2 I sizeof Int16 Allocation of memory for Tone Disabler Data Structure pG168 gt EchoCancellerData gt ZcAmpsl Int16 memMallocAlignedEM IsMemAligned amp memIsAligned pG168 6 sizeof Int16 EchoCancellerData gt ZcAmpsl 6 sizeof Int16 pG168 gt EchoCancellerData gt ZcAmps2 Int16 memMallocAlignedEM 6 sizeof Int16 IsMemAligned amp memIsAligned pG168 gt EchoCancellerData gt ZcAmps2 6 sizeof Int16 pG168 gt EchoCancellerData gt AlpStatesl Intl16 memMallocAlignedEM 3 sizeof Int16 IsMemAligned amp memIsAligned pG168 gt EchoCancellerData gt AlpStatesl 3 sizeof Int16 pG168 gt EchoCancellerData gt BlpStatesl Intl16 zi memMallocAlignedEM 3 sizeof Int16 IsMemAligned amp memIsAligned pG168 gt EchoCancellerData gt BlpStatesl 3 sizeof Int16 pG168 gt EchoCancellerData gt AlpStates2 Intl16 memMallocAlignedEM 3 sizeof Int16 IsMemAligned amp memIsAligned pG168 gt EchoCancel
36. plications with Fregagale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 F bss length BSS ADDR Copy DATA gt data FArchIO ADDR onchip2 5 4 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Chapter 6 G 168 Applications 6 1 G 168 Test and Demo Applications To verify the G 168 algorithm test and demo applications have been developed Refer to the Targeting Motorola DSP568xx Platform Manual for the DSP you are using to see if the test and demo applications are available for your target MOTOROLA G 168 Applications 6 1 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Applications Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Chapter 7 License 7 1 Limited Use License Agreement LIMITED USE LICENSE AGREEMENT PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THIS SOFTWARE BY USING OR COPYING THE SOFTWARE YOU AGREE TO THE TERMS OF THIS AGREEMENT The software in
37. re Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 List of Figures Figure 2 1 Figure 2 2 Figure 2 3 Figure 2 4 Figure 4 1 Figure 4 2 Figure 4 3 MOTOROLA Core DIGG 46456540 N d av add B dd k B0033 B 2 on EE E telephony DIES reu eg k v C o A k KS L Gute Ak e EEN ER EEN E AC Dependency Build for the G 168 Lafe 2 E VALO I PIU ge CERN OPE AER OE OR o EEE Frectie MBB Lo osuere seq e Quos uode dde aud dt E e odd pat List of Figures For More Information On This Product Go to www freescale com Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 vi Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Line Echo Canceller Library For More Information On This Product Go to www freescale com MOTOROLA ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 List of Examples Code Example Code Example Code Example Code Example Code Example Code Example Code Example Code Example MOTOROLA 3 1 3 2 3 3 3
38. s G 168 operation as shown in Code Example 3 3 If a g168Create function is called to create an instance then g 68Destroy see Section 3 3 5 should be used to destroy the instance Alternatively the user can allocate memory statically which requires duplicating all statements in the g168Create function In this case the user can call the g768 nit function directly bypassing the gl68Create function If the user dynamically allocates memory without calling g 68Create then the user himself must destroy the memory allocated Returns Upon successful completion the g 68Create function will return a pointer to the specific instance of G 168 created If g 68Create is unsuccessful for any reason it will return NULL Special Considerations e The G 168 application is multichannel and re entrant e If gl68Create is called then the user need not call the g 68 nit function which is called internally in the g 68Create function Code Example In Code Example 3 3 the application creates an instance of G 168 Code Example 3 3 Use of the g168Create Interface include g168 h include mem h void test 9168 void g168 sHandle pG168 g168 sConfigure pConfig pConfig g168 sConfigure memMallocEM sizeof g168 sConfigure 3 10 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc A
39. sing in the gl66Process G168 CONFIG DISABLE TONE DETECTION which disables the 2100Hz tone detection in the g 68Process G168 CONFIG INHIBIT CONVERGENCE which stops adapting the equalizer in the g 68Process G168 CONFIG RESET COEFFICIENTS which resets all coefficients of the equalizer to zero in the g 68Process EchoSpan Specifies the number of taps of the equalizer The valid range is upto 40 512 taps which corresponds to echo tail of 5 64 ms Returns Upon successful completion a value of TRUE will be returned otherwise a value of FALSE will be returned Special Considerations e If gl68Create is called then the user need not call the g 68Jnit function which is called internally in the g 68Create function Code Example In Code Example 3 4 the application creates an instance of G 168 The instance is passed to g 68Init along with the G 168 configuration structure pConfig 3 12 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Code Example 3 4 Use of g168lnit Interface Specifications include g168 h include mem h void test 9168 void g168 sHandle pG168 g168 sConfigure pConfig Result res pConfig g168 sConfigure memMallocEM sizeof g168 sConfigure User configuration of G 168 pConfig
40. st21 Int16 FirstZcFlagl Int16 Counti Int16 ZeroCross1 Int16 HfPeriodl Int16 NumHfPeriodl Int16 SumHfPeriodl Int16 HfPeriodLiml Int16 FCountl Int16 ZcCount1 Int16 SumZcl Int16 ZcAmpslPtr Int16 AlpStateslPtr Int16 BlpStateslPtr Int16 SineP1 MOTOROLA G 168 Library Interfaces 3 3 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G 168 Library Interfaces Send Channel Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 specific variables Int16 ZcAmps2 Int16 AlpStates2 Int16 BlpStates2 Int16 DontAdapt2 Int16 StateTD2 UInt16 ResetTD2 Int16 ToneCount2 UInt16 G168ToneDisable2 Int16 Goertzel2 2 Int16 TDFrmEnergy2High Int16 TDFrmEnergy2Low Int16 GoertzelCount2 Int16 AvgTDTone2High Int16 AvgTDTone2Low Int16 AvgTDNoise2High Int16 AvgTDNoise2Low Int16 TonePassCount2 Int16 PhRevAmp2 Int16 PhRevInst2 Int16 PhRevAmp12 Int16 PhRevAmp22 Int16 PhRevFlag2 Int16 PhRevInst12 Int16 PhRevInst22 Int16 FirstZcFlag2 Int16 Count2 Int16 ZeroCross2 Int16 HfPeriod2 Int16 NumHfPeriod2 Int16 SumHfPeriod2 Int16 HfPeriodLim2 Int16 FCount2 Int16 ZcCount2 Int16 SumZc2 Int16 ZcAmps2Ptr Intl6 AlpStates2Ptr Intl6 BlpStates2Ptr Int16 SineP2 Int16 disableTD Hold Release Logic Variables Int16 Avg
41. t Config contains configuration files appconfig c appconfig h and linker cmd specific to G 168 MOTOROLA Directory Structure 2 3 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 The applications directory includes high level software that exercises the G 168 library As shown in Figure 2 4 the applications directory contains the g168 application under telephony Directory Structure EC dsp56824evm Egg nos applications A applications Data 3 codec 3 des C3 eeprom E serial A telephony E dtmf det a dtmf gen G 9168 Figure 2 4 G 168 Application 0 A E 2 4 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Chapter 3 G 168 Library Interfaces 3 1 G 168 Services The G 168 library cancels the echo from the near end speech signal with the use of reference far end speech signal The data to be supplied must be in 16 bit word fixed point 1 15 format which is shown below S MSB LSB i information bit s sign 3 2 Interface The C interface for the G 168 library services is defined in the C header file
42. turn FAIL Special Considerations e In place computation is allowed i e input and output buffers could be identical Suppose 89 words of data are to be processed The length to be passed for processing is shown below gl68Process pG168 pSamples Rin pSamples Sin pSamples Sout 89 for process Code Example Code Example 3 5 shows the use of the g 68Process Interface 3 14 G 168 Line Echo Canceller Library MOTOROLA For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Code incl incl void Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 Example 3 5 Use of g168Process Interface Specifications ude g168 h ude mem h test 9168 void g168 sHandle pG168 g168 sConfigure pConfig Int16 RinBuffer 350 SinBuffer 350 SoutBuffer 350 Result res pConfig g168 sConfigure memMallocEM sizeof g168 sConfigure User configuration of G 168 pConfig Flags 0 pClonfig gt EchoSpan 320 Create and init the instance of G 168 pG168 9168Create pConfig res gl 68Process pG168 RinBuffer SinBuffer SoutBuffer 350 MOTOROLA G 168 Library Interfaces 3 15 For More Information On This Product Go to www freescale com ARCHIVED BY FREESCALE SEMICONDUCTOR INC 2005 G168 Library Interfaces Freescale Semiconductor Inc ARCHIVED BY FREESCALE SEMICONDUCTO
43. val without first obtaining such license or approval THE SOFTWARE IS PROVIDED ON AN AS IS BASIS AND WITHOUT WARRANTY OF ANY KIND INCLUDING WITHOUT LIMITATION ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY LIABILITY OR DAMAGES OF ANY KIND INCLUDING WITHOUT LIMITATION DIRECT OR INDIRECT OR INCIDENTAL OR CONSEQUENTIAL OR PUNITIVE DAMAGES OR LOST PROFITS OR LOSS OF USE ARISING FROM USE OF THE SOFTWARE OR THE PRODUCT REGARDLESS OF THE FORM OF ACTION OR THEORY OF LIABILITY INCLUDING WITHOUT LIMITATION ACTION IN CONTRACT NEGLIGENCE OR PRODUCT LIABILITY EVEN IF MOTOROLA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE THIS DISCLAIMER OF WARRANTY EXTENDS TO LICENSEE OR USERS OF PRODUCTS AND IS IN LIEU OF ALL WARRANTIES WHETHER EXPRESS IMPLIED OR STATUTORY INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR PARTICULAR PURPOSE Motorola does not represent or warrant that the Software is free of infringement of any third party patents copyrights trade secrets or other intellectual property rights or that Motorola has the right to grant the licenses contained herein Motorola does not represent or warrant that the Software is free of defect or that it meets any particular requirements or need of the Licensee or that it conforms to any documentation or that it meets any standards Motorola shall not be responsible to maintain the Software provide upgrades to the
44. y customer s technical experts Motorola does not convey any license under its patent rights nor the rights of others Motorola products are not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur Should Buyer purchase or use Motorola products for any such unintended or unauthorized application Buyer shall indemnify and hold Motorola and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part Motorola and the Stylized M Logo are registered trademarks of Motorola Inc Motorola Inc is an Equal Opportunity Affirmative Action Employer MOTOROLA and the Stylized M Logo are registered in the US Patent amp Trademark Office All other product or service names are the property of their respective owners Motorola Inc 2002 How to reach us USA EUROPE Locations Not Listed Motorola Literature Distribution P O Box 5405 Denver Colorado 80217 1 303 675 2140 or 1 800 441 2

Download Pdf Manuals

image

Related Search

Related Contents

Deliverable 6.1 Report on the demonstration activities including the  Universal Battery Charger Cat. No.: 25297 Instruction Manual    Casio EX-TR300 User's Manual  Consulta - Prevenzione Oggi  MANUALE D`INSTALLAZIONE E MANUTENZIONE BLITZ  carrozzine serie comby mille-smarty  Wiley Professional Microsoft Office SharePoint Designer 2007  Cisco HWIC-4SHDSL-E=  

Copyright © All rights reserved.
Failed to retrieve file