Abs: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:
[[File:abs-block.png|100px]]
[[File:abs-block.png|100px]]


Takes absolute value of data stream (i.e. strips sign).  Only supports float, int, and short (not complex).
The abs block converts the input data stream into its absolute value i.e. the negative input values become positive output values and the positive values remain the same at both the input and the output.


== Parameters ==
== Parameters ==
; Vec Length
: Length of the vector


None
; IO Type
: Supported data types
:* Float
:* Int
:* Short


== 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
This flowgraph shows a sinusoid being passed through the Abs block, producing full-wave rectification.


[[File:abs-ex2.png|500px]]
[[File:abs-ex2.png|500px]]
Line 19: Line 25:


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


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/lib/abs_blk_impl.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/abs_blk_impl.h abs_blk_impl.h]


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


; Block definition
; Block definition
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/grc/blocks_abs_xx.block.yml GRC yaml]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/grc/blocks_abs_xx.block.yml blocks_abs_xx.block.yml]

Latest revision as of 09:21, 25 August 2022

Abs-block.png

The abs block converts the input data stream into its absolute value i.e. the negative input values become positive output values and the positive values remain the same at both the input and the output.

Parameters

Vec Length
Length of the vector
IO Type
Supported data types
  • Float
  • Int
  • Short

Example Flowgraph

This flowgraph shows a sinusoid being passed through the Abs block, producing full-wave rectification.

Abs-ex2.png

Abs-ex.png

Source Files

C++ files
abs_blk_impl.cc
Header files
abs_blk_impl.h
Public header files
abs_blk.h
Block definition
blocks_abs_xx.block.yml