Communication Systems with
GNU RADO
What is GNU Radio?
GNU Radio is an open-source software toolkit used for building and experimenting with
Software Defined Radios (SDRs). It provides a collection of signal processing blocks
(like filters, modulators, demodulators, FFTs, etc.) that can be connected together to
create a complete radio system.
• It runs mainly on Linux, but also works on Windows and macOS.
• It has a graphical tool called GNU Radio Companion (GRC), where you can design
radio systems by simply connecting blocks, without much coding.
• It supports many hardware devices like USRP, RTL-SDR, HackRF, LimeSDR, or it
can run without hardware (simulation only).
• Used in research, education, prototyping, and real-world systems such as wireless
communication, radar, and satellite links.
SDR and GNU Radio
SDR (Software Defined Radio):
The idea/technology of doing radio functions (like modulation, demodulation, filtering) in
software instead of only hardware.
GNU Radio:
A free software toolkit (program) that lets you build and test SDR systems on your
computer using blocks and flowgraphs.
SDR = the concept.
GNU Radio = a tool to make SDRs.
GNU Radio Companion
GNU Radio Companion (GRC) is a graphical interface for the GNU Radio framework.
It allows users to design signal processing systems by connecting pre-built blocks instead
of writing code.
• Each block performs a function (like filters, modulators, sources, sinks).
• You connect blocks together in a flowgraph to create radios, communication systems,
and simulations.
• It is widely used in education, research, and SDR development because it makes
complex radio systems easy to build and visualize.
GNU Radio and GRC
GNU Radio:
The main software framework (written in C++ and Python). It provides all the signal
processing blocks (filters, FFT, modulation, demodulation, etc.) and the engine that
runs your radio system.
GNU Radio Companion (GRC):
A graphical interface (GUI) for GNU Radio. Instead of writing Python code, you just
drag and drop blocks and connect them. When you run it, GRC automatically
generates Python code that uses GNU Radio in the background.
Your First Flowgraph
Starting GNU Radio Companion
The GNU Radio Companion (GRC) is a visual editor for creating and running flowgraphs. GRC uses .grc files
which are then translated into Python .py flowgraphs.
Open a terminal by pressing CTRL + ALT + T or by right-clicking on the desktop and selecting Open in
Terminal:
Type in the terminal:
$ gnuradio-companion &
The GRC window opens:
Double click the Options block and name the flowgraph by editing the Id and Title:
The Id is the filename of the Python flowgraph. Name it sineWaveFlowgraph. The Title is a description of the
flowgraph. Click OK to save the changes.
Click File : Save to save the GRC Flowgraph.
Enter sineWaveGRC.grc as the name for the .grc file to distinguish it from the Id.
The GRC file is named and saved.
Adding Blocks
Blocks are added to create the first flowgraph. GNU Radio comes with a library of signal processing blocks. The
blocks can be browsed using the arrows on the right. Blocks may also be searched for using CTRL + F or by
selecting the magnifying glass (highlighted in red):
Search for the Signal Source block and then drag and drop it into the GRC workspace:
Now search for Throttle, QT GUI Frequency Sink and QT GUI Time Sink. Drag and drop each of the blocks into
the workspace. The flowgraph should like the following:
• The Signal Source block will create a complex sinusoid;
• QT GUI Frequency Sink will display the magnitude of the frequency spectrum
• QT GUI Time Sink will display the time domain.
• The Throttle block is used for flow control in the absence of radio hardware.
The blocks need to be connected. First click the output of Signal Source (highlighted in red) and then click the input
to the Throttle (highlighted in orange).
The Signal Source block text changed from red to black. The red text means a block still has an input or output
that needs to be connected before the flowgraph can be run. Connect the throttle output to the frequency sink and
time sink:
Running The Flowgraph
Press the Play button (highlighted in red) to run the flowgraph:
A new window displays the signal in the time domain and frequency
domain:
Success! The flowgraph is running.
Open the file browser. There are two files. The first file is sineWaveGRC.grc, containing the information for the
display of the flowgraph in GRC. The second file is sineWaveFlowgraph.py, containing the actual Python
flowgraph code. The Id in the Options block determines the name of the .py file.
Signal Data Types
Data Types
Every input and output port on a block will have a data type associated with it. The data type is identified by the
color of the input and output port. The GNU Radio data types can be found by opening GNU Radio Companion
(GRC) and clicking Help: Types:
A window displays the data types and their associated colors:
These colors correspond to the input and output ports for blocks in GRC.
The most common data types in GNU Radio blocks are Complex Float 32 in blue and Float 32 in orange.
Additional colors include the Integer 16 (or short) data type in yellow and the Integer 8 (or char) data type
in purple.
Complex Data Type
The following flowgraph uses the Complex Float 32 data type, which uses a pair of 32-bit floats to represent
the real and imaginary portions of a complex sample.
Running the flowgraph shows the complex signal plotted in the time domain, where Signal 1 is the real
component and Signal 2 is the imaginary component of the complex signal:
Each complex sample is therefore 64 bits: a 32-bit float for the real component, and a 32-bit float for the
imaginary component.
Float Data Type
Many GNU Radio blocks support multiple data types. The data type of the Signal Source block can be changed by
double-clicking it and selecting from the Output Type drop-down menu:
Selecting the float data type will have the Signal Source block create a real sinusoid, represented by
the orange output port. Note the arrow connecting Signal Source to Throttle is red, indicating a data type mismatch
error:
The error is resolved by converting all of the other blocks to the orange Float data type. Clicking on the block
selects it, highlighting it in light blue. Data types may be changed by pressing UP or DOWN on the keyboard:
The flowgraph is complete after all data types have been converted to Float:
The Signal Source block creates a real output, which is displayed as the only signal in the time domain: