home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / fft32_a.zip / FFT.C < prev    next >
C/C++ Source or Header  |  1995-01-21  |  1KB  |  45 lines

  1. /* pcfft.c by J.G.G. Dobbe - Test program written in Turbo C/Borland C
  2.  *          that used the C or assembler version of FFT. It depends on
  3.  *          the type of FFT object file whether the C or ASM version is
  4.  *          linked in. In both cases, the same FFT.H file is used.
  5.  */
  6.  
  7. #define INCL_BASE
  8. #include <os2.h>
  9. #include <stdio.h>
  10. #include "pcfft.h"
  11.  
  12. #define SIZE 1024
  13. #define powr 10
  14. /* The power passed to Fft is the base 2 logarithm of the size
  15.  * for example, if SIZE is 64 powr = 6, since 2 to the 6th power = 64
  16.  */
  17. float re[SIZE];
  18. float im[SIZE];
  19. DATETIME datetime;
  20.  
  21. int main()
  22. {
  23.     int i;
  24.     long    time();
  25.     long    starttime;
  26.     long    benchtime;
  27.     for( i= 0; i< SIZE; i++)
  28.         {
  29.             re[i] = 0.0;
  30.             im[i] = 0.0;
  31.         }
  32.     re[0] = 100.0;
  33.     printf("start \n\r");
  34.     DosGetDateTime(&datetime);
  35.     printf("Min: %u Sec: %u Hundreths: %u\n\r",datetime.minutes,datetime.
  36.             seconds,datetime.hundredths);
  37.     Fft(re,im,powr,1);
  38.     DosGetDateTime(&datetime);
  39.     printf("Min: %u Sec: %u Hundreths: %u\n\r",datetime.minutes,datetime.
  40.             seconds,datetime.hundredths);
  41.     printf("finish \n\r");
  42.     Fft(re,im,powr,-1);
  43.     return 0;
  44. }
  45.