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.

TMS320C6678: FFT Library Function

Part Number: TMS320C6678
Other Parts Discussed in Thread: FFTLIB

Hi,

I recently asked a question in the Processor Forum about choosing the right FFT Library. Unfortunately the post got marked as resolved although it did not resolve my issues.

You can find the original post here https://e2e.ti.com/support/processors/f/791/p/787393/2912430#2912430

  1. Are there any fft functions suitable for windowSizes < 64k?
  2. Do the FFTlib functions without "omp" in the function name do not use openMP?
  3. Within my project I use the L2SRAM as explicitly adressed memory (with both data and executable program contents). Does this interfere with the implementation of the fft functions in the FFTlib or the DSPlib? (Do these functions overwrite the L2SRAM)
  4. I also use EDMA form the CSL library in my project. Does this interfere with the EDMA implementation of the FFTlib, which uses functions out of the edma3 library?
  5. Are any fft functions (either DSPlib or FFTlib) inplace capable ?

Thanks in advance for a detailed answer which concerns all five questions.

Best Regards

Paul

  • I've notified the FFT experts.

    In future please do NOT double post, you can always reopen the original thread in e2e simply by posting your additional questions/feedback on the thread. I have closed your old thread for now.

    Best Regards,
    Yordan
  • Hi Yordan,

    Are there any news on this subject?
    Please let me know how long it takes until we can expect an answer.

    Best Regards and thanks in advance

    Paul
  • Paul,

    Sorry about the delay in getting back to you on this topic. For FFT functions < 64K, you can use the DSPLIB that is found in the Processor SDK RTOS for these devices. The API with no OpenMP in the name don`t use OpenMP runtime. You can build/import the unit tests for the functions to see the dependencies. The API guide also indicates which APIs are meant to be multicore implementations.

    The library doesn`t assume any memory. It is upto application developer to provide the linker command file or BIOS platform configuration to provide code/data placement. FFTLIB uses EDMA manager from framework components. EDMA usage, configuration and channels used is in the source located here: fftlib_c66x_2_0_0_2\packages\ti\fftlib\src\common

    The functions which are inplace capable are spiked out in the documentation. For example the following function in DSPLIB is in place capable.
    DSPF_sp_cholesky_in_place. Most FFT functions are not in-place capable which is called out in the assumptions section of the API documentation.

    Regards,
    Rahul
  • The problem about the DSPLIB is that it only supports radix 2, e.g. inputs with length of power 2. In case zero padding is not possible or not appropriate, the DSPLIB cannot be used.

    The FFTLIB in contrary supports any length of inputs. However, the DSPLIB only works for length > 1024 (or 4 * 1024).

    - Why does the FFTLIB only support inputs > 1024?

    - Given a vector of length e.g. 150, how can I FFT (r2c) on the c6678?

    - I found this wiki here http://processors.wiki.ti.com/index.php/MCSDK_HPC_3.x_FFTW_Library but couldn't find the mentioned libraries anywhere. I am using the newest SDK. Where can I download the corresponding libs? That would be extremely helpful.

    Thanks a lot for your answer.

  • Hi Rahul,

    Thanks for your detailed answer!

    This week I started integrating the DSPLIB into our project. While doing so, I stumpled across some problemens refering to the computation of the twiddle factors. The computation as shown in the DSPLIB fftexample yielded incorrect results (Maybe the example could be corrected by TI). With help of this post I managed to obtain better results (I used the twiddle factor generation as it is shown in the unit tests of the DSPLIB fft functions e.g. in DSPF_sp_fftSPxSP_d.c).

    Another helpful document was the application report about the DSPLIB FFT functions.

    To check the correctness of my integration I compared the fft results with our current implementation and Matlabs fft. As one can see in the following example, there are slight differences between the Fourier coefficients.

    (fftlength = 32; input[i] = 0.1 * (0.7 * (i % 131) + (i % 29) ) ; (0 <= i < 32); computed with DSPF_sp_fftSPxSP_r2c(...) )

    MATLAB:

     75.620000000000005 + 0.000000000000000i
    -10.654789833129481 -24.329925890833721i
     -8.559642263582479 - 7.834721154999828i
     -5.675281895689369 - 1.831956695103285i
     -2.719999999999999 + 0.434558441227158i
     -0.377094408728717 + 0.567512373739745i
      0.900078355864959 - 0.450689318585172i
      1.004642386192805 - 1.771532198248551i
      0.180000000000000 - 2.719999999999999i
     -1.086141097627343 - 2.909012827420728i
     -2.238859024982983 - 2.298586870157509i
     -2.843341683553761 - 1.156097124544730i
     -2.719999999999999 + 0.074558441227155i
     -1.984282012028152 + 0.951077365231513i
     -0.981577067299496 + 1.197381293427834i
     -0.143711455435983 + 0.799237038613374i

    TI:

      75.620003 + 0.000000 i
     -10.654790 + 24.329926 i
       -8.559643 + 7.834720 i
      - 5.675283 + 1.831957 i
      -2.720000  - 0.434558 i
      -0.377094  - 0.567513 i
        0.900079 + 0.450688 i
        1.004644 + 1.771532 i
        0.180000 + 2.720001 i
       -1.086141 + 2.909012 i
       -2.238859 + 2.298586 i
       -2.843342 + 1.156097 i
       -2.720001  - 0.074559 i
       -1.984282  - 0.951078 i
      -0.981577  - 1.197381 i
       -0.143711  - 0.799238 i

    My question is: is this slight difference correct or am I doing something not correctly?

    Regards

    Paul

    Note: I changed the definition of PI in the tw_gen(..) function to math.h's M_PI

  • The slight difference is expected as matlab runs on X86 and may be using double precision datatypes so there is some difference due to truncation of the data and from some optimizations done to improve performance.

    Regards,
    Rahul