       INCLUDE 'STDHDR.FOR'
       REAL xdata(0 : maxv), ydata(0 : maxv)
       REAL  smoothdata(0 :maxv), rr
       INTEGER smoothnum, derivnum
       CHARACTER * 80 pathname

       PRINT *, 'smoothnum = (1<= smoothnum <=5) '
       READ *,  smoothnum
       PRINT *, 'derivnum = (0 <= derivnum <= 2)'
       READ *, derivnum
       n = 100
       DO i = 0, n
         CALL Random(rr)
         ydata(i) = 5 * COS(REAL(i) / 10.0) + 2.0 * RR
         xdata(i) = Real(i) + 1.0
       END DO
      pathname = 'c:\for\lib\*.fon'

      CALL InitSEGraphics(-1,pathname)

      CALL SetCurrentWindow(3)
      CALL ClearWindow
      CALL SetAxesType(0, 0)
      CALL SelectColor(2)
      CALL AutoAxes(xdata, ydata, n, 0)
      CALL LinePlotData(xdata, ydata, n, 1, 0)
      CALL TitleWindow('original data')

      CALL SetCurrentWindow(4)
      CALL SelectColor(2)
      CALL SetAxesType(0, 0)
      CALL DataSmoothSg(ydata, n, smoothnum, derivnum, smoothdata)
      CALL AutoAxes(xdata, smoothdata, n, 0)
      CALL LinePlotData(xdata, smoothdata, n, 15, 0)
      CALL TitleWindow('Smoothed Data')
      READ (*,*)
      CALL CloseSEGraphics
      END



