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.

Issue with using DSP_fft16x16() provided in DSPLIB 3.1.0.0 (C64x+ DSP, little-endian) with CCSv5 & SYS/BIOS v6

Hello,

I am trying to run a basic sanity test for DSP_fft16x16() but running into issues. Note that:


-I have included the following header file in my code:
C:\ti\dsplib_c64Px_3_1_0_0\inc\dsplib.h"

-and have linked the follwing library:
C:\ti\dsplib_c64Px_3_1_0_0\lib\dsplib.a64P


Here is my simple test code:

#pragma DATA_ALIGN(xx, 8);
int16 xx[] = {4000, 2000, 16384, -8192, 0, 21000, 0, -4000, 10000, 8192, 2000, -24000, 16384, 0, 0, 8192};
#pragma DATA_ALIGN(yy, 8);
int16 yy[16];
#pragma DATA_ALIGN(w_16x16, 8);
int16 w_16x16[16];
gen_twiddle_fft16x16(w_16x16, 8);
DSP_fft16x16(w_16x16, 8, xx, yy);


Input xx[0] = 4000
Input xx[1] = 2000
Input xx[2] = 16384
Input xx[3] = -8192
Input xx[4] = 0
Input xx[5] = 21000
Input xx[6] = 0
Input xx[7] = -4000
Input xx[8] = 10000
Input xx[9] = 8192
Input xx[10] = 2000
Input xx[11] = -24000
Input xx[12] = 16384
Input xx[13] = 0
Input xx[14] = 0
Input xx[15] = 8192

xw_16x16[0] = 0
xw_16x16[1] = 32767
xw_16x16[2] = 23170
xw_16x16[3] = 23170
xw_16x16[4] = 0
xw_16x16[5] = -32767
xw_16x16[6] = -32767
xw_16x16[7] = 0
xw_16x16[8] = 0
xw_16x16[9] = 32767
xw_16x16[10] = 23170
xw_16x16[11] = -23170
xw_16x16[12] = 0
xw_16x16[13] = 0
xw_16x16[14] = 0
xw_16x16[15] = 0

yy[0] = 13864
yy[1] = 9910
yy[2] = 13384
yy[3] = -14596
yy[4] = 0
yy[5] = 0
yy[6] = 0
yy[7] = 0
yy[8] = 1136
yy[9] = 282
yy[10] = -15768
yy[11] = 3788
yy[12] = 0
yy[13] = 0
yy[14] = 0
yy[15] = 0


Isuues:
========
1. First of all, gen_twiddle_fft16x16() is not part of the library and I had to add to source files from the following locaiton: C:\ti\dsplib_c64Px_3_1_0_0\packages\ti\dsplib\src\DSP_fft16x16\c64P

2. Output is not correct and completely different than what I get from matlab. I dont think its a scaling issue. Here is the output from matlab:

>> inp=[4000+2000i 16384-8192j 21000j -4000j 10000+8192j 2000-24000j 16384 8192j]

inp =

  1.0e+004 *

  Columns 1 through 5

   0.4000 + 0.2000i   1.6384 - 0.8192i        0 + 2.1000i        0 - 0.4000i   1.0000 + 0.8192i

  Columns 6 through 8

   0.2000 - 2.4000i   1.6384                  0 + 0.8192i

>> fft(inp,8)

ans =

  1.0e+004 *

  Columns 1 through 5

   4.8768 + 0.3192i   2.7728 + 1.9820i  -3.8768 - 2.9192i  -3.4614 - 5.2546i   1.2000 + 5.9192i

  Columns 6 through 8

   0.2272 + 0.0564i   3.4000 + 0.7576i  -1.9386 + 0.7394i

>>

 

Am I missing something or not using the APIs correctly? Please reply ASAP.


Thanks.

Adeel

  • Hi,

    The size of the FFT that DSP_fft16x16() supports is equal or greater than 16.  Please see DSPLIB.chm under dsplib_c66x_3_1_0_0\packages\ti\dsplib\docs\doxygen.

    Also please refer to the following for using appropriate version of the library.

    Library Directory

    The Library directorywill contain all libraries required to integrate DSPLIB into a system.
    DSPLIB Library Naming Convention
    Library NameTargetObject typeEndianess

    dsplib.a66 C66x DSP COFF Little
    dsplib.a66e C66x DSP COFF Big
    dsplib.ae66 C66x DSP ELF Little
    dsplib.ae66e C66x DSP ELF Big

     

     -  Xiaohui