Guide Reading Data - UQ-Communication-Systems/public GitHub Wiki
After recording the samples using rtl_sdr, you will get a dump file (eg dump.bin), where the data is stored as 8-bit complex data (total 2 bytes per sample). This is data which has alternating bytes of real and imaginary.
You can process this data off-line in many languages. Below are some instructions for Malab/Octave and Python.
Matlab/Octave
In Matlab/Octave you can read in the file by running:
x = read_complex_byte('dump.bin');
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 the number of samples captured. You can see the first sample by typing in the following. Note that Matlab/Octave use 1 based indexing:
x(1)
Python
import loadutil
x = loadutil.read_complex_byte('dump.bin')
x.shape
You can download the loadutil.py module here. Also, see the python notebook more information about read_complex_byte: Reading Data in Python
The first sample can be accessed using x[0], as Python uses 0 as the first index of an array/list/vector.
Next Steps
After loading the data, the next step is plotting the spectrum, and this is covered in Plotting Spectrum Using PWelch.