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.

Input Signal Frequency change, while using block processing TMS320C6713..

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

 

 

  • Hi Nageshwar,
    Are you working on TI board or custom board?
  • Yes TI TMS 320C6713 DSK. Sir did you get the problem ..?

    Nageshwar
  • Nageshwar,

    How does your input signal get generated, the 300Hz signal?

    You said Matlab was plotting your InputBuffer's contents. Would that look like a sine wave? Are you actually parsing it through an FFT before displaying it, or are you simply displaying the contents of the InputBuffer?

    If you want to understand the difference between your signal read from the codec and the signal written to the codec, it would just be the same value since you are copying the IN_R to OUT_R. So this is hard to understand.

    The only thing I can guess from what is shown and said here is that you have a sampled waveform that is supposed to be a 300Hz sine wave stored in a file. You put that signal out and capture it on the input to the DSK's codec and read that in the C6713 loop. The sample rate that you are using when copying from the file to the DSK's input is not the same as the sample rate at which the codec is operating.

    Create a counter variable that you can increment in the sample loop (not the InputBuffer loop). Let the application run for 10 seconds then stop it and read that counter's value. Divide by 10 to find out how many samples per second you are using.

    Look at the input signal to the DSK using an oscilliscope to determine what that signal frequency actually is. Do the same looking at the output signal and compare it with the input signal.

    Please let us know what you find, and please explain more about what happens between each different step. It is not easy for us to make so many assumptions. Your facts and details will be most helpful.

    Regards,
    RandyP