Date:2011-03-05 00:28:59 (8 years 9 months ago)
Author:Werner Almesberger
Commit:7258e10a9a2e262685478267e62966c959f2f088
Message:usrp/sps: further improved scripts, added Makefile

- Makefile (index): generate an illustrated index of all the measurement
runs
- Makefile (upload): upload images and index to downloads.qi-hardware.com
- collect: added optional directory argument, for cases where the
destination directory differs from the local directory
- collect: hard-coded remote host to run usrp2_rx_cfile.py at
- collect: added . to PATH, for execution of a local copy of atrf-txrx
- row: generate entire HTML page, not just the table entries
- row: accept a list of prefixes to iterate through
- row: highlight rows starting a "new" prefix
- viz: corrected sprintf formats from +%...f to %+...f
- viz: show negative peak power in red
Files: usrp/sps/Makefile (1 diff)
usrp/sps/collect (1 diff)
usrp/sps/row (1 diff)
usrp/sps/viz (2 diffs)

Change Details

usrp/sps/Makefile
1RUNS=atusb-sil \
2  atusb-20110214-3 atusb-20110214-4 atusb-20110214-5 \
3  atusb-20110214-6 atusb-20110214-7 \
4  atben-20110115-1 \
5  atben-20110123-1 atben-20110123-2 \
6  atben-20110219-1 atben-20110219-2 atben-20110219-3 \
7  atben-20110219-4 atben-20110219-5
8
9all:
10
11upload:
12    rsync -e ssh --progress index.html *.png \
13      www-data@downloads.qi-hardware.com:werner/wpan/20110303/
14
15index:
16    time ./row $(RUNS) >index.html
usrp/sps/collect
11#!/bin/sh
2if ! [ "$1" ]; then
3    echo "usage: $0 prefix" 2>&1
2
3PATH=$PATH:.
4
5if ! [ "$1" ] || [ "$3" ]; then
6    echo "usage: $0 prefix [directory]" 1>&2
47    exit 1
58fi
9
10if [ "$2" ]; then
11    if [ "${2#/}" = "$2" ]; then
12        dir=`pwd`/$2
13    else
14        dir=$2
15    fi
16else
17    dir=`pwd`
18fi
19
620f=2405
721while [ $f -le 2480 ]; do
22    echo Center: $f MHz 1>&2
823    f1=`expr $f + 1`
924    atrf-txrx -f $f -p 4 -T -0.5 \
10        'sleep 1; usrp2_rx_cfile.py -d 16 -g 46 -f '$f'M -N 1M '$1-$f
25        "sleep 1; ssh -a -x ws usrp2_rx_cfile.py -d 16 -g 46 -f ${f}M -N 1M $dir/$1-$f"
1126    atrf-txrx -f $f -p 4 -T +0.5 \
12        'sleep 1; usrp2_rx_cfile.py -d 16 -g 46 -f '$f1'M -N 1M '$1-$f1
27        "sleep 1; ssh -a -x ws usrp2_rx_cfile.py -d 16 -g 46 -f ${f1}M -N 1M $dir/$1-$f1"
1328    f=`expr $f + 5`
1429done
usrp/sps/row
44GDFONTPATH=$GDFONTPATH:/usr/share/fonts/truetype/ttf-liberation/
55
66if ! [ "$1" ]; then
7    echo "usage: $0 prefix" 2>&1
7    echo "usage: $0 prefix ..." 1>&2
88    exit 1
99fi
1010
11prefix=$1
11cat <<EOF
12<HTML>
13<TABLE cellpadding="0" cellspacing="0">
14EOF
1215
13echo "<TR><TH>$prefix"
14f=2405
15while [ $f -le 2480 ]; do
16    echo "<TD align="center">$f MHz"
17    f=`expr $f + 5`
18done
16last=
17for prefix in "$@"; do
18    echo $prefix 1>&2
1919
20echo "<TR><TD align="right">-0.5 MHz"
21f=2405
22while [ $f -le 2480 ]; do
23    ./viz -f LiberationSans-Bold -p $prefix-$f.png $prefix $f
24    convert -resize '15%' $prefix-$f.png $prefix-$f-small.png
25    echo "<TD><A href=\"$prefix-$f.png\"><IMG src=\"$prefix-$f-small.png\"></A>"
26    f=`expr $f + 5`
27done
20    if [ "${last%-*}" = "${prefix%-*}" ]; then
21        color=
22    else
23        color=' bgcolor="#a0e0ff"'
24    fi
25    last=$prefix
26
27    echo "<TR$color><TH>$prefix"
28    f=2405
29    while [ $f -le 2480 ]; do
30        echo "<TD align="center">$f MHz"
31        f=`expr $f + 5`
32    done
33
34    echo "<TR><TD align="right">-0.5 MHz"
35    f=2405
36    while [ $f -le 2480 ]; do
37        ./viz -f LiberationSans-Bold -p $prefix-$f.png $prefix $f
38        convert -resize '15%' $prefix-$f.png $prefix-$f-small.png
39        echo "<TD><A href=\"$prefix-$f.png\"><IMG src=\"$prefix-$f-small.png\"></A>"
40        f=`expr $f + 5`
41    done
42
43    echo "<TR><TD align="right">+0.5 MHz"
44    f=2405
45    while [ $f -le 2480 ]; do
46        f1=`expr $f + 1`
47        ./viz -f LiberationSans-Bold -p $prefix-$f1.png $prefix $f1
48        convert -resize '15%' $prefix-$f1.png $prefix-$f1-small.png
49        echo "<TD><A href=\"$prefix-$f1.png\"><IMG src=\"$prefix-$f1-small.png\"></A>"
50        f=`expr $f + 5`
51    done
2852
29echo "<TR><TD align="right">+0.5 MHz"
30f=2405
31while [ $f -le 2480 ]; do
32    f1=`expr $f + 1`
33    ./viz -f LiberationSans-Bold -p $prefix-$f1.png $prefix $f1
34    convert -resize '15%' $prefix-$f1.png $prefix-$f1-small.png
35    echo "<TD><A href=\"$prefix-$f1.png\"><IMG src=\"$prefix-$f1-small.png\"></A>"
36    f=`expr $f + 5`
3753done
54
55cat <<EOF
56</TABLE>
57EOF
usrp/sps/viz
4040n=$3 # total number of samples
4141span=6.25 # ADC sample rate in MHz / decimation (100 MHz/16)
4242
43if [ ${ym#-} = $ym ]; then
44    ymbar=-$ym
45    ymbarlt=2
46else
47    ymbar=$ym
48    ymbarlt=1
49fi
50
4351gnuplot -persist <<EOF
4452$term
4553$output
4654
4755set label "$prefix" at graph 0.03, graph 0.93 font "$font,22"
48set label sprintf("+%.1f dB", $ym) at graph 0.03, graph 0.82 font "$font,18"
56set label sprintf("%+.1f dB", $ym) at graph 0.03, graph 0.82 font "$font,18"
4957
5058set label sprintf("%.1f MHz", $f-0.5) \
5159  at graph 0.97, graph 0.93 right font "$font,22"
52set label sprintf("+%.1f ppm", (($xm/$n-0.5)*$span+0.5)/($f-0.5)*1000000) \
60set label sprintf("%+.1f ppm", (($xm/$n-0.5)*$span+0.5)/($f-0.5)*1000000) \
5361  at graph 0.97, graph 0.82 right font "$font,18"
5462
5563set xrange [-2.5:2.5]
...... 
6371
6472set style fill solid 1
6573plot "_tmp" using ((\$0/$n-0.5)*$span+0.5):(\$1-$ym) with lines notitle, \
66  "<echo -0.9 -$ym 0.2" with boxes notitle
74  "<echo -0.9 $ymbar 0.2" with boxes lt $ymbarlt notitle
6775EOF
6876
6977rm -f _tmp

Archive Download the corresponding diff file



interactive