Root/usrp/sps/row

1#!/bin/sh
2
3export GDFONTPATH
4GDFONTPATH=$GDFONTPATH:/usr/share/fonts/truetype/ttf-liberation/
5PATH=.:$PATH
6
7if ! [ "$1" ]; then
8    echo "usage: $0 prefix ..." 1>&2
9    exit 1
10fi
11
12cat <<EOF
13<HTML>
14<TABLE cellpadding="0" cellspacing="0">
15EOF
16
17last=
18for prefix in "$@"; do
19    echo $prefix 1>&2
20
21    if [ "${last%-*}" = "${prefix%-*}" ]; then
22        color=
23    else
24        color=' bgcolor="#a0e0ff"'
25    fi
26    last=$prefix
27
28    echo "<TR$color><TH>$prefix<TD>"
29    f=2405
30    while [ $f -le 2480 ]; do
31        echo "<TD align=\"center\">$f MHz"
32        f=`expr $f + 5`
33    done
34
35    echo "<TR>"
36    echo "<TD><A href=\"$prefix.png\"><IMG src=\"$prefix-small.png\"></A>"
37    echo "<TD align="right">-0.5 MHz"
38
39    >_peak
40
41    f=2405
42    while [ $f -le 2480 ]; do
43        echo -n "$f " >>_peak
44        viz -f LiberationSans-Bold -m -p $prefix-$f.png \
45          -o $f.fft $prefix $f >>_peak
46        convert -resize '15%' $prefix-$f.png $prefix-$f-small.png
47        echo "<TD><A href=\"$prefix-$f.png\"><IMG src=\"$prefix-$f-small.png\"></A>"
48        f=`expr $f + 5`
49    done
50
51    echo "<TR>"
52    echo "<TD><A href=\"$prefix-peak.png\"><IMG src=\"$prefix-peak-small.png\"></A>"
53    echo "<TD align="right">+0.5 MHz"
54
55    f=2405
56    while [ $f -le 2480 ]; do
57        f1=`expr $f + 1`
58        echo -n "$f1 " >>_peak
59        viz -f LiberationSans-Bold -m -p $prefix-$f1.png \
60          -o $f1.fft $prefix $f1 >>_peak
61        convert -resize '15%' $prefix-$f1.png $prefix-$f1-small.png
62        echo "<TD><A href=\"$prefix-$f1.png\"><IMG src=\"$prefix-$f1-small.png\"></A>"
63        f=`expr $f + 5`
64    done
65
66    ffts=`
67        f=2405
68        while [ $f -le 2480 ]; do
69        echo $f.fft
70        echo \`expr $f + 1\`.fft
71        f=\`expr $f + 5\`
72        done`
73
74    range >_tmp
75    vizr -f LiberationSans-Bold -p $prefix.png $prefix _tmp
76    rm -f $ffts _tmp
77    convert -resize '15%' $prefix.png $prefix-small.png
78
79    sort -n _peak >_tmp
80    vizp -f LiberationSans-Bold -p $prefix-peak.png $prefix _tmp
81    rm -f _peak _tmp
82    convert -resize '15%' $prefix-peak.png $prefix-peak-small.png
83
84done
85cat <<EOF
86</TABLE>
87EOF
88

Archive Download this file



interactive