• 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) » C5000 Ultra Low Power DSP » C5000 Ultra Low Power DSP Forum » fftg coprocessor
Share
C5000 Ultra Low Power DSP
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Top 6 Wiki Links
  • C5000 Main Wiki
  • C5000 Software
  • C5515 Boot-Image Programmer
  • CSL (including CSL 3.00)
  • C5000 Connected Audio Framework
  • Porting C5000 Teaching ROM to C5535 eZdsp
  • Forums

    fftg coprocessor

    This question is not answered
    seeni vasan
    Posted by seeni vasan
    on Mar 04 2012 08:35 AM
    Intellectual460 points

    hai

    i am using the ezdsp5505 usbstick when i run the audio filter demo on the stick  the fft works fine when i try to use the fft in the csl and i put  the function  in rom and i run i found that the data is not the same as the one using the example

    C55XX
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Cong Van Nguyen
      Posted by Cong Van Nguyen
      on Mar 04 2012 16:37 PM
      Intellectual940 points

      The two algorithms are different, so their results may not bit-exact match. However, they would produce the "same" results in DSP sense.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • seeni vasan
      Posted by seeni vasan
      on Mar 11 2012 09:03 AM
      Intellectual460 points

      hai cong van nguyen

      i want to design the digital filter in c5505 dsp of low pass filter with cutoff frequency of 10 hz . i has taken the time domain samples of 1024 using adc  with the sampling frequency of 500 hz and i computed this  data with fft and i want to get the filter coefiecients of fc 10hz i dont know how to obtain the filter coefiecients explain me on this .

      with regards

      seeni

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • pho le van
      Posted by pho le van
      on Apr 05 2012 08:20 AM
      Prodigy10 points

      hi Cong Van Nguyen

      my full name Le Van Pho. i guess you are vietnames. i have a problem with FFT use TMS320C5515 , i not good english and programer

      can you help me please? it is important with me,  you explain codes:

       

      #include "stdio.h"
      #include "usbstk5515.h"
      #include "usbstk5515_led.h"
      #include "aic3204.h"
      #include "PLL.h"
      #include "bargraph.h"
      #include "oled.h"
      #include "pushbuttons.h"
      #include "stereo.h"
      #include "dsplib.h"

      Int16 left_input;
      Int16 right_input;
      Int16 left_output;
      Int16 right_output;
      Int16 mono_input;


      #define SAMPLES_PER_SECOND 8000

      /* Use 20 for guitar */
      #define GAIN_IN_dB 0
      unsigned long int i = 0;

      unsigned int Step = 0;
      unsigned int LastStep = 99;

      int j = 0;
      int k = 0;
      int m = 0;
      int display_counter = 0;
      int waveform_counter;
      long delay;

      DATA input_buffer[1024]; /* Must be declared as DATA for dsplib compatibility */

      DATA buffer2[1024];
      int display_buffer[96];
      int buffer1[96];

       
      /*****************************************************************************/
      /* calculate_power()                                                         */
      /*---------------------------------------------------------------------------*/
      /*                                                                           */
      /* Parameter 1: Real term a.                                                 */
      /* Parameter 2: Immaginary term jb.                                          */
      /*                                                                           */
      /* RETURNS: a*a + b*b. Result will always be positive.                       */
      /*                                                                           */
      /*****************************************************************************/

      int calculate_power (int a, int b)
      {

       return ( (int) ( ( (long)a * a + (long) b * b) >> 14) );
      }

      /*****************************************************************************/
      /* calculate_FFT()                                                           */
      /*---------------------------------------------------------------------------*/
      /*                                                                           */
      /* Parameter 1: Latest audio input (real value).                             */
      /* Parameter 2: size of FFT e.g. 128, 512 and 1024 elements.                 */
      /*                                                                           */
      /* RETURNS: None.                                                            */
      /*                                                                           */
      /*****************************************************************************/

      void calculate_FFT(int input, int size)
      {
       static int i = 0;
       static int counter = 0;

       buffer2[i] = input; /* Store as a real value */
       i++;
       buffer2[i] = 0;     /* Store with an imaginary value of 0 */
       i++;
       
       if ( i >= size-1)
       {
         i = 0;
         
         /* Perform complex FFT using N real and N imaginary values */
           
         cfft (&buffer2[0], size/2, SCALE);           

         cbrev(&buffer2[0], &buffer2[0], size/2);     

          for ( j = 0 ; j < 96 ; j ++)
           {
            display_buffer[j] = calculate_power((int) buffer2[2*j], (int)buffer2[2*j+1]);
           }
           
          counter++;
          if ( counter >= 1)
          {
            /* Slow down the number of updates to make display easier to see */    
            counter = 0;    
            oled_display_bargraph( &display_buffer[0]);
          }     
       }
      }


      /* ------------------------------------------------------------------------ *
       *                                                                          *
       *  main( )                                                                 *
       *                                                                          *
       * ------------------------------------------------------------------------ */
      void main( void )
      {
          /* Initialize BSL */
          USBSTK5515_init( );
          
          /* Initialize PLL */
          pll_frequency_setup(120);

          /* Initialise hardware interface and I2C for code */
          aic3204_hardware_init();
          
          /* Initialise the AIC3204 codec */
          aic3204_init();
          
          /* Turn off the 4 coloured LEDs */
          USBSTK5515_ULED_init();
          
          /* Initialise the OLED LCD display */
          oled_init();
          SAR_init();
          /* Flush display buffer */
          oled_display_message("                 ", "                   ");
          
          printf("\n\nRunning Project Spectrum Analyser\n");
          printf( "<-> Audio Loopback from Microphone In --> to Headphones/Lineout\n\n" );

          /* Setup sampling frequency and 30dB gain for microphone */
          set_sampling_frequency_and_gain(SAMPLES_PER_SECOND, GAIN_IN_dB);

          oled_display_message("Application 20     ", "Spectrum Analyser  ");

          /* New. Add descriptive text */
          puts("\n Bargraph at 6dB intervals");
          puts("\n Press SW1 for DOWN, SW2 for UP, SW1 + SW2 for reset\n");
          puts(" Step 1   = Straight through, no signal processing. Set levels");
          puts(" Step 2   = Waveform view");
          puts(" Step 3   = FFT 1024 Display. Calculate power and display as bargraph");
          puts(" Step 4   = FFT 512 Display. Calculate power and display as bargraph");

            
          /* Default to XF LED off */
          asm(" bclr XF");
          
           for ( i = 0  ; i < SAMPLES_PER_SECOND * 600L  ;i++  )
           {

           aic3204_codec_read(&left_input, &right_input); // Configured for one interrupt per two channels.
         
           mono_input = stereo_to_mono(left_input, right_input);
           
           Step = pushbuttons_read(4);
               
            if ( Step == 1 )
              {
               if ( Step != LastStep )
                {
                 oled_display_message("STEP1 No Processing", "Set Levels         ");
                 LastStep = Step;

                }    
               left_output = left_input;      // Straight trough. No processing.
               right_output = right_input;

              }
            else if ( Step == 2)
              {
                if ( Step != LastStep)
                {
                 oled_display_message("STEP2              ", "      Waveform View");
                 LastStep = Step;
                 display_counter = 0;
                 waveform_counter = 0;
                }

               if ( display_counter < 8000)
                 {
                  display_counter++;
                 }
               
               if (display_counter >= 8000)
                 {
                     buffer1[k] = mono_input;
                  k++;
              
                  if ( k >= 96)
                   {
                     k = 0;    
                     waveform_counter++;
                     if ( waveform_counter >= 6)
                       {
                         waveform_counter = 0;    
                         oled_display_waveform(&buffer1[0]);
                         delay = 0xFFFFFF;
                         while ( delay--)
                          {
                           /* Wait */    
                          }   
                       }  
                   }
       
                 }
       
              }
            else if ( Step == 3)
              {
                if ( Step != LastStep)
                {
                 oled_display_message("STEP3              ", "   FFT 1024 Display");
                 LastStep = Step;
                 display_counter = 0;
                }    
               
               if ( display_counter < 8000)
                 {
                  display_counter++;
                 }
               
               if (display_counter >= 8000)
                 {  
                    calculate_FFT(mono_input, 1024);
                 }
              }  
            else if ( Step == 4)
              {
                if ( Step != LastStep)
                {
                 oled_display_message("STEP4              ", "    FFT 512 Display");
                 LastStep = Step;
                 display_counter = 0;
                }    

               if ( display_counter < 8000)
                 {
                  display_counter++;
                 }
               
               if (display_counter >= 8000)
                 {  
                    calculate_FFT(mono_input, 512);
                 }                 

              }    
                    
              
           aic3204_codec_write(left_output, right_output);

           if ( Step == 1)
            {
             /* Only display bargraph when setting up. Distracting otherwise */    
             bargraph_6dB(left_output, right_output);
            }
           }

         /* Disable I2S and put codec into reset */
          aic3204_disable();

          printf( "\n***Program has Terminated***\n" );
          
          oled_display_message("PROGRAM HAS        ", "TERMINATED        ");
          
          SW_BREAKPOINT;
      }


      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