#! /bin/sh
# script for demonstrating sugabor
# The input data are chirps and the output are time-frequency plots

demo=gabor

perc=99

# bandwidth parameter
band=.25

# vibrodata.1 100hz-5hz
suvibro f1=100 f2=5 tv=1.0 t1=.1 t2=.1  >vibrodata.1
supsgraph <vibrodata.1 perc=$perc \
	title="Vibroseis Data: 100hz-5hz"\
	label1="Time (sec)" label2="" >${demo}.1.eps

sugabor <vibrodata.1 band=$band |
supsimage perc=$perc \
	title="Gabor Transform"\
	label1="Time (sec)" label2="Freq (hz)" >${demo}.2.eps

# narrow band 40hz-50hz
suvibro f1=40 f2=50 tv=1.0 t1=.1 t2=.1  >vibrodata.2
supsgraph <vibrodata.2 perc=$perc \
	title="Vibroseis Data: 40hz-50hz"\
	label1="Time (sec)" label2="" >${demo}.3.eps

sugabor <vibrodata.2 band=$band |
supsimage perc=$perc \
	title="Gabor Transform"\
	label1="Time (sec)" label2="Freq (hz)" >${demo}.4.eps

# upsweep
suvibro f1=5 f2=120 tv=1.0 t1=.2 t2=.2  >vibrodata.3
supsgraph <vibrodata.3 perc=$perc \
	title="Vibroseis Data: 5hz-120hz"\
	label1="Time (sec)" label2="" >${demo}.5.eps

sugabor <vibrodata.3 band=$band |
supsimage perc=$perc \
	title="Gabor Transform"\
	label1="Time (sec)" label2="Freq (hz)" >${demo}.6.eps

# sum of vibrodata.1, narrow band, upsweep
susum vibrodata.1 vibrodata.2 >junktmp.vibro
susum junktmp.vibro vibrodata.3 >vibrodata.4
rm junktmp.vibro

supsgraph <vibrodata.4 perc=$perc \
	title="Sum of 40-50hz,100-5hz, and 5-120hz"\
	label1="Time (sec)" label2="" >${demo}.7.eps

sugabor <vibrodata.4 band=$band |
supsimage perc=$perc \
	title="Gabor Transform"\
	label1="Time (sec)" label2="Freq (hz)" >${demo}.8.eps
 
echo 
echo "Output PostScript files:"

echo -n "     "
for i in ${demo}.*.eps
do
	 echo -n "$i "
done
echo
echo "You may view these with your PostScript Previewer"

exit 0
