#! /bin/sh 
# This material contains unpublished, proprietary software of
# Entropic Research Laboratory, Inc. Any reproduction, distribution,
# or publication of this work must be authorized in writing by Entropic
# Research Laboratory, Inc., and must bear the notice:
#
#    "Copyright (c) 1986-1990  Entropic Speech, Inc.
#    "Copyright (c) 1990-1991  Entropic Research Laboratory, Inc.
#                   All rights reserved"
#
# The copyright notice above does not evidence any actual or intended
# publication of this source code.
#
# @(#)Xmakeplots	1.10   9/9/98     ESI/ERL
#
# Written by:
# Checked by:
# Revised by: David Burton
#
# Brief description:  X windows script for putting up plot windows
# This demo requires the following demos to be run in advance if all 
# of the plots are to come up: createfiles, specdemo, mlplotdemo, 
# lpcdemo, filtdemo.

ESPS_VERBOSE=0
export ESPS_VERBOSE

if test `mach_type` = CONVEX -o `mach_type` = SONY_RISC -o `mach_type` = SONY_68K
 then
  echo This script will fail if you do not have write permission on this directory.
 else
  if test ! -w . 
    then
	echo "You do not have write permission in this directory."
	exit 1
  fi
fi
echo "doing mlplot"
xmcd "=300x300+0+0" plot/page1 &

echo "doing genplot"
genplot -W "=300x300+320+0" -e0,15,2,10 -mv -X8 speech.fana

echo "doing histogram"
pplain  -e5 speech.lsf | his -n64 -r100:600 - - | aplot -T \
	"ESPS histogram, File: speech.lsf" -W "=400x300+640+0" -z - &

echo "doing plotspecs"
plotspec -W "=300x300+0+320" signal.spec &
me_spec  -n2049 signal.rc dsignal.spec
plotspec -W "=300x300+320+320" -d dsignal.spec &
plotspec -W "=400x300+640+300" -y-40:10 1750bp.fspec  &

echo "running select for scatplot files"
rm -f sel1 sel2
eselect -o sel1 -q"spec_param[2] + spec_param[3] > 0.2" speech.rc
eselect -o sel2 -q"spec_param[2] + spec_param[3] < -0.2" speech.rc

echo "doing scatplot"
scatplot -W "=400x400+720+500" -e7,8 -X-1:1 -Y-1:1 sel1 sel2 &

echo "doing plotsd"
plotsd -W "=700x350+0+550"  speech.sd &

echo "Doing plotsgram"
plotsgram speech.sgram &
