• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C6000 Multicore DSP » Keystone Multicore Forum (C66, 66A, AM5) » About DSPF_sp_fftSPxSP in 6678?
Share
C6000 Multicore DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Training Available
TI provides self-paced online training that introduces the primary components of the KeyStone II family of SoC devices.

  • KeyStone II SoC Overview >
  • KeyStone II Software Overview >
  • KeyStone II ARM Cortex-A15 Corepac Overview >
  • More Information >
  • Check out
    Multicore Mix blog
    • $core_v2_blog.Current.Name

      OpenMP - All aboard!

      Posted 9 hours ago
      by Debbie Greenstreet
      With so many end products today relying on multicore DSPs for...
    • $core_v2_blog.Current.Name

      A look back: Two years of Multicore Mix

      Posted 1 day ago
      by Lauren Reed1
      A big thank you to everyone who participated in our contest last...
    • $core_v2_blog.Current.Name

      It’s our second anniversary, but you get the present!

      Posted 8 days ago
      by Lindsey Bare
      It’s hard to believe it’s already been two years...

    About DSPF_sp_fftSPxSP in 6678?

    About DSPF_sp_fftSPxSP in 6678?

    This question is not answered
    may may92122
    Posted by may may92122
    on Jan 09 2012 21:36 PM
    Expert1030 points

    When I used this function to calculate fft, I got wrong result:

    void FFTTEST(float * real, float * fftOut)

    {

           int i = 0;

          float fftIn[512]={0.0};

         DSPF_sp_fftSPxSP(256,&fftIn[0],&wforFFT[0],fftOut,brev,4,0,256);

    } 

    real is a floating-point array of 256 real data, wforFFT is a floating-point array of length 512 created by tw_genSPxSPfft , brev is a 64-entry bit-reverse data table, and fftOut is a floating-point array of length 512.

    Would somebody tell me how to get the right fft result?

    Thanks a lot,

    C6678 6678l
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Alberto Chessa
      Posted by Alberto Chessa
      on Jan 10 2012 06:10 AM
      Genius3740 points

      Maybe there is a clerical error: the input data are not copied in the fftIn array as input to the fft function. Also pay attention to the data aligament: fft requires 8 bytes in, out, twiddle and it overwrites its inputs.

       enum { MAX_FFT =512};

      #pragma DATA_ALIGN(8)

      static float wforFFT[MAX_FFT] ;

      #pragma DATA_ALIGN(8)

      static float fftIn[MAX_FFT];

      #pragma DATA_ALIGN(8)

      static float fftOut[MAX_FFT];

      void FFTEST(float* real_in, float* real_out)  //Warning: static work buffers - non reentrant

      {

        memcpy(fftIn, real_in, sizeof(float)*256;

        DSPF_sp_fftSPxSP(256,&fftIn[0],&wforFFT[0],fftOut,brev,4,0,256);  //brev can be 0 for the C66xx version

        memcpy(real_out, fftOut, sizeof(float)*256);

      }


      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Chad Courtney
      Posted by Chad Courtney
      on Jan 10 2012 07:39 AM
      Mastermind22595 points

      May,

      If I read correctly, you want to do a 256 pt FFT, using real data as input.  This routine is a complex FFT.  It expects complex data and will give complex output.  For 256 point FFT it expects 256 complex inputs and will produce 256 complex outputs (that's 512 input points and 512 outputs.)  You can use this w/ real inputs, but you will get complex outputs.  You'd need to have the input array in the form of real, imag,, real, imag., ... w/ the imaginary values set to 0.

      Best Regards,

      Chad

      PS: Here's a small cut and paste form the description in the header of the file.

      /* NAME                                                                    */
      /*     DSPF_sp_fftSPxSP -- Single Precision floating point mixed radix          */
      /*     forwards FFT with complex input                                     */

      ------------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Dmitry Cooper
      Posted by Dmitry Cooper
      on Apr 25 2012 03:15 AM
      Prodigy100 points

      Chad,

       I have this function destroys the data in the input buffer. So it should be?

      Dmitry.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Chad Courtney
      Posted by Chad Courtney
      on Apr 25 2012 09:53 AM
      Mastermind22595 points

      Dmitry,

      I don't understand what you're asking, please clarify the question.  If it's not related to the above thread, please start a new thread.

      Best Regards,
      Chad

      ------------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Alberto Chessa
      Posted by Alberto Chessa
      on May 02 2012 04:32 AM
      Genius3740 points

      Dmitry Cooper

      Chad,

       I have this function destroys the data in the input buffer. So it should be?

      Dmitry.

      Yes, the fft function destroy the input. See my previous reply, where I posted an example of use (the input data are copied in a buffer, also to respect the 8 bytes aligned constrain on the input and output buffer).

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use