Thursday, October 11, 2012

Understanding a Singal Processing Block in GNU Radio : Basics

All of you must be knowing that the signal processing happens in C++ while python only connects those c++ signal processing blocks with swig interface.

All the signal processing blocks are implemented mostly in C++ only.

GNU Radio uses the Simplified Wrapper and Interface Generator (SWIG),
to generate the necessary components to make C++ blocks accessible from Python.

From the standpoint of Python applications, each block consumes its input stream(s), performs a specific task, and generates output stream(s).

Keep in mind that  "A single output stream can connect to multiple input streams, but multiple outputs cannot connect to a single input due to ambiguity. A multiplexer can be used in such a situation by interleaving many inputs onto a single output. "

To create a signal processing block in gnuradio we need to follow following stages :

1. Implementation of the blocks in c++ (.cc and .h files)

2. Creation of swig interface between python and c++ (.i file)

3. Installation of the blocks in the shared library (.so file)

4. Usage of the block in an application with python (.py file)

When you download gnuradio tarball the you can actually see the whole structure.

Lets talk about the latest version. Download it by typing the following in the terminal

git clone git://

Now go to the gnuradio folder

You will see several folders like 

gr-utils  etc. If you go in anyone of them they have three folders name lib, include and swig.

lib contains all the .cc and .h files

include contains .h files

swig contains all the .i files

Reference :

No comments:

Post a Comment