Add: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
[[Category:Stub Docs]]
Add samples across all input streams.  
Adds samples across all input streams, i.e.:


output = sum(input[0], input[1], ..., input[M-1])
For all n samples on all M input streams x_m:
output[n] = sum( x_0[n], x_1[n], ..., x_m[n])


As this is a basic template, it's also in the [[:Category:Stub_Docs|"Stub Docs category"]]. Please improve it.
== Supported Data Types ==
* Complex
* Float
* Int
* Short


== Parameters ==
== Parameters ==
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>
; IO Type
: Supported data types
:* Complex
:* Float
:* Int
:* Short


; Param 1 (''R'')
; Vec Length
: 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).
: Length of the vector


; Param 2
; Num Inputs
: blah blah blah
: Number of streams to add


== 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 uses an Add Block to generate the classic "dial tone".<br>
 
[[File:Add block fg.png|700px]]
 
[[File:Add_Block_out.png|700px]]


== 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_blk_impl.cc add_blk_impl.cc]


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/add_blk_impl.h add_blk_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_blk.h add_blk.h]


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

Latest revision as of 09:23, 25 August 2022

Add samples across all input streams.

For all n samples on all M input streams x_m:

output[n] = sum( x_0[n], x_1[n], ..., x_m[n])

Supported Data Types

  • Complex
  • Float
  • Int
  • Short

Parameters

IO Type
Supported data types
  • Complex
  • Float
  • Int
  • Short
Vec Length
Length of the vector
Num Inputs
Number of streams to add

Example Flowgraph

This flowgraph uses an Add Block to generate the classic "dial tone".

Add block fg.png

Add Block out.png

Source Files

C++ files
add_blk_impl.cc
Header files
add_blk_impl.h
Public header files
add_blk.h
Block definition
blocks_add_xx.block.yml