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.

how to view output of sine wave program in graph?

i am not able to see proper sine wave after debugging my program for sine wave.why it is so? what changes required to get expected output/perfect sine wave after debugging.

code used:

#include <math.h>
#include "C:\Users\abhi\Downloads\DSK6713\DSK6713\c6000\dsk6713\include\dsk6713.h"
#include "C:\Users\abhi\Downloads\DSK6713\DSK6713\c6000\dsk6713\include\dsk6713_aic23.h"
#define SINE_TABLE_SIZE 96
#define PI ( ( double )3.1415927 )
#define SINE_MAX 0x7FFE //Peak value of sine wave
int sinetable[SINE_TABLE_SIZE];
DSK6713_AIC23_Config config = { \
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */\
0x00ff, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \
0x00ff, /* 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 */ \
0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
};
void InitSineTable( void )
{
int i;
double increment= 0;
double radian = 0;
increment = ( PI * 2 ) / SINE_TABLE_SIZE;
for ( i = 0 ; i < SINE_TABLE_SIZE ; i++ )
{
sinetable[i] = ( int )( sin( radian ) * SINE_MAX );
radian += increment;
}
}
void main()
{
int i;
DSK6713_AIC23_CodecHandle hCodec;
DSK6713_init();
InitSineTable();
hCodec = DSK6713_AIC23_openCodec(0, &config);
DSK6713_AIC23_setFreq(hCodec, 7); //Sampling rate 96 kHz
while(1)
{
for ( i = 0 ; i < SINE_TABLE_SIZE ; i++ )
{
while (!DSK6713_AIC23_write(hCodec, sinetable[i]));
while (!DSK6713_AIC23_write(hCodec, sinetable[i]));
}
}
}

expected output and actual output are attached.

why i do not find proper sinewave? have i chosen right window for graph display?

7183.actual output.doc0336.expected output.doc1638.actual output graph.doc

thank you

  • Abhishek,

    abhishek srivastava said:
    after debugging my program for sine wave

    What do you mean by this statement? What debugging have you done? Have you verified that the contents of sinetable[] are correct?

    If no, then you cannot assume a graph would show correct data.

    If yes, then the graph arguments must be incorrect.

    Regards,
    RandyP

  • hello sir,

    i am new to DSP processors. from debugging,i intended that i have build the program successfully without errors and debug windows appears to me.

    now what to do now to see the output of my program? how to verify the content of sinetable?i could not see it in variable pane.

    what to do and how to get output for this program??

    quick response is expected.

    thank you

  • Abhishek,

    Welcome to TI DSP processors. It sounds like you are also new to C programming and perhaps to the use of an Integrated Development Environment (IDE).

    You need to learn the basics of CCS, and there are training courses online to help you. Search the TI Wiki Pages for "C6000 training" (no quotes). For older training on CCS 3.3, you may need to search for the archived "C6x1x workshop" (no quotes). You can also go to TI.com and search for Training. Do not worry about the fact that these may not apply directly to the C6713, they will still help you learn to use the tools.

    Also, CCS 3.3 has good tutorials built into it. Go to the Help menu and I think that is where you find the tutorials. The newer versions of CCS are better, so if possible, update your CCS to CCSv5. You can also search the TI Wiki Pages for CCSv5 to get installation information and Getting Started Guides for CCSv5.

    There is not a short-cut to learning how to use the CCS tools other than by going through the training material. Use the labs that are provided for the version of CCS that you are running (C6000 training for CCSv5, C6x1x for CCS 3.3).

    Regards,
    RandyP

  • thank you for your detailed response. i would definitely go through with available tutorials. i am using CCS v5(evaluation).

    right now,i just need to see the output for the program (written above) as i do not have DSK available with me and trying to see output using simulator.

    for simple programs i could find output in variable pane (noticing the change in variable values as expected). but do not know a way to see graphical output.

    so could you suggest me the way to see the output for the above given program?what ever output i am getting,is it useful or waste?

    i have attached the same earlier for your reference.

    thank you.

  • Abhishek,

    CCSv5 is the best choice. The "evaluation" version is full-featured and is not different from the "real" version. The only difference is licensing, and there is no license fee required when using CCSv5 with the simulator or with a DSK/EVM with on-board emulation.

    Have you tried searching the Wiki or the CCSv5 built-in Help for "graph" (no quotes)? If not, try it; if yes, what have you found?

    Regards,
    RandyP