|
# GNU Radio
|
|
# GNU Radio
|
|
|
|
|
|
GNU Radio is an open-source framework for creating signal processing applications that run on general-purpose processors. It is widely used in research, industry, and academia. and can be combined with SDR hardware to create real-world communication systems.
|
|
GNU Radio is an open-source framework for creating signal processing applications that run on general-purpose processors. It is widely used in research, industry, and academia, and it can be combined with SDR hardware to create real-world communication systems.
|
|
|
|
|
|
- [GNU Radio Project](https://gnuradio.org)
|
|
- [GNU Radio Project](https://gnuradio.org)
|
|
|
|
|
... | @@ -15,9 +15,9 @@ There is a large amount of documentation available for GNU Radio. |
... | @@ -15,9 +15,9 @@ There is a large amount of documentation available for GNU Radio. |
|
- [GNU Radio C++ API](https://www.gnuradio.org/doc/doxygen/)
|
|
- [GNU Radio C++ API](https://www.gnuradio.org/doc/doxygen/)
|
|
- [GNU Radio source code on Github](https://github.com/gnuradio/gnuradio)
|
|
- [GNU Radio source code on Github](https://github.com/gnuradio/gnuradio)
|
|
|
|
|
|
In particular, the GNU Radio Wiki has a suite of useful beginner and intermedia [tutorials](https://wiki.gnuradio.org/index.php?title=Tutorials), many of which are referenced below. These should be your starting point to better understand concepts important in developing GNU Radio applications.
|
|
In particular, the GNU Radio wiki has a suite of useful [beginner and intermedia tutorials](https://wiki.gnuradio.org/index.php?title=Tutorials), many of which are referenced below. These should be your starting point to better understand concepts important in developing GNU Radio applications.
|
|
|
|
|
|
The wiki also has documentation for many GNU Radio signal processing blocks which explain their configuration and operation. Unfortunately, not all of the documentation is complete, so at times you may need to investigate a block or object's source code should you want to use it. See the Python and C++ sections below for more information on understanding GNU Radio blocks.
|
|
The wiki also has documentation for many GNU Radio signal processing blocks which explain their configuration and operation. Unfortunately, not all of the documentation is complete, so at times you may need to investigate a block or object's source code should you wish to use it. See the Python and C++ sections below for more information on understanding GNU Radio blocks.
|
|
|
|
|
|
## Flowgraphs
|
|
## Flowgraphs
|
|
|
|
|
... | @@ -25,19 +25,19 @@ Applications are created in GNU Radio by constructing flowgraphs, which are coll |
... | @@ -25,19 +25,19 @@ Applications are created in GNU Radio by constructing flowgraphs, which are coll |
|
|
|
|
|

|
|

|
|
|
|
|
|
Blocks in a flowgraph perform defined signal processing operations, with source blocks generating data, other blocks processing data, and sink blocks consuming data. In the above example, two *Signal Source* blocks generate cosine waveforms with frequencies of 350 and 440 Hz, the *Add* block , and then the wavefor is outputted to the computer's soundcard
|
|
Blocks in a flowgraph perform defined signal processing operations, with source blocks generating data, other blocks processing data, and sink blocks consuming data. In the above example, two *Signal Source* blocks generate cosine waveforms with frequencies of 350 and 440 Hz, the *Add* block combines these two waveforms, and then the result is played on the computer's sound card.
|
|
|
|
|
|
Once execution of a flowgraph is started, the GNU Radio scheduler handles scheduling block processing and piping the generated data from the output port of an upstream block block to the input port of the next downstream block. This results in data streams flowing through the graph, where streams of data can be of different types (bytes, integers, floats, complex, etc.). For real-time operation, all blocks in the flowgraph must be able to keep up with the rate of arriving data on their input ports. GNU Radio functionality can be extended by writing new blocks in either Python or C++.
|
|
Once execution of a flowgraph commences, the GNU Radio scheduler handles scheduling block processing and the piping of generated data at the output port of an upstream block to the input port of the block downstream. This results in data streams flowing through the graph, where streams of data can be of different types (bytes, integers, floats, complex, etc.). For real-time operation, all blocks in the flowgraph must be able to keep up with the rate of arriving data on their input ports. GNU Radio functionality can be extended by writing new blocks in either Python or C++.
|
|
|
|
|
|
See [What is GNU Radio](https://wiki.gnuradio.org/index.php?title=What_Is_GNU_Radio) for an additional overview.
|
|
See [What is GNU Radio](https://wiki.gnuradio.org/index.php?title=What_Is_GNU_Radio) for an additional overview.
|
|
|
|
|
|
## The GNU Radio Companion (GRC)
|
|
## The GNU Radio Companion (GRC)
|
|
|
|
|
|
The GNU Radio Companion is a graphical tool for creating and running GNU Radio flowgraphs, and can be used in very much like Simulink or LabVIEW. It is the easiet way to create new applications when the libary of existing signal processing blocks is sufficient for your need.
|
|
The GNU Radio Companion, or GRC, is a graphical tool for creating and running GNU Radio flowgraphs and can be used very much like Simulink or LabVIEW. It is the easiet way to create new applications when the libary of existing signal processing blocks is sufficient for your needs.
|
|
|
|
|
|

|
|

|
|
|
|
|
|
See the following tutorials GRC tutorials:
|
|
See the following GRC tutorials:
|
|
- [Your First Flowgraph](https://wiki.gnuradio.org/index.php?title=Your_First_Flowgraph)
|
|
- [Your First Flowgraph](https://wiki.gnuradio.org/index.php?title=Your_First_Flowgraph)
|
|
- [Python Variables in GRC](https://wiki.gnuradio.org/index.php?title=Python_Variables_in_GRC)
|
|
- [Python Variables in GRC](https://wiki.gnuradio.org/index.php?title=Python_Variables_in_GRC)
|
|
- [Runtime Updating Variables](https://wiki.gnuradio.org/index.php?title=Runtime_Updating_Variables)
|
|
- [Runtime Updating Variables](https://wiki.gnuradio.org/index.php?title=Runtime_Updating_Variables)
|
... | @@ -46,19 +46,20 @@ See the following tutorials GRC tutorials: |
... | @@ -46,19 +46,20 @@ See the following tutorials GRC tutorials: |
|
- [Packing Bits](https://wiki.gnuradio.org/index.php?title=Packing_Bits)
|
|
- [Packing Bits](https://wiki.gnuradio.org/index.php?title=Packing_Bits)
|
|
- [Streams and Vectors](https://wiki.gnuradio.org/index.php?title=Streams_and_Vectors)
|
|
- [Streams and Vectors](https://wiki.gnuradio.org/index.php?title=Streams_and_Vectors)
|
|
|
|
|
|
It is often convenient to make commonly used block combinations into a *hierarchical block* that can be imported into a flowgraph as a single block. To do so in GRC, see:
|
|
It is often convenient to make commonly used block combinations into a *hierarchical block* that can be imported into a flowgraph as a single super block. To do so in GRC, see:
|
|
- [Hier_Blocks and Parameters](https://wiki.gnuradio.org/index.php?title=Hier_Blocks_and_Parameters)
|
|
- [Hier_Blocks and Parameters](https://wiki.gnuradio.org/index.php?title=Hier_Blocks_and_Parameters)
|
|
|
|
|
|
## Python Flowgraphs and Blocks
|
|
## Python Flowgraphs and Blocks
|
|
|
|
|
|
The Python programming language is one of two languages used within GNU Radio. As an interpreted language with intuitive syntax, it is well-suited for specifying flowgraphs to create applications. In fact, under the hood GRC is just generating a Python script to instantiates your designed flowgraph. Flowgraphs can be defined directly in Python instead.
|
|
The Python programming language is one of two languages used within GNU Radio. As an interpreted language with intuitive syntax, it is well-suited for specifying flowgraphs to create applications. In fact, under the hood GRC is just generating a Python script that instantiates your designed flowgraph. Flowgraphs can also be defined directly in Python instead.
|
|
|
|
|
|

|
|
|
|
|
|
|
|
See the following GNU Radio tutorial on understanding a flowgraph's Python code:
|
|
See the following GNU Radio tutorial on understanding a flowgraph's Python code:
|
|
|
|
|
|
- [Flowgraph Python Code](https://wiki.gnuradio.org/index.php?title=Flowgraph_Python_Code)
|
|
- [Flowgraph Python Code](https://wiki.gnuradio.org/index.php?title=Flowgraph_Python_Code)
|
|
|
|
|
|
Python is also quick and convenient for implementing some signal processing blocks in GNU Radio, but these should generally be blocks that are not computationally intensive. As an interpreted language, Python will generally be slower than compile C++ code, the other language used in GNU Radio.
|
|

|
|
|
|
|
|
|
|
Python is also quick and convenient for implementing some signal processing blocks in GNU Radio, but these should generally be blocks that are not computationally intensive. As an interpreted language, Python will generally be slower than compiled C++ code, the other language used in GNU Radio.
|
|
|
|
|
|
See the following GNU Radio tutorials on creating Python blocks:
|
|
See the following GNU Radio tutorials on creating Python blocks:
|
|
- [Creating Your First Block](https://wiki.gnuradio.org/index.php?title=Creating_Your_First_Block)
|
|
- [Creating Your First Block](https://wiki.gnuradio.org/index.php?title=Creating_Your_First_Block)
|
... | @@ -66,9 +67,9 @@ See the following GNU Radio tutorials on creating Python blocks: |
... | @@ -66,9 +67,9 @@ See the following GNU Radio tutorials on creating Python blocks: |
|
|
|
|
|
## Out-of-tree Modules and C++ Blocks
|
|
## Out-of-tree Modules and C++ Blocks
|
|
|
|
|
|
As an interpreted language, Python is very flexibile and easy to program in but may be too slow for creating blocks that must perform a large amount of computations. Instead, the bulk of blocks in GNU Radio are implemented in C++ for execution speed. You can create your own C++ signal processing blocks, but this is more challenging than writing blocks in Python. GNU Radio functionality is extended through the creation of Out-of-Tree (OOT) modules that also conveniently setup the details you need to successfully compile new C++ blocks.
|
|
As an interpreted language, Python is very flexibile and easy to program in but may be too slow for creating blocks that must perform a large amount of computations. Instead, the bulk of blocks in GNU Radio are implemented in C++ for execution speed. You can create your own C++ blocks but this is more challenging than writing blocks in Python. GNU Radio functionality is extended through the creation of Out-of-Tree (OOT) modules that also conveniently setup the details you need to successfully compile new C++ blocks.
|
|
|
|
|
|
See the GNU Radio following tutorials on out-of-tree modules and writig C++ blocks:
|
|
See the following GNU Radio tutorials on out-of-tree modules and writing C++ blocks:
|
|
|
|
|
|
- [Out of Tree Modules](https://wiki.gnuradio.org/index.php?title=OutOfTreeModules)
|
|
- [Out of Tree Modules](https://wiki.gnuradio.org/index.php?title=OutOfTreeModules)
|
|
- [Writing blocks in C++](https://wiki.gnuradio.org/index.php?title=Guided_Tutorial_GNU_Radio_in_C%2B%2B)
|
|
- [Writing blocks in C++](https://wiki.gnuradio.org/index.php?title=Guided_Tutorial_GNU_Radio_in_C%2B%2B)
|
... | @@ -80,7 +81,7 @@ See the GNU Radio following tutorials on out-of-tree modules and writig C++ bloc |
... | @@ -80,7 +81,7 @@ See the GNU Radio following tutorials on out-of-tree modules and writig C++ bloc |
|
|
|
|
|
Polymorphic Types (PMTs) are a GNU Radio construct used to represent concrete data types (bytes, integers, vectors, etc.) in an abstract way. They are a fundamental enabler of passing data between blocks through the use of stream tags and message passing.
|
|
Polymorphic Types (PMTs) are a GNU Radio construct used to represent concrete data types (bytes, integers, vectors, etc.) in an abstract way. They are a fundamental enabler of passing data between blocks through the use of stream tags and message passing.
|
|
|
|
|
|
See the following GNU Radio tutorial:
|
|
See the following GNU Radio tutorial on PMTs:
|
|
- [Polymorphic Types (PMTs)](https://wiki.gnuradio.org/index.php?title=Polymorphic_Types_(PMTs))
|
|
- [Polymorphic Types (PMTs)](https://wiki.gnuradio.org/index.php?title=Polymorphic_Types_(PMTs))
|
|
|
|
|
|
### Stream Tags
|
|
### Stream Tags
|
... | @@ -101,8 +102,14 @@ See the following GNU Radio tutorials on message passing: |
... | @@ -101,8 +102,14 @@ See the following GNU Radio tutorials on message passing: |
|
|
|
|
|
### Profiling
|
|
### Profiling
|
|
|
|
|
|
|
|
Because communication systems interact with the physical world, they must be able to process their data in real-time, that is to say, they must be able to keep up with the associated sample rate they are operating at. For a GNU Radio flowgraph, this means all blocks in the flowgraph must be able to keep up with the rate data is arriving on their input ports. This is obviously limited by the overall processing power of the machine the application is running on. It can be very helpful to know how much processing time each block in a flowgraph is taking in order to look for bottle necks, which can be done with *performance counters*.
|
|
|
|
|
|
|
|
See the following GNU Radio usage page on performance counters:
|
|
- [Performance Counters](https://wiki.gnuradio.org/index.php?title=Performance_Counters)
|
|
- [Performance Counters](https://wiki.gnuradio.org/index.php?title=Performance_Counters)
|
|
|
|
|
|
### VOLK
|
|
### VOLK
|
|
|
|
|
|
|
|
Hardware-based solutions have historically been the preferred way to implement the PHY of communication systems as they allow a high degree of parallelism to be achieved and can thus keep up with the processing needs of such applications. The microprocessors that run software-based solutions operate sequentially, but modern processors have vectorised instructions that allow the same operation to be applied to multiple data points simultaneously. This can significantly increase the rate data can be processed. GNU Radio uses a convenient library called the Vectorized Optimized Library of Kernels (VOLK) to make these vectorised instructions easily available.
|
|
|
|
|
|
|
|
See the following GNU Radio tutorial on using VOLK:
|
|
- [VOLK Guide](https://wiki.gnuradio.org/index.php?title=VOLK_Guide) |
|
- [VOLK Guide](https://wiki.gnuradio.org/index.php?title=VOLK_Guide) |
|
|
|
\ No newline at end of file |