This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320C6713B: Acoustic Echo Cancellation using C6713 help

Part Number: TMS320C6713B


Tool/software: Code Composer Studio

I am using TMS320C6713 DSK for Echo cancellation using nlms algorithm of adaptive filtering.

https://www.dsprelated.com/showabstract/65.php is the link i am refering to.

i have modified the code nlms_adfilt.c. The modified code looks like :

#include <math.h>

#include <stdio.h>

#include <stdlib.h>

#include <dsk6713.h>

#include <dsk6713_aic23.h>

#define FILTER_LENGTH 2300

#define ECHO_DELAY 600

#define STEP_SIZE 5e-5

#define SCALE 5000.0

#define GAIN 15

#define OUTBUF_LEN 1024

float input, echoed, af_output, error_signal;

float input_vector[FILTER_LENGTH];

float filter[FILTER_LENGTH];

float echo_buffer[ECHO_DELAY];

float step_size = STEP_SIZE;

float nstep_size;

short output;

short output_type=1;

short delay_param=0;

short i, j, eb_index;

Uint32 fs=DSK6713_AIC23_FREQ_8KHZ;

short OutputBuffer[OUTBUF_LEN];

short ob_index = OUTBUF_LEN;

float dotp (float a[], float b[])

{

float suml, sumh;

int j;

suml=0;

sumh=0;

for(j=0; j<FILTER_LENGTH; j+=2)

{

suml += a[j] * b[j];

sumh += a[j+1]*b[j+1];

}

return (suml+sumh);

}

interrupt void c_int11()

{

input=(float)(input_sample())/SCALE;

input_vector[0] = input;

echoed = input+0.4*echo_buffer[eb_index];

echo_buffer[eb_index]=echoed;

eb_index++;

if (eb_index >= ECHO_DELAY-delay_param)

eb_index=0;

af_output=dotp(filter, input_vector);

error_signal = echoed-af_output;

nstep_size=1/dotp(input_vector, input_vector);

for (i=FILTER_LENGTH-1; i>0; i--)

{

filter[i] = filter[i] + 2*nstep_size*error_signal*input_vector[i];

input_vector[i]=input_vector[i-1];

}

if (output_type==1)

output=(short)(input*SCALE*GAIN);

if (output_type==2)

output=(short)(echoed*SCALE*GAIN);

if (output_type==3)

output=(short)(af_output*SCALE*GAIN);

if (output_type==4)

output=(short)(error_signal*SCALE*GAIN);

output_sample(output);

if ( ob_index < OUTBUF_LEN )

OutputBuffer[ob_index++] = output;

}

main()

{

error_signal=0.0;

echoed=0.0;

af_output=0.0;

eb_index=0;

nstep_size=0;

for (i=0; i<FILTER_LENGTH-1; i++)

{

filter[i]=0.0;

input_vector[i]=0.0;

}

for (i=0; i<ECHO_DELAY; i++)

{

echo_buffer[i]=0.0;

}

comm_intr();

while(1);

}

i have added following support files:

c6x.h

c6xdsk.h

c6xdskinit.h

c6xinterrupts.h

c6xdskinit.h

modified nlms_adfilt.c

vectors_11.asm

C6xdsk.cmd

support libraries:  rts6700.lib     csl6713.lib    dsk6713bsl.lib

Then I changed build options according to chassing book which are as follows: 

compiler --> basic --> target version --> c671x(-mv6710)

compiler --> advanced --> memory models --> Far(--mem_model:data=far)

compiler --> preprocessor --> Include Search path --> (give address where all support files stored)

compiler --> preprocessor --> Pre define symbol(-d) : CHIP_6713

linker --> basic --> library Search Path --> (gave address where all support files stored)

linker --> basic --> include libraries(-l) --> rts6700.lib;dsk6713bsl.lib;csl6713.lib

linker --> advanced --> uncheck the Warn about the output sections (-w) checkbox.

Then I tried to build the program.

The build was successful with 0 errors   0 warnings   0 remarks.

Now my queries are: 

How to give input to the kit?

How to get output?

How can I compare both input and output? Both physically by hearing through headphone out port and also by observing graphically.?

P.S. I used CCS V3.1 platinum edition which is available with The CD accompanying the TMS320C6713 Dsp kit.

Thanks In advance.

Pls Help asap.

  • Hello,
    normally you should use the four 3.5 mm. audio jacks for in/out analogue signals.
    To compare audio before and after processing one way is as you say to just listen via headphones.
    For more precise investigating you can use widely spread Audacity software available for different platforms (Windows, Linux, etc.) and see how the signal looks like in graphical form.

    BR,
    Michail
  • Sir,
    Though the build was successful with no errors no warnings no remarks but then also I cannot hear any output through the headphone/line out port of DSK when I give an input using 3.5mm jack to mic in port.
    What could be the problem?
    P.S. DSK is working perfectly fine as the code echo.c (chassing book) is running quite well.
  • Hi,
    can you test all inputs and outputs with code "echo.c" you mentioned?
    If so, next test can be to run nlms_adfilt.c code unmodified and check if works correctly.
    Can you give a link to whole source code you're using to look at?

    Michail
  • Sir,
    I couldnt understand what do you mean by all the inputs?
    when I executed echo.c then I gave the input through line in port and obtained the output(signal with echo) through headphone port or line out port using 3.5mm jack Mobile earphones.

    When I ran nlms_adfilt.c without modifing anything and adding support files according to this paper www.dsprelated.com/.../65.php
    then
    1. I am running the code on C6713 and in this thesis the hardware used is C611.
    2. I added all the support files mentioned in this paper except rts6701.lib. (I added rts6700.lib instead of rts6701.lib) bcause I dont have rts6701.lib file.(I tried a lot to find the file on internet but couldnt)
    The other files I added were as follows :
    • c6xdskinit.c
    • c6x.h
    • c6xdsk.h
    • c6xdskinit.h
    • c6xinterrupts.h
    • vectors_11.asm
    • rts6701.lib
    • C6xdsk.cmd
    And nlms.gel file.

    I changed the build options as follows :
    compiler --> basic --> target version --> c671x(-mv6710)
    compiler --> advanced --> memory models --> Far(--mem_model:data=far)
    compiler --> preprocessor --> Include Search path --> (give address where all support files stored)
    compiler --> preprocessor --> Pre define symbol(-d) : CHIP_6713
    linker --> basic --> library Search Path --> (gave address where all support files stored)
    linker --> basic --> include libraries(-l) --> rts6700.lib;dsk6713bsl.lib;csl6713.lib
    linker --> advanced --> uncheck the Warn about the output sections (-w) checkbox.

    Then I build he program.The build was succesful with 0 errors 0 warnings and 0 remarks.
    I loaded the program.
    I tried giving the input through both Mic in port and line in port but couldnt get any output from any of the lineout or headphone port.
  • All the support and source files are here : drive.google.com/open
    I am Using C6713 and CCS v3.1
    I am refering to the thesis at : www.dsprelated.com/.../65.php
    I am also refering to the forum thread : e2e.ti.com/.../12454

    It might help you understand my problems and errors well.
  • Can you please Execute the program and figure out where the problem is?

  • Hello,
    unfortunately I can't reproduce your issue due to the lack of such board on my side.
    Here are some explanations for a similar board as yours
    e2e.ti.com/.../2415166
    I will check with TI experts and reassign this respectively.

    Michail