UChar To Float: Difference between revisions
(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...") |
Jesternofool (talk | contribs) (Added a second example - the raw output values of a RTL-SDR (collected using the "rtl_sdr" command)) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Block Docs]] | [[Category:Block Docs]] | ||
Convert stream of unsigned chars to a stream of floats. A ''UChar'' data type is an unsigned 8-bit integer, meaning it will have integer values between 0 - 255. | |||
== Example Flowgraphs == | |||
== | === Example #1 - Showing Binary Values === | ||
This flowgraph shows the outputs of AND, OR, and XOR logic blocks converted to Float to display in a Time Sink. | |||
[[File:And_Or_Xor_fg.png|700px]] | |||
: | [[File:And_Or_Xor_out.png|700px]] | ||
=== Example #2 - Showing the Raw Output Values of a RTL-SDR === | |||
Samples collected using the "rtl_sdr" command from a terminal will collect raw samples as provided by a RTL-SDR. These are unsigned 8-bit integer values, meaning they have values from 0 - 255. | |||
The flowgraph used to read the sample file is as follows: | |||
[[File:Uchar-to-Float-block-usage-with-RTLSDR-flowgraph.png|800px]] | |||
The flowgraph takes the values and uses the ''UChar to Float'' block to input the samples from the original file source. The [[Stream Demux]] block separates the real and imaginary samples, which are input to the [[Float To Complex]] block. The [[QT GUI Time Sink]] shows the complex samples with values from 0 - 255, as shown below. | |||
[[File:Uchar-to-Float-time-sink-from-RTLSDR-file.png|800px]] | |||
== Source Files == | == Source Files == | ||
; C++ | ; C++ files | ||
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/uchar_to_float_impl.cc] | |||
: [https://github.com/gnuradio/gnuradio | |||
; Header files | ; Header files | ||
: [https://github.com/gnuradio/gnuradio | : [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/uchar_to_float_impl.h] | ||
; Public header files | ; Public header files | ||
: [https://github.com/gnuradio/gnuradio | : [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/include/gnuradio/blocks/uchar_to_float.h] | ||
; Block definition | ; Block definition | ||
: [https://github.com/gnuradio/gnuradio | : [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/grc/blocks_uchar_to_float.block.yml] |
Latest revision as of 02:51, 23 March 2025
Convert stream of unsigned chars to a stream of floats. A UChar data type is an unsigned 8-bit integer, meaning it will have integer values between 0 - 255.
Example Flowgraphs
Example #1 - Showing Binary Values
This flowgraph shows the outputs of AND, OR, and XOR logic blocks converted to Float to display in a Time Sink.
Example #2 - Showing the Raw Output Values of a RTL-SDR
Samples collected using the "rtl_sdr" command from a terminal will collect raw samples as provided by a RTL-SDR. These are unsigned 8-bit integer values, meaning they have values from 0 - 255.
The flowgraph used to read the sample file is as follows:
The flowgraph takes the values and uses the UChar to Float block to input the samples from the original file source. The Stream Demux block separates the real and imaginary samples, which are input to the Float To Complex block. The QT GUI Time Sink shows the complex samples with values from 0 - 255, as shown below.
Source Files
- C++ files
- [1]
- Header files
- [2]
- Public header files
- [3]
- Block definition
- [4]