#! /bin/sh
# sutvband -- reconstruct individual chirps from the sum of chirps
# produced by PSsugabor or Xsugabor
WIDTH=300
HEIGHT=400
WIDTHOFF1=0
WIDTHOFF2=315
WIDTHOFF3=630
WIDTHOFF4=945
HEIGHTOFF1=30
HEIGHTOFF2=480

perc=99

echo "Run PSsugabor or Xsugabor before running this script!"

## reconstruct 100hz-5hz trace
sutvband <vibrodata.4 tf=.4,.5,.7 \
	f=50,55,100,110 f=40,45,50,55 f=5,10,40,45 >recon.1
suxgraph <recon.1 perc=$perc \
	title="Reconstruct 100-5hz"\
	label1="Time (sec)" label2="" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${WIDTHOFF1} ybox=${HEIGHTOFF1} &
sugabor <recon.1  |
suximage perc=$perc \
	title="Gabor Transform"\
	label1="Time (sec)" label2="Freq (hz)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${WIDTHOFF2} ybox=${HEIGHTOFF1} &

## reconstruct 40hz-50hz trace
sutvband <vibrodata.4 tf=.4,.6  f=30,35,45,50 f=35,40,50,55 >recon.2
suxgraph <recon.2 perc=$perc \
	title="Reconstruct 40-50hz"\
	label1="Time (sec)" label2="" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${WIDTHOFF3} ybox=${HEIGHTOFF1} &

sugabor <recon.2 |
suximage perc=$perc \
	title="Gabor Transform"\
	label1="Time (sec)" label2="Freq (hz)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${WIDTHOFF4} ybox=${HEIGHTOFF1} &

## reconstruct 5hz-120hz trace
sutvband <vibrodata.4 tf=.3,.4,.5 f=5,10,30,35 f=35,40,50,55 \
	f=55,60,130,140 >recon.3
suxgraph <recon.3 perc=$perc \
	title="Reconstruct 5-120hz"\
	label1="Time (sec)" label2="" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${WIDTHOFF1} ybox=${HEIGHTOFF2} &
sugabor <recon.3  |
suximage perc=$perc \
	title="Gabor Transform"\
	label1="Time (sec)" label2="Freq (hz)" \
	wbox=${WIDTH} hbox=${HEIGHT} xbox=${WIDTHOFF2} ybox=${HEIGHTOFF2} &

exit 0
