C                       1
C *** WAVE READ, FOURIER TRANS., AND AMPLITUDE SPEC. PLOT
C
      PROGRAM MWVFOUR
C
C PARAMETER
C *** MWV    : WAVE AMPLITUDE DATA IN MAIN PROGRAM DIMENSION
C            : IF MWV > 2**13(=8192), CAN NOT USE IN SUBROUTINE !!!
C READ DATA FROM FILE
C *** TITL   : TITLE OF EACH CHANNEL
C *** WV     : WAVE AMPLITUDE DATA
C *** NWV    : WAVE DATA NUMBER
C *** DT     : DELTA TIME ( SEC )
C            : DURATION = (NWV-1)*DT IN PLOTTER, NWV*DT IN FFT
C DATA FOT PLOTTER
C *** FOUR(I): FOURIER COEFFICIENTS OR SPECTRUM
C            : FOURIER SPECTRUM = FOURIER COEFFICIENTS * DURATION/2.0
C
      PARAMETER(MWV=32800)
      CHARACTER TITL*50
      DIMENSION WV(MWV)
      COMPLEX*8 FOUR(MWV)
C
C *** WAVE DATA READ AND FOURIER COEFF. TRANS. ***
C
      CALL WVREAD(TITL,WV,NWV,MWV,DT)
      CALL WVFOUR(WV,NWV,MWV,FOUR,NFAST)
C
C *** TRANS. FROM FOURIER COEFF. TO AMPLITUDE SPECTRUM ***
C
      DUR=FLOAT(NFAST)*DT
      DO 100 I=1,NFAST
      WV(I)=CABS(FOUR(I))*DUR/2.0
  100 CONTINUE
C
C *** PLOTTER DATA OUTPUT ***
C
      FOM=0.0
      DOM=6.2831853070/DUR
      CALL SPAPLT(FOM,DOM,NFAST/2+1,MWV,WV)
C
      STOP
      END
         