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.

"Multi-Pass" FFT using DSPF_sp_fftSPxSP API.

Hi,

Ti has introduced FFT tech called "Multi-Pass" using DSPF_sp_fftSPxSP API. 
Please take a look in the following manual. 

http://www.ti.com/lit/an/spra947a/spra947a.pdf
3.3.3.2 DSPF_sp_fftSPxSP Multi-Pass Implementation

It says that the following code is required to apply multi-pass FFT:

==================
/* stage one */
DSPF_sp_fftSPxSP(N, &x[0], &w[0], y, brev, N/16, 0, N);
/* stage two */
for(i=0;i<16;i++)
{
DSPF_sp_fftSPxSP(N/16, &x[2*(15−i)*N/16], &w[2*N*15/16], &y[0], brev, radix,15−i)*N/16, N);
}
==================

Now, one of my customers actually tried this and got wrong result in FFT:

=============
n=2048,float x[2048*2],float y[2048*2],float w[2048]

// stage one
DSPF_sp_fftSPxSP( n, &x[0], &w[0], y, brev, n/16, 0, n );

// stage two
for( i=0;i<16;i++){
     DSPF_sp_fftSPxSP( n/16, &x[2*(15-i)*n/16], &w[2*n*15/16], &y[0], brev, 2, 2*(15-i)*n/16, n );
}
============

And got working with the following modifications:

==================
n=2048,float x[2048*2],float y[2048*2],float w[2048]

// stage one
DSPF_sp_fftSPxSP( n, &x[0], &w[0], y, brev, n/16, 0, n );

// stage two
for( i=15;i>=0;i--){
      DSPF_sp_fftSPxSP( n/16, &x[2*(15-i)*n/16], &w[2*n*15/16], &y[0], brev, 2, 2*(15-i)*n/16, n );

============

Is this expected behavior ? 
The same issue had been posted in : 
http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/t/125465.aspx

But no valid answer is present there.

Best Regards,
Kawada 

  • I posted this thread to C67x Single Core DSP Forum, but re-routed to here...
    I tried twice, the result was same. Could you please move this thread to appropriate forum ?
    This is not for BIOS, but for DSPLIB.

    Best Regards,
    Kawada 

  • Hi Kawada,

    Please refer the technical support section of DSPLIB release notes. As per that it has been moved to BIOS Forum.

    Technical Support : Questions regarding the DSPLIB library should be directed to the Texas Instruments BIOS E2E Forum. Please include the text "DSPLIB" in the title and add "C674x" and "DSPLIB" tags to your post.

    Thanks.

    Regards,

    G. Shankari

  • Hi G. Shankari,

    Thanks for your interest.
    OK, I'll wait for the answer here...
    Thank you in advance.

    Best Regards,
    Kawada 

  • Hi Kawada,

    Do you know the version of DSPLIB your customer is using? Is this for C674x or C66x? Thank.

    regards,

    Yimin

  • Hi Yimin,

    My customer is using the following DSPLIB.
    http://www.ti.com/tool/sprc121

    This is for c67x core and they are using this on C6713.
    Now I'm trying to get the source code to reproduce the issue.
    Once I confirm the issue at my side, I'll be back here with the details.

    Best Regards,
    Kawada 

  • Hello,

    I created the environment to reproduce the issue.

    6675.DSPLIB_MultiPassFFT.zip

    The basic problem looks like that the result of 2048 points FFT can be wrong depends on the inputs.
    I'm not very sure this is expected or not. Could you please give me your comments on this ? 

    Environment

    • CCSv5.3 without SYS/BIOS
    • DSPLIB for C67x (http://www.ti.com/tool/sprc121). All required header files and library have been included to the project.
    • C67x CCS simulator can be used to confirm the issue.
    Usage
    • I created 4 experiments. Select EXPERIMENT at the top of main.c and then build/run the executable :

    //Enable single pass FFT with the tone created SinGenerator (1000Hz + 8345Hz sizewave @ 48khz)
    // ==> You will see the correct result in result_array_real/img buffer
    #define EXPERIMENT_0 0

    //Enable multi pass FFT with the tone created SinGenerator (1000Hz + 8345Hz sizewave @ 48khz), incremental process at "for"
    // ==> You will see the correct result in result_array_real/img buffer
    #define EXPERIMENT_1 1

    //Enable multi pass FFT with the tone created sin()/cos() math function, incremental process at "for"
    // ==> You will see the wrong result in result_array_real/img buffer
    #define EXPERIMENT_2 2

    //Enable multi pass FFT with the tone created sin()/cos() math function, decremental process at "for"
    // ==> You will see the wrong result in result_array_real/img buffer, but it looks like better than EXPERIMENT_2. In this case, we saw "real" part in result_array_img and "img" part in result_array_real.
    #define EXPERIMENT_3 3


    #warn select EXPERIMENT here!!
    #define EXPERIMENT EXPERIMENT_0

    • When the execution is finished, view the result_array_real/img via Tools->Graph and verify if the result is correct or not.
    Best Regards,
    Kawada

     


  • Hello,

    I hope DSPLIB specialist is looking into this... Thank you in advance !

    Best Regards,
    Kawada

     

  • Hi Kawada,

    Yes, This appears to be a documentation issue and the loop that you have highlighted in your first post is the right way to implement the multipass. If you look at the earlier example  in the document of N=1024 and radix =4  with 4 passes and compared it to the second example N = 2048 and radix = 2, with 16 passes and it does appear to be a typo in the for loop.

    This is unfortunately a very old doc so it may take some time to get updated. Thanks for your patience and to point this out.  We hope that this post will help other community members aware of the issue until this issue is fixed in the docs.

    Regards,

    Rahul

  • Hi Rahul, 

    Thank you for your answer. But unfortunately I need more clarifications for multi-pass FFT implementation and its result.
    Please take a look the following slide. My questions are colored in RED.

    6330.e2e_fft.pdf

    4670.DSPLIB_MultiPassFFT.zip

    Best Regards,
    Kawada