Guide Reading Data - 2020-UQ-Communication-Systems/public GitHub Wiki
After recording the samples using rtl_sdr
, you will get a dump file (eg dump.bin). You can process this data off-line in many languages.
Matlab/Octave
In Matlab/Octave you can read in the file by running:
octave:1> x = read_complex_byte('dump.bin');
octave:2> size(x);
To get read_complex_byte
, get read_complex_byte.m
from this repository.
Note: you must be in the same directory as the dump.bin, or you need to specify the full path name. Also, the extension can be anything, typically in this class we will be using bin or dat extensions.
The size of x
, should be 1x number of samples captured. You can see the first sample by typing in the following. Note that Matlab/Octave use 1 based indexing:
octave:1> x(1)
Next you can check the spectrum by getting the Fourier transform of the signal, or by using the pwelch
function in Matlab/Octave. Read the documentation for this function to find out more. Note that you can get help in Matlab/Octave by typing help <functionname>
, or doc <functionname>
If you use the default arguments to the spectrum plot, you will get a plot with the positive spectrum on one side, and the negative on the other. As we are using complex samples, they are not the same. Also you might prefer to center the graph on DC. Also, make sure you use the decibel power scale on the y axis.
Python/Gnuradio
See the python notebook for a "pure python" version of read_complex_byte: read_complex_byte
In Gnuradio you can simply use a file source (more details will be shown later).