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.

DM3730 + DSPLib + DSP-for-dummies Framework

Other Parts Discussed in Thread: DM3730

Hello All,

I'm currently working with a DM3730 processor to get an FFT working on the embedded TMS320C64x+ DSP. I've correctly install DSP-for-Dummies and tested that I can indeed communicate with the DSP. I've run into a problem where I believe the DSPLib function DSP_fft16x16() isn't working for me. I'm testing the FFT with the following complex input:

1+j0, 0+j0, 0+j0, 0+j0, 0+j0, 0+j0, 0+j0, 0+j0,

0+j0, 0+j0, 0+j0, 0+j0, 0+j0, 0+j0, 0+j0, 0+j0

I would expect the following output:

0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0, 0.0625 + j0

But, I get junk output data instead.

Does anyone have any experience integrating DSPLib with DSP-for-Dummies for the DM3730?

  • Hi Donald,

    Could you share the the source code which you try to execute?

    Also read the description of the DSP_fft16x16r function and examples in the linked below User's guide.

    http://www.ti.com/lit/ug/sprueb8b/sprueb8b.pdf

    BR

    Tsvetolin Shulev

  • Hello Cvetolin,

    I will gladly post my source code.  Here are my pastebin links to my source:

    Makefile: http://pastebin.com/ZuXMrs4v

    ARM-Side Code:

    dummy_arm.h: http://pastebin.com/YHGUHmL9

    dummy_arm.c: http://pastebin.com/vCKrEEX5

    DSP-Side Code:

    dummy_dsp.h: http://pastebin.com/VEwH6bPd

    dummy_dsp.c: http://pastebin.com/B731pKXx

    twiddle_32_le.h: http://pastebin.com/QX7V4w5w

    Also, I took a look at the user guide, but I've been having trouble integrating the DSPLib with DSP-for-dummies.  If it helps, I'm using DSPLib version 3.4.0.0 that I obtained from here: http://www.ti.com/tool/sprc265 (I downloaded the C64XPLUS-DSPLIB C64x+ DSP Library software).

  • Cvetolin,

    Have you had a chance to look at the source code I provided to see what I might be doing wrong?
  • Donald,

    Could you print the values of ((int16_t *) output_buffer->data)[2*i+1] and ((float *) output_buffer->data)[2*i+1] after print the output and share the results. I guess that when casting to int16_t some data has been lost.

    BR
    Tsvetolin Shulev
  • Tsvetolin,

    Here is the data from the output_buffer:

    $ sudo ./dummy 

    Setting up dsp

    info: create_node: dsp node created

    Calling dsp_node_run

    Calling dmm_buffer_new

    info: setup_dmm_buffers: dsp node running

    Calling dmm_buffer_allocate

    Testing DSP FFT...

    Input

    (1 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) 

    (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) 

    (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) 

    (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) 

    Done!

    Output

    (int16_t *) cast output buffer

    (0.031250 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) 

    (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) 

    (0.031250 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) 

    (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) 

    (float *) cast output buffer

    (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) 

    (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) 

    (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) 

    (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) (0.000000 + j0.000000) 

    info: destroy_node: dsp node deleted

    info: dsp_finish: dsp node terminated

    $

    Although the output is different, it's still not the output I would expect given the input.

     

    -Donald

  • So I've made a little progress. In my dummy_dsp.c file, in the function compute_ft() if I add the following lines of bolded code before calling DSP_fft16x16()

    DSP_blk_move(in, x_16x16, 2*size);

    DSP_blk_eswap16(x_16x16, NULL, 2*size);

    // Compute the FTT

    DSP_fft16x16(w, 2*size, x_16x16, y_16x16);

    // Move the FFT output to the output buffer

    DSP_blk_move(y_16x16, out, 2*size);

    I seem to yield better results. Here's the output of this code change.

    $ sudo ./dummy 

    Setting up dsp

    info: create_node: dsp node created

    Calling dsp_node_run

    Calling dmm_buffer_new

    info: setup_dmm_buffers: dsp node running

    Calling dmm_buffer_allocate

    Testing DSP FFT...

    Input

    (1 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) 

    (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) 

    (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) 

    (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) (0 + j0) 

    Done!

    Output

    (int16_t *) cast output buffer

    (7237 + j7805) (-532 + j-1757) (9789 + j9649) (-28869 + j9128) (-2527 + j-1353) (1564 + j-605) (-1044 + j-1857) (-1864 + j149) 

    (291 + j1083) (-2482 + j-1097) (-1818 + j343) (-466 + j-791) (233 + j148) (-210 + j-103) (136 + j99) (377 + j437) 

    (-4274 + j5566) (-18500 + j3099) (7102 + j1496) (9926 + j19105) (-437 + j3251) (-1424 + j-3039) (-3404 + j-2997) (-3469 + j4702) 

    (-49 + j-199) (-332 + j-1509) (-1342 + j3351) (-1902 + j-649) (229 + j20) (96 + j465) (-2 + j287) (712 + j-2) 

    info: destroy_node: dsp node deleted

    info: dsp_finish: dsp node terminated

    So, it appears to be an endianess issue.  Although, the results still don't make sense given the input. I've tried endian swapping the output buffer too, but still I get similarly bad results. Not the expected output.  I'm not sure what I'm doing wrong (or what I'm not doing) that could be giving me grief.