Packing Bits: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
Line 7: Line 7:
== Packing Bits ==
== Packing Bits ==


Packing bits into a ''byte'' is useful in representing binary data (as opposed to digitized RF samples) as well when using the modulator blocks: ''Constellation Modulator'', ''GFSK Mod'' and ''OFDM Transmitter''.
Packing bits into a ''byte'' is useful in representing binary data (as opposed to digitized RF samples) as well when using the modulator blocks: ''Constellation Modulator'', ''GFSK Mod'' and ''OFDM Transmitter''. Create a new flowgraph and add the ''Random Source'' block to the workspace:
 
 
[[File:AddRandomSourceToWorkspace.png|500px]]


== Unpacking Bits ==
== Unpacking Bits ==

Revision as of 16:41, 21 January 2022

Template:TutorialNavigation

This tutorial describes how to pack 8 bits into a byte using the Pack K Bits block, and how unpack a byte into 8 bits, using the Unpack K Bits block.

The previous tutorial, Converting Data Types, describes the char or byte data type and how to convert between data types. The next tutorial, Streams and Vectors, describes the differences between streams and vectors and how to use them in flowgraphs.

Packing Bits

Packing bits into a byte is useful in representing binary data (as opposed to digitized RF samples) as well when using the modulator blocks: Constellation Modulator, GFSK Mod and OFDM Transmitter. Create a new flowgraph and add the Random Source block to the workspace:


AddRandomSourceToWorkspace.png

Unpacking Bits

  • pack and unpack bits
  • describe how it works for char/byte type



The next tutorial, Streams and Vectors, describes the differences between streams and vectors and how to use them in flowgraphs.