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.

DSPLIB FFT rounding problem

Hi. im using dm6437 board. i'm using dsplib DSP_fft16x16 fft function. i compared matlab fft result and dsp fft result. results are like these :

 

 matlab fft : 496.00       ,    -16.00 + 162.00i   ,   -16.00 + 80.00i   ,  -16.00 + 53.00i    ,  -16.00 + 39.00i     , -16.00 + 30.00i

dsp fft : (496.000000,0.000000),(-16.000000,160.000000),(-16.000000,80.000000),(-16.000000,52.000000),(-16.000000,40.000000),(-16.000000,24.000000)

i understand DSP_fft16x16 function is making rounding it's OK .but  i think this rounding that in somewhere is big.  is there anything that i have to do for this or i miss something.

Or fft function result must be like that?

 

Thanks!

  • Ayhan, can you confirm if the issue is resolved or you still have the issue?

    Gagan

  • i couldnt solve rounding problem gagan. and i wanna add something. between matlab fft result and dsp fft result there is a scale difference. for example. dsp fft result for 16 points 60 matlab fft result is 120, and for 32 point dsp result is 80 matlab fft result is 320 ext.

    how can i solve this?

  • For removing scaling in the code, please see here:

    http://processors.wiki.ti.com/index.php/FFT_Implementation_With_No_Data_Scaling

     

    You may also choose to use 16x32 or 32x32 FFT.

    Note, 16x16 fft is fixed point implementation and there will be differences b/w the floating point FFT that Matlab implements

     

    Regards,

    Gagan

     

     

  • Dear Gagan:

    Hi!

     

    Now I use dsplib in my davinci DM6446  project. I have some questions.

    1.16x16 fft How can I get the correct output? The output is short t precision or r Q.15 format. How can I understand it?

    2.I input a 256*256 's picture (GRAY every pix has a 8-bits) . I input the 256*256 picture in the real components and the imaginary components are all 0. And I watch the output .The output : the real components and the imaginary components  all have 16-bits .  How  can I get the correct results? How can I transform it correctly?

     

    Regards,

    Tiny