Threshold: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(Created page with "Category:Block Docs Category:Stub Docs This is the template for the "Page-per-block Docs". This first section should describe what the block...")
 
(→‎Example Flowgraphs: : Adding reference to the Audio Source page's Sound Detector example)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
[[Category:Stub Docs]]
Output a 1 or zero based on a threshold value.
This is the template for the [[:Category:Block_Docs|"Page-per-block Docs"]].  This first section should describe what the block does and how to use it, using however many paragraphs necessary.  Note that the title of the wiki page should match the block's name in GRC, i.e. the one defined in the block's .grc file.  Look at the [[FFT]] Block for a good example.


As this is a basic template, it's also in the [[:Category:Stub_Docs|"Stub Docs category"]]. Please improve it.
Test the incoming signal against a threshold. If the signal
excedes the High value, it will change its output to 1, and if the signal
falls below the Low value, it will change its output to 0.


== Parameters ==
== Parameters ==
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>


; Param 1 (''R'')
; Low (''R'')
: Description of parameter, provide any tips or recommended values.  Note that the name of the parameter above should match the param's label that shows up in grc (e.g. Sample Rate).
: Low threshold. Outputs 0 if input goes below it


; Param 2
; High (''R'')
: blah blah blah
: High threshold. Outputs 1 if input goes above it


== Example Flowgraph ==
; Initial value
: Value to output before the input reach one of the thresholds. Can be any value, not just 0 or 1.


Insert description of flowgraph here, then show a screenshot of the flowgraph and the output if there is an interesting GUI. Currently we have no standard method of uploading the actual flowgraph to the wiki or git repo, unfortunately. The plan is to have an example flowgraph showing how the block might be used, for every block, and the flowgraphs will live in the git repo.
== Example Flowgraphs ==
 
=== Simple Example ===
 
This flowgraph can be found at [[Media:threshold_example.grc]]
 
[[File:Threshold_Example.png|800px]]
 
[[File:Threshold_Result.png]]
 
=== Advanced Example ===
 
This flowgraph can be found at [https://raw.githubusercontent.com/gnuradio/gnuradio/master/gr-pdu/examples/tags_to_pdu_example.grc]
 
[[File:Tags_to_pdu_fg.png|800px]]
 
=== Audio Example ===
 
The [[Audio_Source#Sound_detector_and_notifier|Sound detector and notifier]] example on the [[Audio Source]] page contains a simple threshold volume detector.


== Source Files ==
== Source Files ==


; C++ files
; C++ files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/lib/threshold_ff_impl.cc Here]


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/lib/threshold_ff_impl.h Here]


; Public header files
; Public header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/include/gnuradio/blocks/threshold_ff.h Here]


; Block definition
; Block definition
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/grc/blocks_threshold_ff.block.yml Yaml]

Latest revision as of 00:49, 7 January 2022

Output a 1 or zero based on a threshold value.

Test the incoming signal against a threshold. If the signal excedes the High value, it will change its output to 1, and if the signal falls below the Low value, it will change its output to 0.

Parameters

(R): Run-time adjustable

Low (R)
Low threshold. Outputs 0 if input goes below it
High (R)
High threshold. Outputs 1 if input goes above it
Initial value
Value to output before the input reach one of the thresholds. Can be any value, not just 0 or 1.

Example Flowgraphs

Simple Example

This flowgraph can be found at Media:threshold_example.grc

Threshold Example.png

Threshold Result.png

Advanced Example

This flowgraph can be found at [1]

Tags to pdu fg.png

Audio Example

The Sound detector and notifier example on the Audio Source page contains a simple threshold volume detector.

Source Files

C++ files
Here
Header files
Here
Public header files
Here
Block definition
Yaml