GNU Radio gives the flexibility for creating an user defined block called as out-of-tree (OOT) module using the popular programming languages such as C++ & Python.
The user logic for performing various signal processing tasks can be written using python to develop an out-of-tree (OOT) module in GNU Radio Companion. Here, we are creating an OOT module in GNU Radio version 3.8.
Steps in creating an OOT module using Python Block
Step 1: Place the Embedded Python block from “Misc” section of the GRC library on the workspace.
Example Image:
Step 2: Double click on the block & for the code parameter, click on “Open in Editor”.
Example Image:
Step 3: Now, an editor will open which can be used for writing the user logic.
Example Image:
Step 4: Once, the user logic is written, then saving the code will generate the desired OOT module.
Generating an Arithmetic OOT module using Python Block
The Python code for the Arithmetic OOT module which performs Addition, Subtraction, Multiplication and Division is as shown below
OOT Module
Parameter Description:
Add_Const: Takes 32-bit float value to perform addition on the input port[0] & produce output at output port[0].
Sub_Const: Takes 32-bit float value to perform subtraction on the input port[1] & produce output at output port[1].
Div_Const: Takes 32-bit float value to perform division on the input port[2] & produce output at output port[2].
Mul_Const: Takes 32-bit float value to perform multiplication on the input port[3] & produce output at output port[3].
Flow Graph Illustrating the usage of Arithmetic OOT module
Simulation Results
For details, contact: info@tenettech.com