1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-12-22 23:17:22 +02:00

usrp/sps/: added peak power summary graph

- vizp: plot the peak power
- row: retrieve peak power from "viz" (with -m) and use it to generate the
  summary
- vizr: corrected typo in prefix argument number
This commit is contained in:
Werner Almesberger 2011-03-05 20:25:27 -03:00
parent bcd6e09189
commit 32818db581
3 changed files with 68 additions and 7 deletions

View File

@ -35,24 +35,28 @@ for prefix in "$@"; do
echo "<TD><A href=\"$prefix.png\"><IMG src=\"$prefix-small.png\"></A>"
echo "<TD align="right">-0.5 MHz"
>_peak
f=2405
while [ $f -le 2480 ]; do
./viz -f LiberationSans-Bold -p $prefix-$f.png \
-o $f.fft $prefix $f
echo -n "$f " >>_peak
./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 "<TD><A href=\"$prefix-$f.png\"><IMG src=\"$prefix-$f-small.png\"></A>"
f=`expr $f + 5`
done
echo "<TR>"
echo "<TD>"
echo "<TD><A href=\"$prefix-peak.png\"><IMG src=\"$prefix-peak-small.png\"></A>"
echo "<TD align="right">+0.5 MHz"
f=2405
while [ $f -le 2480 ]; do
f1=`expr $f + 1`
./viz -f LiberationSans-Bold -p $prefix-$f1.png \
-o $f1.fft $prefix $f1
echo -n "$f1 " >>_peak
./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 "<TD><A href=\"$prefix-$f1.png\"><IMG src=\"$prefix-$f1-small.png\"></A>"
f=`expr $f + 5`
@ -69,8 +73,13 @@ for prefix in "$@"; do
./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
rm -f _peak _tmp
convert -resize '15%' $prefix-peak.png $prefix-peak-small.png
done
cat <<EOF
</TABLE>

52
usrp/sps/vizp Executable file
View File

@ -0,0 +1,52 @@
#!/bin/sh
usage()
{
echo "usage: $0 [-f font] [-p png_file] prefix peak_file" 1>&2
exit 1
}
font=
term=
output=
while true; do
case "$1" in
-f) [ "$2" ] || usage
shift
font=$1;;
-p) [ "$2" ] || usage
shift
term="set term png"
output="set output \"$1\"";;
-*) usage;;
*)
break;;
esac
shift
done
[ "$2" ] || usage
[ "$3" ] && usage
prefix=$1
file=$2
gnuplot -persist <<EOF
$term
$output
set label "$prefix" at graph 0.03, graph 0.93 font "$font,22"
set xrange [2404:2481]
set yrange [-20:20]
set xlabel "Frequency of test wave (MHz)"
set ylabel "Peak power (dB)"
set mytics 2
set grid
plot "$file" using (\$1-0.5):2 with linespoints notitle
EOF

View File

@ -30,7 +30,7 @@ done
[ "$2" ] || usage
[ "$3" ] && usage
prefix=$3
prefix=$1
file=$2
gnuplot -persist <<EOF