home *** CD-ROM | disk | FTP | other *** search
/ PC-Test Pro / PCTESTPRO.iso / benchmrk / fft / entp / readme.txt < prev   
Encoding:
Text File  |  1995-07-31  |  4.8 KB  |  137 lines

  1.       Document:  FFT.ZIP
  2.     File Group:  General Resource
  3.  Creation Date:  07/27/95
  4.  Revision Date:  07/31/95
  5.  
  6.          Title:  FFT Processor Benchmark, Scott Taylor
  7.       Keywords:  BENCHMARK PERFORMANCE FFT PROCESSOR CPU TAYLOR
  8.  
  9.       Abstract:  FFT is a common benchmark used for digital signal
  10.                  processors.  It allows comparisons of relative performance
  11.                  between similar and entirely unlike platforms (CPU types).
  12.                  The FFT routine uses many instructions including indirect
  13.                  addressing and floating point plus test branch at the end of
  14.                  the loops.
  15.  
  16.                  Submitted by: Scott D. Taylor, DSP Systems Inc, 75022,3707
  17.  
  18.  
  19.      Revisions:  07/31/95  Added "Unable to Allocate" error definition
  20.  
  21.   =========================================================================
  22.  
  23. Performing an FFT is a common benchmark used for digital signal processors.
  24. It allows comparisons of relative performance between similar and entirely
  25. unlike platforms (CPU types). The FFT routine uses many instructions
  26. including indirect addressing and floating point plus test brach at the end
  27. of the loops.  The number of floating point calculations performed can be
  28. determined by the following equation:
  29.  
  30.  T * n/2 * 10
  31.  
  32.  n is the number of points in the FFT, which must be a power of 2. T is
  33.  the number to which 2 is raised to equal n, ie. 2**T = n. The *10 is
  34.  because the floating point calculation is a complex number which takes 6
  35.  of the 10 and then the two adds and subtracts which adds four more.
  36.  
  37. So, for a 1024 point FFT, there are 10 * 1024/2 * 10 = 51200 floating
  38. point instructions executed. There is also one indirect addressing
  39. operation involved in the fetch of each floating point number in an array,
  40. of which 4 are involved each time through the loop plus hte loop overhead
  41. and the local variables. The over all result is that there are more
  42. integer instructions executed, but there is a high degree of floating
  43. point, probably 30-40% depending upon the compiler and CPU instruction
  44. set.
  45.  
  46. Also, in order to get the FFT to fit in the 640k DOS allows, some changes
  47. have been made to the standard algorithm. A SIN and COS are done in the rapid
  48. execution loop. If an error message of the nature "Unable to allocate ..." or
  49. something similar occurs, taht is an indication that there is not enough free
  50. memory to run the entire suite of tests. The results from teh portion that
  51. does finish are accurate however. Use MEM at the DOS prompt to determine how
  52. much free memory there is. The program requires around 612kB. Using DOS 6.2
  53. and the supplied Config.Sys file there should be sufficient memory to run the
  54. program.  If special drivers for disk drives of video adapters are required,
  55. running from a standalone bootable floppy may help.
  56.  
  57. The FFT program has been optimized for size to allow the largest possible
  58. array size to be used. As a result the table is generated by using a batch
  59. file to pass the parameters to the program. A sample batch file has been
  60. included as well as a Config.sys file which provides enough memory for the
  61. program to run. Most systems can run with up to a 32k point FFT without
  62. modifying the Config.Sys. The program will run under Windows NT in a DOS
  63. window. It will probably run under OS/2 but has not been tested.
  64.  
  65.     Sample batch file:
  66.  
  67.     fft  5 2048 h >result.txt
  68.     fft  6 1024  >>result.txt
  69.     fft  7 512   >>result.txt
  70.     fft  8 256   >>result.txt
  71.     fft  9 128   >>result.txt
  72.     fft 10 64    >>result.txt
  73.     fft 11 32    >>result.txt
  74.     fft 12 16    >>result.txt
  75.     fft 13 8     >>result.txt
  76.     fft 14 4     >>result.txt
  77.     fft 15 2     >>result.txt
  78.     fft 16 1     >>result.txt
  79.  
  80.  
  81. Config.Sys for DOS 6.2. A similar file must be used with other versions.
  82.  
  83.     DEVICE=C:\DOS\HIMEM.SYS
  84.     DEVICE=C:\DOS\EMM386.EXE AUTO
  85.     dos=UMB
  86.     dos=HIGH
  87.  
  88.  
  89. For those interested here is the loop doing 90% of the operations:
  90.  
  91.   d = 1;
  92.   index = 1;
  93.   while (index <= t)
  94.   {
  95.   d2 = d + d;
  96.   for (j=0; j<d; j++)
  97.   {
  98.       REAL32 temp_real, temp_imag;
  99.       INT k, jk, jkd, jnd2;
  100.       k = 0;
  101.       jnd2 = (j * n) / d2;
  102.  
  103.       while (k < n)
  104.       {
  105.       jk = j + k;
  106.       jkd = jk + d;
  107.  
  108.       [a SIN and COS call go here (I do not have actual code)]
  109.       exp_real = SIN(...)
  110.       exp_imag = COS(...)
  111.  
  112.       temp_real = (kreal[jkd] * exp_real) -
  113.           (kimag[jkd] * exp_imag);
  114.       temp_imag = (kimag[jkd] * exp_real) +
  115.           (kreal[jkd] * exp_imag);
  116.  
  117.       kreal[jkd] = kreal[jk] - temp_real;
  118.       kimag[jkd] = kimag[jk] - temp_imag;
  119.  
  120.       kreal[jk] = kreal[jk] + temp_real;
  121.       kimag[jk] = kimag[jk] + temp_imag;
  122.  
  123.       k += d2;
  124.       }
  125.   }
  126.  
  127.   index++;
  128.   d = d2;
  129.  
  130. Comments and questions can be forwarded to...
  131.  
  132.    Scott D. Taylor
  133.    DSP Systems, Inc.
  134.    CIS 75022,3707
  135.  
  136.  
  137.