Band Survey
What is this?
Using an RTL dongle you can create a survey that shows signal strength across the band over time. This is useful to determine if any patterns for interference are visible, like a specific time, or a recurring time, or some other aspect.
Last edited: 27 June 2019
Hardware
The hardware is a Raspberry Pi connected to an RTL SDR v3 dongle with a Diamond HF10CL antenna. The data is gathered on the pi and transferred to my workstation for visualisation.
Software
These charts were created using rtl_power and gnuplot.
The rtl_power command comes from Kyle Keen, who has documented how to create a band survey. Kyle's page provides access to a python script that creates a chart. It works, but it's very slow for large data-sets and it's non-trivial to adapt the display.
In addition to the python script, Kyle refers to work done by superkuh, who documents how to use the rtl_power band survey data to make a plot using gnuplot.
Source Code
The source for this project is available on github: https://github.com/vk6flab/band-survey and can be cloned from: https://github.com/vk6flab/band-survey.git
Details
Various tools are combined to create the visualisation. rtl_power gathers data, gnuplot creates a chart.
rtl-power
The command to gather data suitable for use as a "really wide band survey":
rtl_power -f 0M:1766M:1M -i 1m -g 50 -e 240h "data.csv"
Warning: The above command runs for 240 hours, that's 10 days. The charts shown cover 85 hours and the data file for 85 hours is approximately 318 Mb. (This is a work in progress.)
gnuplot
The gnuplot file to create the time-frequency chart:
# Source: http://superkuh.com/rtlsdr.html#keenerdappnote
# rtl_power output format
# 2013-08-19, 20:53:16, 55000000, 57000000, 1000000, 4096, -29.60, -29.60,
set timefmt '%Y-%m-%d, %H:%M:%S'
set view map
# Load a color palette
load 'default.plt'
set output 'data-survey.png'
set term png size 1920, 1080
set key off
set title "Band survey: 0 - 1766 MHz"
set xlabel 'Time'
# Label every 3 Hours
set xtics 3 * 3600
set xdata time
set format x "%H:%M\n%d/%m"
set ylabel 'Frequency (Hz)'
# Label every 100 MHz
set ytics 100 * 1000000
set format y "%.1s %cHz"
# Set the range from -25dB to 25dB
set cbrange [-25:25]
unset colorbox
plot 'data.csv' using 1:3:7 with points ps 0.1 pt 5 palette
The gnuplot file to create the waterfall chart (essentially swapping the axis from the time-frequency graph):
# Source: http://superkuh.com/rtlsdr.html#keenerdappnote
# rtl_power output format
# 2013-08-19, 20:53:16, 55000000, 57000000, 1000000, 4096, -29.60, -29.60,
set timefmt '%Y-%m-%d, %H:%M:%S'
set view map
# Load a color palette
load 'default.plt'
set output 'data-waterfall.png'
set term png size 1920, 1080
set key off
set title "Band survey: 0 - 1766 MHz"
set xlabel 'Frequency (Hz)'
# Label every 100 MHz
set xtics 100 * 1000000
set format x "%.1s %cHz"
set ylabel 'Time'
# Label every 3 Hours
set ytics 3 * 3600
set ydata time
set format y "%d/%m %H:%M"
# Show time backwards
set yrange [*:*] reverse
set cbrange [-25:25]
unset colorbox
plot 'data.csv' using 3:1:7 with points ps 0.1 pt 5 palette
Both the plot files rely on a palette file called default.plt:
# New default color palette after Moreland (2009)
# see: http://www.sandia.gov/~kmorel/documents/ColorMaps/
# For the gnuplot implementation have a look at
# http://bastian.rieck.ru/blog/posts/2012/gnuplot_better_colour_palettes/
set palette defined(\
0 0.2314 0.2980 0.7529,\
0.03125 0.2667 0.3529 0.8000,\
0.0625 0.3020 0.4078 0.8431,\
0.09375 0.3412 0.4588 0.8824,\
0.125 0.3843 0.5098 0.9176,\
0.15625 0.4235 0.5569 0.9451,\
0.1875 0.4667 0.6039 0.9686,\
0.21875 0.5098 0.6471 0.9843,\
0.25 0.5529 0.6902 0.9961,\
0.28125 0.5961 0.7255 1.0000,\
0.3125 0.6392 0.7608 1.0000,\
0.34375 0.6824 0.7882 0.9922,\
0.375 0.7216 0.8157 0.9765,\
0.40625 0.7608 0.8353 0.9569,\
0.4375 0.8000 0.8510 0.9333,\
0.46875 0.8353 0.8588 0.9020,\
0.5 0.8667 0.8667 0.8667,\
0.53125 0.8980 0.8471 0.8196,\
0.5625 0.9255 0.8275 0.7725,\
0.59375 0.9451 0.8000 0.7255,\
0.625 0.9608 0.7686 0.6784,\
0.65625 0.9686 0.7333 0.6275,\
0.6875 0.9686 0.6941 0.5804,\
0.71875 0.9686 0.6510 0.5294,\
0.75 0.9569 0.6039 0.4824,\
0.78125 0.9451 0.5529 0.4353,\
0.8125 0.9255 0.4980 0.3882,\
0.84375 0.8980 0.4392 0.3451,\
0.875 0.8706 0.3765 0.3020,\
0.90625 0.8353 0.3137 0.2588,\
0.9375 0.7961 0.2431 0.2196,\
0.96875 0.7529 0.1569 0.1843,\
1 0.7059 0.0157 0.1490\
)
Notes
If you need to change a time offset, because your local time isn't correct, or different from the time on the data capture, you can replace the time column with a formula: (timecolumn(1)+8*3600)
. This adds 8 hours worth of seconds to each time stamp.
For example, to add 8 hours to the time:
plot 'data.csv' using 3:1:7 with points ps 0.1 pt 5 palette
Becomes:
plot 'data.csv' using 3:(timecolumn(1)+8*3600):7 with points ps 0.1 pt 5 palette
This project is not yet completed and the information on this page will be updated as it progresses.
Enjoy.
73, de Onno VK6FLAB