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.

TMS320C6713B: Flanger at TMS320C6713

Part Number: TMS320C6713B

Hi!.

I'm trying to make flanger effect on TMS320C6713. 

Here is my code. Everything works in compiler.

#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include "c6713dskinit.h"
#include "math.h"
#include "dsk6713_led.h"
#include "dsk6713_dip.h"

Uint32 fs = DSK6713_AIC23_FREQ_8KHZ;
#define DSK6713_AIC23_INPUT_MIC 0x0015
#define DSK6713_AIC23_INPUT_LINE 0x0011
Uint16 inputsource=DSK6713_AIC23_INPUT_MIC;

#define BUF_SIZE 16000
short buffer[BUF_SIZE];
short in,out,flang,flanger_effect;
int i;
#define pi 3.14
#define fcycle 0.5/fs

void Flanger()
{

for(i=0 ; i<BUF_SIZE ; i++)
{

in = input_left_sample();

flanger_effect = round( ( (BUF_SIZE) / 2) * (1-cos(2*pi*i*fcycle)) );
flang = ( 0.5 * buffer [i]) + ( 0.5 * ( buffer[i] + flanger_effect ) );

buffer[i] = in;
if(++i >= BUF_SIZE) i=0;
out = flang;

output_left_sample(out);
output_right_sample(out);
}

return;
}

void main()
{
comm_poll();
DSK6713_LED_init();
DSK6713_DIP_init();

while(1)
{

if( (DSK6713_DIP_get(0)==0) )
{
DSK6713_LED_on(0);
Flanger();
}
else
DSK6713_LED_off(0);
}
}

When I try to test it it does sent me my voice without flanger effect. I do not know why it does not work. I think I am wrong with sampling an input since I made flanger in matlab and it works with this equation.

May I ask about help and tips how to solve this problem. I am not a master of using pointers so any help would be blessing.