startmacro
!------------------------------------------------------------------------------!
! Tests for SPECTRA command.
!
!   Author : J. Hallam
!   Version: $Id: test_spectra.mm,v 1.1 2006/03/01 13:34:12 jph Exp $
!
!------------------------------------------------------------------------------!

! Spectra simply extends FFT but has different default switches and
! parameters.  FFT with these same switches and parameters should produce the 
! same result.
!
! NOTE: If the FFT command is broken, then SPECTRA is as well.
!
set wavefile "test_fft_sin"
set fftOut "test_spectra_fft"
set spectraOut "test_spectra_out"

WAVEFORM,OUT=wavefile,FORM=SF,ELEM=1e6,SHAPE=SIN,AMP=1,FREQ=.01,PHASE=0,START=0,DELTA=1

fft/psd/1d IN1=wavefile OUT1=fftOut NFFT=1K WIN=HANN OVER=0.5 NAVG=-1
spectra IN1=wavefile OUT1=spectraOut NFFT=1K WIN=HANN OVER=0.5 NAVG=-1

assert/text="^reg.main.name: SPECTRA = FFT/PSD/1D" fftOut FEQ/B spectraOut

erase "^wavefile"
erase "^fftOut"
erase "^spectraOut"

endmacro
