Hello,
I am using TMS320C6713 board with CCS 5.5 .
I am implementing linear block based convolution. The input signal is 300hz sinosidal read from LineIN port.
Here is the code(only buffer filling not convolution).....
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include "stdlib.h"
#define BufferLength 8000
// Codec configuration settings
DSK6713_AIC23_Config config = { \
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */\
0x01f9, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \
0x01f9, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */ \
0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */ \
0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ \
0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ \
0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ \
0x0001, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
};
float InputBuffer[BufferLength];
void main()
{
DSK6713_AIC23_CodecHandle hCodec;
Int16 OUT_L, OUT_R,Temp_L,Temp_R;
Uint32 IN_L,IN_R;
float ReferSignal,Disturbance;
int i,j,count=0;
// Initialize BSL
DSK6713_init();
//Start codec
hCodec = DSK6713_AIC23_openCodec(0, &config);
// Set frequency to 48KHz
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_48KHZ);
for(;;)
{
// Read sample from the left channel
while (!DSK6713_AIC23_read(hCodec, &IN_L));
while (!DSK6713_AIC23_read(hCodec, &IN_R));
// Feeding the input directly to output you can add effects here
OUT_L = IN_L;
OUT_R = IN_R;
for(i=0;i<BufferLength-1;i++)
{
InputBuffer[BufferLength-i-1]=InputBuffer[BufferLength-i-2];
}
InputBuffer[0]= OUT_R; // Filling the buffer with new sample
while (!DSK6713_AIC23_write(hCodec, OUT_L));
while (!DSK6713_AIC23_write(hCodec, OUT_R));
}
//********************************************END***********************************************************//
After some time(10 sec), I am stoping the the debugger. The value of InputBuffer is read from memory and is ploted in matlab.
Results of matlab ploting
As you can see there is a shift from 300Hz to 2400Hz (approx).
I have tried introducing other delays the result is same (shifted frequency).
As i am new to DSP and this board, can any one please tell me the problem and how to rectify it.
Thanks
Nageshwar