Interacting of the SDR with Matlab during my classroom tutorial

This year was the second time I gave my tutorial with an SDR dongle. The idea behind this tutorial is to simulate ground-station-to-satellite interaction in the radiowave spectrum. The ground station is replaced by the SDR dongle and the student's computer. For the satellite, I use a radio beacon designed and built by a colleague of mine. The device transmits an FSK modulated signal at a certain frequency. During the tutorial, the students learn to develope software that interacts with the SDR, such that they can process the digital stream observed by the SDR. I made a small video of the signal with GQRX software, such that you can see the signal in the frequency spectrum and listen to the FSK modulation.

Last year, I was using an open-source software package "gnuradio" for the signal processing part, but I found out that this introduced a lot of trouble-shouting in the first few hours, because of students having:
  • different operating systems and versions (every single student had different installation problems)
  • different level of experience with python, shell scripting, or other software language (the tutorial is part of our Space Minor, so we get a variety of students from different faculties and the learning curve of gnu radio is just to steep)
  • different level of understanding of signal processing theory
This made last year's tutorial interesting and a lot of fun, but also very chaotic. This year, I decided to streamline it a bit more. Luckily at out university, most staff and students use Matlab for programming in their education (which runs on any operating system), therefore by converting the tutorial to Matlab would solve the first two evaluation points. Furthermore, gnuradio has a lot of possibilities, but this overwelms the more beginner-experienced students. Matlab has all the basics (needed for this tutorials), but does not have large libraries where you could drown in coding. Thanks to Mathworks new toolbox "RTL-SDR Support from Communications System Toolbox", communicating to the SDR is now very simple. 

Students would get an SDR dongle to connect to their laptop via an USB port (I discussed this SDR in a previous post). They need to develop software that can process the data from the ground station. So, to replicate this I let them record the QI signal that is observed by their mini-ground station and they need to plot the corresponding waterfall plot (as is seen in the video). 

The radio transmitter built by my colleague that is used in the ground station tutorial. It transmits a call sign with an FSK modulation. Left is the transmitter and right is an GPS antenna to calibrate the oscillator of the device
The code to record the QI signal coming from the SDR dongle is listed below. I modified an m-file from the SDR Toolbox tutorial (sdrrSpectrumAnalyzer.m). 

close all;
% Set initial parameters (these settings can be changed according to the user needs)
T                  = 60;            % Length of recorded signal (sec)
fc                 = 28.126125e6;   % Center frequency (Hz)
FrontEndSampleRate = 250e3;         % Samples per second (Hz)
% Do not change the following settings
n = 1;                              % multiple of the Framelength
FrameLength        = n*256;         % samples per counted frame
dt = FrameLength/FrontEndSampleRate;% length of sample
count = ceil(T/dt);                 % number of counts
% Create receiver and spectrum analyzer System objects
hSDRrRx = comm.SDRRTLReceiver(...
    'CenterFrequency', fc, ...
    'EnableTunerAGC',  true, ...
    'SampleRate',      FrontEndSampleRate, ...
    'SamplesPerFrame', FrameLength, ...
    'OutputDataType',  'double');
% Open file to write data
fid = fopen('Test_data_GPS_250kHz_minus.32fc','wb');

%% Stream processing
if ~isempty(sdrinfo(hSDRrRx.RadioAddress))
    for count = 1 : count
        % get data from SDR
        [data, ~] = step(hSDRrRx);  % no 'len' output needed for blocking operation
        data = data - mean(data);   % remove DC component
        % Construct the QI signal in a vector
        D = zeros(size(data,1),2);
        D(:,1) = real(data);
        D(:,2) = imag(data);
        % write the QI signal to a file
% Release all System objects

This code will generate a file that is similar to the recording-data files our ground station is generating. So, if the students are able to post process their own recorded data, the ground station data files should easily be processed as well. How to plot a waterfall plot, was already discussed here. Since then, I have improved my coding, but the basics are kept the same. When following these instructions, I obtained the following waterfall plot of the FSK-modulated radio signal transmitted during class.
Waterfall plot of the recording with the SDR dongle during class. 
The radio signal is visible in the spectrogram (or waterfall plot). No characteristic S-curve is seen, because in class the transmitter is not moving with respect to the antenna's of the students. The carrier frequency is kept at the same value, because the relative velocity of the receiver and transmitter is zero. The FSK modulations is seen when we zoom in on the signal.
Zoomed in version of the waterfall plot, such that the signal can be better inspected.
Here, (not so clear as in the video) can be seen that the frequency jumps between four different values, such that it is able to communicate data. In the video this can be heard as four different tones of the signal. Note the reflections of the signal to the left and right of the zoomed in spectrogram. A good filter should be able to remove these, but I have kept it simple.

I found the interface of Matlab with the SDR very simple to use, which made it ideal to be used for my course on satellite communication and tracking.


Populaire posts van deze blog

Measuring the geoid. What is the geoid?

How to make a spectrogram or waterfall plot

The gravimeter of professor Vening Meinesz