Your First Flowgraph: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 32: Line 32:
[[File:SearchBlockLibrary.png|500px]]
[[File:SearchBlockLibrary.png|500px]]


Search for the ''Signal Source'' and then drag and drop it into the GRC workspace:
Search for the ''Signal Source'' block and then drag and drop it into the GRC workspace:


[[File:SearchSignalSourceBlock.png|250px]]
[[File:SearchSignalSourceBlock.png|250px]]
Line 39: Line 39:


[[File:UnconnectedFlowgraph.png|500px]]
[[File:UnconnectedFlowgraph.png|500px]]
The ''Signal Source'' block will create a complex sinusoid, ''QT GUI Frequency Sink'' will display the magnitude of the frequency spectrum of the complex sinusoid and ''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).
[[File:MakeFirstConnection.png|500px]]
You will notice that the ''Signal Source'' block text has changed from red to black. The red text shows a user that a block still has an input or output that needs to be connected before the flowgraph can be run. Now connect the throttle output to the frequency sink and time sink:
[[File:ConnectedFlowgraph.png|500px]]

Revision as of 17:20, 3 January 2022

This tutorial will guide you through running your first flowgraph in GNURadio.

Starting GNURadio Companion

The GNURadio Companion (GRC) is a visual editor for assembling and flowgraphs. GRC uses .grc files which are then translated into Python .py flowgraphs. Start GRC by opening a terminal and typing:

$ gnuradio-companion &

NewGRCFlowgraph.png


Double click the Options block on the upper left hand corner and name your flowgraph by editing the Id and Title entries:

NameYourFlowgraph.png

The Id will be the filename of the Python flowgraph which in this case will be sineWaveFlowgraph.py. The Title entry is a description of the flowgraph. Click OK to save your changes.


Click File : Save to save your GRC Flowgraph.

GRCClickSave.png

You will then need to enter a name for your .grc file which is sineWaveGRC.grc to distinguish it from the .py flowgraph.

EnterGRCName.png

Now that the GRC file is named and saved, blocks can be added to create your first flowgraph.


Adding Blocks

GNURadio comes with a large pre-existing library of signal processing blocks. The blocks can be browsed using the arrows in the right hand column, or you may search for blocks by using CTRL+F or by selecting the magnifying glass (highlighted in red):

SearchBlockLibrary.png

Search for the Signal Source block and then drag and drop it into the GRC workspace:

SearchSignalSourceBlock.png

Now search for Throttle, QT GUI Frequency Sink and QT GUI Time Sink. Drag and drop each of the blocks into the workspace so the flowgraph looks like the following:

UnconnectedFlowgraph.png

The Signal Source block will create a complex sinusoid, QT GUI Frequency Sink will display the magnitude of the frequency spectrum of the complex sinusoid and 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).

MakeFirstConnection.png

You will notice that the Signal Source block text has changed from red to black. The red text shows a user that a block still has an input or output that needs to be connected before the flowgraph can be run. Now connect the throttle output to the frequency sink and time sink:

ConnectedFlowgraph.png