From cb3e80f5026775c9929e4109a8f341664520c04a Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 6 Mar 2011 16:47:21 -0300 Subject: [PATCH] usrp/sps/: use PATH instead of hard-coding relative paths in invocations --- usrp/sps/row | 11 ++++++----- usrp/sps/viz | 6 ++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/usrp/sps/row b/usrp/sps/row index 07920e4..317a28f 100755 --- a/usrp/sps/row +++ b/usrp/sps/row @@ -2,6 +2,7 @@ export GDFONTPATH GDFONTPATH=$GDFONTPATH:/usr/share/fonts/truetype/ttf-liberation/ +PATH=.:$PATH if ! [ "$1" ]; then echo "usage: $0 prefix ..." 1>&2 @@ -40,7 +41,7 @@ for prefix in "$@"; do f=2405 while [ $f -le 2480 ]; do echo -n "$f " >>_peak - ./viz -f LiberationSans-Bold -m -p $prefix-$f.png \ + viz -f LiberationSans-Bold -m -p $prefix-$f.png \ -o $f.fft $prefix $f >>_peak convert -resize '15%' $prefix-$f.png $prefix-$f-small.png echo "" @@ -55,7 +56,7 @@ for prefix in "$@"; do while [ $f -le 2480 ]; do f1=`expr $f + 1` echo -n "$f1 " >>_peak - ./viz -f LiberationSans-Bold -m -p $prefix-$f1.png \ + viz -f LiberationSans-Bold -m -p $prefix-$f1.png \ -o $f1.fft $prefix $f1 >>_peak convert -resize '15%' $prefix-$f1.png $prefix-$f1-small.png echo "" @@ -70,13 +71,13 @@ for prefix in "$@"; do f=\`expr $f + 5\` done` - ./range >_tmp - ./vizr -f LiberationSans-Bold -p $prefix.png $prefix _tmp + range >_tmp + vizr -f LiberationSans-Bold -p $prefix.png $prefix _tmp rm -f $ffts _tmp convert -resize '15%' $prefix.png $prefix-small.png sort -n _peak >_tmp - ./vizp -f LiberationSans-Bold -p $prefix-peak.png $prefix _tmp + vizp -f LiberationSans-Bold -p $prefix-peak.png $prefix _tmp rm -f _peak _tmp convert -resize '15%' $prefix-peak.png $prefix-peak-small.png diff --git a/usrp/sps/viz b/usrp/sps/viz index 371c13d..3721cde 100755 --- a/usrp/sps/viz +++ b/usrp/sps/viz @@ -1,5 +1,7 @@ #!/bin/sh +PATH=..:$PATH + usage() { echo "usage: $0 [-f font] [-m] [-o fft_file] [-p png_file] prefix \ @@ -41,8 +43,8 @@ tmp=${out:-_tmp} prefix=$1 f=$2 -../fft -s 100 -d -w hamming 100 <./$prefix-$f >$tmp -set `./norm $tmp` +fft -s 100 -d -w hamming 100 <$prefix-$f >$tmp +set `norm $tmp` xm=$1.0 # sample number of y peak ym=$2 # magnitude of y peak