home *** CD-ROM | disk | FTP | other *** search
/ The Best of the Best / _.img / 01218 / data_fft.bas < prev    next >
BASIC Source File  |  1993-08-30  |  552b  |  19 lines

  1. CONST nsamp = 128      ' number of samples
  2. CONST fs = 40          ' sample frequency Hz
  3. CONST w = 6.283185307# ' w=2*pi
  4. DIM n AS INTEGER       ' sample #
  5. DIM t AS SINGLE        ' time of sample
  6.  
  7. OPEN "C:\WINPLOT\DATA_FFT.CSV" FOR OUTPUT AS #1  ' Open your output file
  8.  
  9. FOR n = 1 TO nsamp
  10.   t = t + 1 / fs   ' t=1/f
  11.   LOCATE 1, 1: PRINT n;                          ' display progress
  12.   PRINT #1, t; ",";                              ' output X axis
  13.   PRINT #1, SIN(5 * w * t) + 1 * SIN(8 * w * t) ' output Y axis
  14. NEXT n
  15.  
  16. CLOSE #1
  17. END
  18.  
  19.