From eafb2a226ff1cc5fd200185a0f13c4d9b746e8cb Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 29 Nov 2010 01:10:23 -0300 Subject: [PATCH] fix glitch in fft.c and add scripts to display data sets without temp file - usrp/doall: new script to directly evaluate and plot data sets - usrp/fft.c (fft_complex): don't square the magnitude - usrp/plscan: if an argument name has the form title=name, use "name" as the file name and "title" as the title --- usrp/doall | 11 +++++++++++ usrp/fft.c | 2 +- usrp/plscan | 9 ++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 usrp/doall diff --git a/usrp/doall b/usrp/doall new file mode 100755 index 0000000..b0037a9 --- /dev/null +++ b/usrp/doall @@ -0,0 +1,11 @@ +#!/bin/bash -x +opts= +while [ "$2" ]; do + opts="$opts $1" + shift +done +a= +for n in $1; do + a="$a `basename $n`=<(./evscan $n)" +done +eval ./plscan $opts $a diff --git a/usrp/fft.c b/usrp/fft.c index 83755a5..d0cdd34 100644 --- a/usrp/fft.c +++ b/usrp/fft.c @@ -32,7 +32,7 @@ static void fft_complex(int n, const float *re, const float *im, double *res) for (i = 0; i != n; i++) { a = hypot(out[i][0], out[i][1])/n; - a = a*a; +// a = a*a; res[i] = a; } } diff --git a/usrp/plscan b/usrp/plscan index 9dd9a6e..40d462e 100755 --- a/usrp/plscan +++ b/usrp/plscan @@ -24,7 +24,14 @@ set title "Received signal strength" set data style errorlines plot \ `for n in $@; do - echo -n $comma \'$n\' title \'${n%.*}\' + if [ "$n" = "${n#*=}" ]; then + file=$n + title=${n%.*} + else + file=${n#*=} + title=${n%%=*} + fi + echo -n $comma \'$file\' title \'$title\' comma=, done` EOF