UChar To Float

From GNU Radio
Jump to navigation Jump to search

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.

And Or Xor fg.png And Or Xor out.png

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:

Uchar-to-Float-block-usage-with-RTLSDR-flowgraph.png

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.

Uchar-to-Float-time-sink-from-RTLSDR-file.png

Source Files

C++ files
[1]
Header files
[2]
Public header files
[3]
Block definition
[4]