Add Const: 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...")
 
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
[[Category:Stub Docs]]
This block adds a constant value to each item that passes through it.   
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 necessaryNote 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.
output[m] = input[m] + constant vector
 
As this is a basic template, it's also in the [[:Category:Stub_Docs|"Stub Docs category"]]. Please improve it.


== 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'')
; IO Type
: 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).
: Supported data types
:* Complex
:* Float
:* Int
:* Short
 
; Constant (''R'')
: The value to be added to the input stream. It must be of the same type as the block IO type.


; Param 2
; Vec Length
: blah blah blah
: Length of the vector


== Example Flowgraph ==
== Example Flowgraph ==


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.
This flowgraph shows the use of the Add Const and the Multiply blocks to create an amplitude modulated signal.
 
[[File:Multiply_block_fg.png|600px]]
 
[[File:Multiply_Block_out.png|600px]]


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


; C++ files
; C++ files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_bb_impl.cc add_const_bb_impl.cc]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_cc_impl.cc add_const_cc_impl.cc]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_ff_impl.cc add_const_ff_impl.cc]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_ii_impl.cc add_const_ii_impl.cc]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_ss_impl.cc add_const_ss_impl.cc]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_v_impl.cc add_const_v_impl.cc]


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_bb_impl.h add_const_bb_impl.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_cc_impl.h add_const_cc_impl.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_ff_impl.h add_const_ff_impl.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_ii_impl.h add_const_ii_impl.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_ss_impl.h add_const_ss_impl.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_const_v_impl.h add_const_v_impl.h]


; Public header files
; Public header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/include/gnuradio/blocks/add_const_bb.h add_const_bb.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/include/gnuradio/blocks/add_const_cc.h add_const_cc.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/include/gnuradio/blocks/add_const_ff.h add_const_ff.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/include/gnuradio/blocks/add_const_ii.h add_const_ii.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/include/gnuradio/blocks/add_const_ss.h add_const_ss.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/include/gnuradio/blocks/add_const_v.h add_const_v.h]


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

Latest revision as of 09:30, 25 August 2022

This block adds a constant value to each item that passes through it. output[m] = input[m] + constant vector

Parameters

(R): Run-time adjustable

IO Type
Supported data types
  • Complex
  • Float
  • Int
  • Short
Constant (R)
The value to be added to the input stream. It must be of the same type as the block IO type.
Vec Length
Length of the vector

Example Flowgraph

This flowgraph shows the use of the Add Const and the Multiply blocks to create an amplitude modulated signal.

Multiply block fg.png

Multiply Block out.png

Source Files

C++ files
add_const_bb_impl.cc
add_const_cc_impl.cc
add_const_ff_impl.cc
add_const_ii_impl.cc
add_const_ss_impl.cc
add_const_v_impl.cc
Header files
add_const_bb_impl.h
add_const_cc_impl.h
add_const_ff_impl.h
add_const_ii_impl.h
add_const_ss_impl.h
add_const_v_impl.h
Public header files
add_const_bb.h
add_const_cc.h
add_const_ff.h
add_const_ii.h
add_const_ss.h
add_const_v.h
Block definition
blocks_add_const_vxx.block.yml