Skip to content

Instantly share code, notes, and snippets.

@xorrbit
Created March 2, 2015 22:55
Show Gist options
  • Save xorrbit/d23e882c0366de0a8fb5 to your computer and use it in GitHub Desktop.
Save xorrbit/d23e882c0366de0a8fb5 to your computer and use it in GitHub Desktop.
Shell script to calculate the average power of a GSM base station using my fork of kalibrate-hackrf.
file=`mktemp`
echo "Average power of channel $1:"
for i in {1..10};
do kalibrate-hackrf/src/kal -s GSM850 -c $1 2>&1 | sed -n 's/.*power: \([0-9.]*\)/\1/p' >> $file;
done
awk '{ total += $1; count++ } END { print total/count }' $file
rm $file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment