# ____ ____ ____ ____ _
# / ___|| _ \| _ \ / ___|_ __ __ _ ___| |__
# \___ \| | | | |_) | | | | '__/ _` / __| '_ \
# ___) | |_| | _ < | |___| | | (_| \__ \ | | |
# |____/|____/|_| \_\ \____|_| \__,_|___/_| |_|
#
# ____
# / ___|___ _ _ _ __ ___ ___
# | | / _ \| | | | '__/ __|/ _ \
# | |__| (_) | |_| | | \__ \ __/
# \____\___/ \__,_|_| |___/\___|
#
Everything you ever wanted to know about SDR, if only the bastard had finished the wiki page on it. ROFL…
Having no background in engineering, electronics, radio technology, and having learned everything I know about computers on my own; entering the world of radio frequencies has been quite an uphill challenge.
[!NOTE] It would be wise if time was taken to outline what is supposed to go in this section.
These definitions and explanations are written in layman’s terms without the use of any jargon what-so-ever. They are not precise, but are meant to be understood by someone who has no experience or knowledge in radio technology. That, and it is late. I am tired, so deal with it.
Modulation occurs in two ways:
Whenever you find your self in a new and unfamiliar place, at one point or another, you will have to find out where things are located at. In realm of rf technology this is performed by scanning the available radio spectrum to see what is out there. Performing a spectrum scan is an important beginning step in every radio endeavor, not only because it allows you to discover what is out there, it provides important information of signals in the area that could be the source of interference.
Before performing your scan you will need a few things, many of these are quite obvious, regardless the list is provided below.
The scan itself is performed within a matter of minutes, as the fftw3 library is very fast and purpose built for running these algorithms. The only downside to the software we are going to use is it uses a lot of command line options rather than a configuration file, so it might be confusing if your not familiar with the command line flags. A bonus of using this particular piece of software is it generates output in a format that was intentionally designed to be compatible with gnuplot, which means it can easily generate graphs directly from the command line.
Below is the proverbial “hail mary” for rtl_power_fftw. It runs rtl_power_fftw to scan frequencies from 100Mhz to 1000Mhz (or 1Ghz), averages the result of 100 scans through the spectrum, and generates a nice graph for you.
rtl_power_fftw -b 512 -d 0 -f 100M:1G -n 100 |\
gnuplot -e "set terminal png size 1280, 960; set output 'new-spectrum.png'; set title 'Frequency Spectrum'; set autoscale; set xlabel 'Frequency (Hz)'; set ylabel 'Power (dB)'; plot '-' w l;"
# ----------------------------
# A Simpler approach would be
# ----------------------------
rtl_power_fftw -f 1420405752 -n 100 -b 512 |\
gnuplot -e "set term png; unset key; plot '-' w l" >plot.png
Just remember on that last one, it is a “w” as in “willow” followed by an “l” as in “Lion”. Also notice,
rather than setting the output with set output 'my-graph.png'
, it simply redirects the output to a png file
as abreviated in trash code gnuplot "..." >my-graph.png
.
If for some reason you decide not to forgo the use of gnuplot at this time, then you will need to redirect the
output to a dat
file for use later.
rtl_power_fftw -b 512 -d 0 -f 100M:1G -n 100 >my-data.dat
# And when your ready to process it.
gnuplot -e "set terminal png size 1280, 960; set output 'new-spectrum.png'; set title 'Frequency Spectrum'; set autoscale; set xlabel 'Frequency (Hz)'; set ylabel 'Power (dB)'; plot 'my-data.dat' w l;"
There exists a third option, which is optimized for saving space, and that is to generate two files from the
scan a binary file for the data results of your scan, and a matrix file containing the info needed to extract
the data from the binary file. This is done by using the -m
flag, but it is important to keep in mind that the
binary output will not be compatible for use with gnuplot. Being brutally honest, we are still unsure quite
what to do with it.
rtl_power_fftw -b 512 -d 0 -f 100M:1G -n 100 -m my-data