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.

C67x DSPLIB FFT Example

Signal Processing Examples Using the TMS320C67x DSP Library (Rev. A)
http://www.ti.com/lit/an/spra947a/spra947a.pdf
3.3.4 FFT Example (Page 15)

For this example the output data is only the output image (Figure 10).

Please show how FFT was performed.

Best regards,

Daisuke

 

  • Daisuke,

    The FFT was calculated using the DSPF_sp_fftSPxSP API provided inside the C67x DSPLIB with N=1024. Unfortunately, it appears the sample project is not provided as part of the C67x DSPLIB but if you download the C674x DSPLIB and check the example source for the DSPF_sp_fftSPxSP, it very similar to the code required to compute the FFT in that app Note. The Magnitude is calculated by taking the sum of square of the real and the imaginary part obtained from the complex FFT output obtained from that API.

    Could you also confirm, that you are using a C6700 DSP and not a C674x DSP? The DSPLIB for the two are different so I would like to confirm that you are refering to the right library.

    Regards,

    Rahul

  • Hi Rahul,

    Thank you for your reply.

    I used the C674x DSPLIB with the C6747 Device Functional Simulator, and used the attached file source that changed the C674x DSPLIB FFT example source.

    0815.fft_example_sp.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /* ======================================================================= */
    /* fft_sp_example.c -- FFT Example File */
    /* */
    /* This example demonstrates the usage of the various FFT kernels */
    /* provided with the C6x DSPLIB. The example shows: */
    /* - Twiddle factor generation for the various kernels */
    /* - Scaling that needs to be applied to get similar output */
    /* when using different kernels */
    /* - Demonstrates the usage of FFT APIs */
    /* */
    /* Rev 0.0.1 */
    /* */
    /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */
    /* */
    /* */
    /* Redistribution and use in source and binary forms, with or without */
    /* modification, are permitted provided that the following conditions */
    /* are met: */
    /* */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Is the calculation result different between C67x DSPLIB and C674x DSPLIB?

    Best regards,

    Daisuke

     

  • The calculation results should be the same for both the functions. Let us know if you are still seeing some issues

    Regards

    Rahul

  • Hi Rahul,

    Thank you for your reply.

    I calculated the Magnitude.

    5238.fft_example_sp_spra947a.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /* ======================================================================= */
    /* fft_sp_example.c -- FFT Example File */
    /* */
    /* This example demonstrates the usage of the various FFT kernels */
    /* provided with the C6x DSPLIB. The example shows: */
    /* - Twiddle factor generation for the various kernels */
    /* - Scaling that needs to be applied to get similar output */
    /* when using different kernels */
    /* - Demonstrates the usage of FFT APIs */
    /* */
    /* Rev 0.0.1 */
    /* */
    /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */
    /* */
    /* */
    /* Redistribution and use in source and binary forms, with or without */
    /* modification, are permitted provided that the following conditions */
    /* are met: */
    /* */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

      

    Is my calculation correct?

    Best regards,

    Daisuke

     

  • Hi, Daisuke,

    May I know which tools are you using to create the graph in your attached picture?

    I notice that there is a file (refOutput_sp.jpg) in DSPLIB example folder. It seems that the graph in this file is created by CCS. I am wondering how to create the graph automatically when running the example program in CCS. Any idea?

    Thanks and Regards,

    Shunnian

  • Shunnian,

    Their are graph tools provided under Tools tab that allow you to plot input and output buffers of the FFT.

    Hi Daisuke,

    What is the input signal to the FFT function? Are you plotting all the samples in the Magnitude plot.  Plot of FFT spectrum is symmetrical, so if you compute an N point FFT of a signal the magnitude a sample f will be same as that of (N-f-1) th sample.

    Regards,

    Rahul

  • Hi Shunnian,

    Here is how to display graphs by CCS.

    http://processors.wiki.ti.com/index.php/GSG:Debugging_projects_v5#Displaying_graphs

    The Help Contents of CCS have the details.

    Best regards,

    Daisuke

     

  • Hi Rahul,

    Thank you for your reply.
    Sorry for my late reply.

    The input signal is the combination of sine waves of 10Hz and 40Hz. It is the same as the FFT Example in the application note (SPRA947A).

    I want to get an output graph same as Figure 10 in the application note.

    Best regards,

    Daisuke

     

  • Hi, Rahul and Daisuke,

    Thank you for your information.Now I am able to create the graph.

    Best Regards,

    Shunnian