Low Pass Filter Example: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
No edit summary
(25 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div style="float:right">
{{Template:BeginnerTutorials}}
</div>
This tutorial describes how to use a low-pass filter in GNU Radio.


The previous tutorial, [[Python_Block_Tags|Python Block Tags]], describes how to read and write tags in a Python block. The next tutorial, [[Designing_Filter_Taps|Designing Filter Taps]], describes how to design a set of low-pass filter taps and apply them against a signal.


This tutorial will describe how to use a low-pass filter in GNU Radio. The previous tutorial can be found here: [[Creating_Your_First_Block|Creating Your First Block]]
== Creating the Flowgraph ==


Begin by adding the following blocks to the GRC work space:
Begin by adding the following blocks to the GRC work space:
Line 13: Line 18:


[[File:LPFTutorialFlowgraphStart.png|700px]]
[[File:LPFTutorialFlowgraphStart.png|700px]]
The ''QT GUI Range'' block is used to control the frequency of the ''Signal Source'' block. Double-click the ''QT GUI Range'' block and edit the properties:
* Id: ''frequency''
* Default Value: ''0''
* Start: ''-samp_rate/2''
* Stop: ''samp_rate/2''
[[File:SetQTGUIRangeValuesFrequency.png|500px]]
Click ''OK'' to save.
Double-click the ''Signal Source'' block and enter ''frequency'' from the ''QT GUI Range'' variable:
[[File:EditSignalSourceFrequency.png|500px]]
Click ''OK'' to save. The flowgraph looks like the following image. Notice that the ''Low Pass Filter'' has a ''Cutoff Freq'' and ''Transition Width'' of 0:
[[File:FlowgraphWithZeroCutoffFrequency.png|700px]]
Double-click the ''Low Pass Filter'' block and edit the properties:
* Cutoff freq: ''samp_rate/4''
* Transition Width: ''samp_rate/8''
[[File:SetLowPassFilterProperties.png|500px]]
The flowgraph is complete and looks like the following:
[[File:CompleteLPFFlowgraph.png|700px]]
== Run the Flowgraph ==
The flowgraph is complete! Run the flowgraph. The ''QT GUI Frequency Sink'' appears with a ''frequency'' slider bar:
[[File:RunLPFFlowgraph.png|700px]]
Scroll-wheel-click on the ''QT GUI Frequency'' window and select ''Max Hold'':
[[File:SelectMaxHold.png|700px]]
The ''Max Hold'' option retains and displays the maximum value at each frequency until the the flowgraph is closed. Clicking through multiple values of the ''frequency'' slider bar at the top shows the low pass filter response:
[[File:LPFMaxHoldDisplay.png|700px]]
The next tutorial, [[Designing_Filter_Taps|Designing Filter Taps]], describes how to design a set of low-pass filter taps and apply them against a signal.

Revision as of 15:38, 16 March 2022

Beginner Tutorials

Introducing GNU Radio

  1. What is GNU Radio?
  2. Installing GNU Radio
  3. Your First Flowgraph

Flowgraph Fundamentals

  1. Python Variables in GRC
  2. Variables in Flowgraphs
  3. Runtime Updating Variables
  4. Signal Data Types
  5. Converting Data Types
  6. Packing Bits
  7. Streams and Vectors
  8. Hier Blocks and Parameters

Creating and Modifying Python Blocks

  1. Creating Your First Block
  2. Python Block With Vectors
  3. Python Block Message Passing
  4. Python Block Tags

DSP Blocks

  1. Low Pass Filter Example
  2. Designing Filter Taps
  3. Sample Rate Change

This tutorial describes how to use a low-pass filter in GNU Radio.

The previous tutorial, Python Block Tags, describes how to read and write tags in a Python block. The next tutorial, Designing Filter Taps, describes how to design a set of low-pass filter taps and apply them against a signal.

Creating the Flowgraph

Begin by adding the following blocks to the GRC work space:

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

Connect the blocks in the following manner:

LPFTutorialFlowgraphStart.png

The QT GUI Range block is used to control the frequency of the Signal Source block. Double-click the QT GUI Range block and edit the properties:

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

SetQTGUIRangeValuesFrequency.png

Click OK to save.

Double-click the Signal Source block and enter frequency from the QT GUI Range variable:

EditSignalSourceFrequency.png

Click OK to save. The flowgraph looks like the following image. Notice that the Low Pass Filter has a Cutoff Freq and Transition Width of 0:

FlowgraphWithZeroCutoffFrequency.png


Double-click the Low Pass Filter block and edit the properties:

  • Cutoff freq: samp_rate/4
  • Transition Width: samp_rate/8

SetLowPassFilterProperties.png


The flowgraph is complete and looks like the following:

CompleteLPFFlowgraph.png


Run the Flowgraph

The flowgraph is complete! Run the flowgraph. The QT GUI Frequency Sink appears with a frequency slider bar:

RunLPFFlowgraph.png


Scroll-wheel-click on the QT GUI Frequency window and select Max Hold:

SelectMaxHold.png


The Max Hold option retains and displays the maximum value at each frequency until the the flowgraph is closed. Clicking through multiple values of the frequency slider bar at the top shows the low pass filter response:

LPFMaxHoldDisplay.png


The next tutorial, Designing Filter Taps, describes how to design a set of low-pass filter taps and apply them against a signal.