Date:2011-03-05 23:02:15 (8 years 4 months ago)
Author:Werner Almesberger
Commit:34722a54ef595c34abd96604429ba4bb64548dc6
Message:usrp/sps/viz: reject unrecognized command-line options

Files: usrp/sps/viz (3 diffs)

Change Details

usrp/sps/viz
22
33usage()
44{
5    echo "usage: $0 [-f font] prefix frequency" 1>&2
5    echo "usage: $0 [-f font] [-m] [-o fft_file] [-p png_file] prefix \
6frequency" 1>&2
67    exit 1
78}
89
...... 
1011font=
1112term=
1213output=
14show_max=false
15out=
16
1317while true; do
1418    case "$1" in
1519    -f) [ "$2" ] || usage
1620        shift
17        font=$1
18        shift;;
21        font=$1;;
22    -m) show_max=true;;
23    -o) [ "$2" ] || usage
24        shift
25        out=$1;;
1926    -p) [ "$2" ] || usage
2027        shift
2128        term="set term png"
22        output="set output \"$1\""
23        shift;;
29        output="set output \"$1\"";;
30    -*) usage;;
2431    *)
2532        break;;
2633    esac
34    shift
2735done
2836
2937[ "$2" ] || usage
3038[ "$3" ] && usage
3139
40tmp=${out:-_tmp}
3241prefix=$1
3342f=$2
3443
35../fft -s 100 -d -w hamming 100 <./$prefix-$f >_tmp
36set `./norm _tmp`
44../fft -s 100 -d -w hamming 100 <./$prefix-$f >$tmp
45set `./norm $tmp`
3746
3847xm=$1.0 # sample number of y peak
3948ym=$2 # magnitude of y peak
...... 
7079set xlabel "MHz from nominal frequency of test wave"
7180
7281set style fill solid 1
73plot "_tmp" using ((\$0/$n-0.5)*$span+0.5):(\$1-$ym) with lines notitle, \
82plot "$tmp" using ((\$0/$n-0.5)*$span+0.5):(\$1-$ym) with lines notitle, \
7483  "<echo -0.9 $ymbar 0.2" with boxes lt $ymbarlt notitle
7584EOF
7685
77rm -f _tmp
86[ "$out" ] || rm -f $tmp
87$show_max && echo $ym

Archive Download the corresponding diff file



interactive