      INCLUDE 'STDHDR.FOR'
      REAL  xdata(0 : maxv), ydata(0 : maxv), tdata(0 : maxv), rr
      INTEGER n, i



      n = 128
      DO i = 0, n
        CALL Random(rr)
        xdata(i) = 6.0 * COS(pi*REAL(i)/(19.0+rr))+
     +              2.5*COS(pi*REAL(i)/32.0)
        ydata(i) = 0.0
        tdata(i) = REAL(i) + 1
      END DO
      CALL InitSEGraphics(-1, 'C:\FOR\LIB\*.FON')

      CALL SetCurrentWindow(3)
      CALL ClearWindow
      CALL BorderCurrentWindow(4)
      CALL SetAxesType(0, 0)
      CALL SelectColor(2)
      CALL AutoAxes(tdata, xdata, n, 0)
      CALL LinePlotData(tdata, xdata, n, 1, 0)
      CALL TitleWindow('Original data')

      CALL FFTCalc(xdata, ydata, n)

      CALL SetCurrentWindow(4)
      CALL ClearWindow
      CALL BorderCurrentWindow(4)
      CALL SelectColor(2)
      CALL SetAxesType(0, 0)
      CALL AutoAxes(tdata, xdata, n / 2, 0)
      CALL LinePlotData(tdata, xdata, n / 2, 3, 0)
      CALL TitleWindow('FFT Data')

      READ (*,*)
      CALL CloseSEGraphics
      END


