1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-25 18:57:11 +02:00

usrp/: new tools to run, evaluate, and plot a full frequency scan

- usrp/fscan: perform a frequency scan in my test setup
- usrp/evscan: determine the frequency-dependent signal strength from a
  frequency scan
- usrp/plscan: plot one or more data sets produced by evscan
This commit is contained in:
Werner Almesberger 2010-11-17 13:12:56 -03:00
parent cc5090b179
commit 3684c0765a
3 changed files with 84 additions and 0 deletions

18
usrp/evscan Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
usage()
{
echo "usage: $0 base-dir" 1>&2
exit 1
}
[ -d "$1" ] || usage
[ "$2" ] && usage
for f in "$1"/24*; do
echo -n `basename "$f"` ''
for n in "$f"/data*; do
./fft -s 100 0 20 50 <"$n" || echo "fft failed for $n" 1>&1
done | ./range -v 2
done

36
usrp/fscan Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
usage()
{
echo "usage: $0 out-dir [tx-power]" 1>&2
exit 1
}
[ "$1" ] || usage
[ "$3" ] && usage
mkdir "$1" || exit
pwr=${2:-2.6}
unset DISPLAY
if [ "${1#/}" = "$1" ]; then
abs=`pwd`/$1
else
abs=$1
fi
for a in 0 1 2 3 4 5 6 7 8 9; do
for b in 0 1 2 3 4 5 6 7 8 9; do
f=2405
while [ $f -le 2480 ]; do
echo -e $a$b $f MHz '\r'
mkdir -p "$1/$f"
atrf-txrx -f $f -p $pwr -T +0.5 \
"ssh ws usrp2_rx_cfile.py -d 16 -f $f.5M -g 46 -N 1124 \
$abs/$f/data$a$b"
f=`expr $f + 5`
done
done
done

30
usrp/plscan Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
usage()
{
echo "usage: $0 [-o pngfile] file ..." 1>&2
exit 1
}
if [ "X$1" = X-o ]; then
out=$2
shift 2
fi
[ "$1" ] || usage
[ "${1#-}" = "$1" ] || usage
gnuplot -persist <<EOF
`[ "$out" ] && ( echo set term png\;; echo set output \'$out\'; )`
set xlabel "MHz"
set ylabel "dB"
set xrange [2402:2483]
set yrange [-35:-25]
set title "Received signal strength"
set data style errorlines
plot \
`for n in $@; do
echo -n $comma \'$n\' title \'\`echo "$n" | sed "s/\..*//"\`\'
comma=,
done`
EOF