Hier Blocks and Parameters: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
Line 29: Line 29:
* Cutoff Freq (Hz): ''samp_rate/4''
* Cutoff Freq (Hz): ''samp_rate/4''
* Transition Width (Hz): ''samp_rate/8''
* Transition Width (Hz): ''samp_rate/8''
== Create The Hier Block ==


Click and drag in the workspace window to select the ''Signal Source'' and ''Multiply'' blocks, as well as the connection between them:
Click and drag in the workspace window to select the ''Signal Source'' and ''Multiply'' blocks, as well as the connection between them:
Line 38: Line 40:


[[File:ClickCreateHier.png|700px]]
[[File:ClickCreateHier.png|700px]]
A flowgraph will be created in a new GRC tab:
[[File:NewHierBlock.png|500px]]

Revision as of 17:26, 12 January 2022

Template:TutorialNavigation

This tutorial describes how to create a hierarchical block, or Hier block, in GRC. The previous tutorial, Creating Your First Block, demonstrates how to create your first GNU Radio block using the Embedded Python Block.

Creating the Flowgraph

A hier block is used to encapsulate and simplify multiple GNU Radio blocks into a single block. The example hier block will be a frequency shifter block which multiplies a Signal Source against an input signal.

The first step is creating the flowgraph. Drag and drop the following blocks into the workspace:

  1. Signal Source
  2. Multiply
  3. Noise Source
  4. Low Pass Filter
  5. Throttle
  6. QT GUI Frequency Sink
  7. QT GUI Range

Connect the blocks:

StartingFlowgraphHierBlock.png

Update the QT GUI Range properties:

  • Id: frequency
  • Default Value: 0
  • Start: -samp_rate/2
  • Stop: samp_rate/2

Update the Low Pass Filter properties:

  • Cutoff Freq (Hz): samp_rate/4
  • Transition Width (Hz): samp_rate/8

Create The Hier Block

Click and drag in the workspace window to select the Signal Source and Multiply blocks, as well as the connection between them:

ClickAndDragSelect.png


Right-click on the highlighted blocks and select More > Create Hier:

ClickCreateHier.png


A flowgraph will be created in a new GRC tab:

NewHierBlock.png