Data processing

From Reconfigurable Computing Wiki
Jump to: navigation, search

Analyzing Data from the SDR Radiometer

GNURadio outputs data in a binary format (little endian). There are two formats of this that are used by the radiometer GNURadio flow program. The Total Power Radiometer data is stored as a float value, 4-bytes per sample and as IEEE 754 single precision float. The raw IQ values are stored as a complex value that contains both real and imaginary values and again as a float pointing value.

Both Python and programs like Matlab and Octave can read these files. To use Python, you will want to have SciPy installed on your machine. Once installed, execute these commands.

To read the TPR files

f = scipy.fromfile(open("filename"), dtype=scipy.float32)

To read the IQ files

f = scipy.fromfile(open("filename"), dtype=scipy.complex64)

For Matlab and Octave, GNURadio provides scripts to read these files. You can find these scripts in the gr-utils folder in your GNURadio installation. These scripts are actually functions, so you can call them like functions like any other function in Matlab or Octave. For example:

gnuradio = read_float_binary(gnuradio_file);

Here gnuradio_file is the name of the file you wish to parse such as TPR_testrun1.dat. From there you can work with the data as you need it. A simple example would be to plot the data. This can simply be done with the following command.

plot(gnuradio);

Square Law Data

The current setup of the Square-law detector used in the testing, calibration and experimentation of the SDR Radiometer uses LabView to capture and store the data. The current LabView program written by Matthew Nelson stores the data as both an ASCII format data and also using LabView's TDMS format. While the TDMS format is a binary format, there are functions for matlab that will read the data. However, these functions may not work in Octave and has not been tested in Octave.

Code repository

Work done by Matthew Nelson for his thesis has a Matlab script to read, parse and display both data from the SDR and from the square-law detector as well as other functions. All code, datasheets and thesis can be found in his GitHub repo.