gnuradio.blocks: Byte Operators

gnuradio.blocks.packed_to_unpacked_bb(unsigned int bits_per_chunk, endianness_t endianness) → sptr

Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts.

input: stream of unsigned char; output: stream of unsigned char

This is the inverse of gr::blocks::unpacked_to_packed_XX.

The bits in the bytes or shorts input stream are grouped into chunks of bits and each resulting chunk is written right- justified to the output stream of bytes or shorts. All b or 16 bits of the each input bytes or short are processed. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr::blocks::packed_to_unpacked_XX_ followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

Constructor Specific Documentation:

Parameters:
  • bits_per_chunk
  • endianness
packed_to_unpacked_bb_sptr.active_thread_priority(self) → int
packed_to_unpacked_bb_sptr.set_thread_priority(self, int priority) → int
packed_to_unpacked_bb_sptr.thread_priority(self) → int
gnuradio.blocks.packed_to_unpacked_ii(unsigned int bits_per_chunk, endianness_t endianness) → sptr

Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts.

input: stream of int; output: stream of int

This is the inverse of gr::blocks::unpacked_to_packed_XX.

The bits in the bytes or shorts input stream are grouped into chunks of bits and each resulting chunk is written right- justified to the output stream of bytes or shorts. All b or 16 bits of the each input bytes or short are processed. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr::blocks::packed_to_unpacked_XX_ followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

Constructor Specific Documentation:

Parameters:
  • bits_per_chunk
  • endianness
packed_to_unpacked_ii_sptr.active_thread_priority(self) → int
packed_to_unpacked_ii_sptr.set_thread_priority(self, int priority) → int
packed_to_unpacked_ii_sptr.thread_priority(self) → int
gnuradio.blocks.packed_to_unpacked_ss(unsigned int bits_per_chunk, endianness_t endianness) → sptr

Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts.

input: stream of short; output: stream of short

This is the inverse of gr::blocks::unpacked_to_packed_XX.

The bits in the bytes or shorts input stream are grouped into chunks of bits and each resulting chunk is written right- justified to the output stream of bytes or shorts. All b or 16 bits of the each input bytes or short are processed. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr::blocks::packed_to_unpacked_XX_ followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

Constructor Specific Documentation:

Parameters:
  • bits_per_chunk
  • endianness
packed_to_unpacked_ss_sptr.active_thread_priority(self) → int
packed_to_unpacked_ss_sptr.set_thread_priority(self, int priority) → int
packed_to_unpacked_ss_sptr.thread_priority(self) → int
gnuradio.blocks.unpacked_to_packed_bb(unsigned int bits_per_chunk, endianness_t endianness) → sptr

Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts.

input: stream of unsigned char; output: stream of unsigned char

This is the inverse of gr::blocks::packed_to_unpacked_XX.

The low bits are extracted from each input byte or short. These bits are then packed densely into the output bytes or shorts, such that all 8 or 16 bits of the output bytes or shorts are filled with valid input bits. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr::blocks::packed_to_unpacked_XX followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

Constructor Specific Documentation:

Parameters:
  • bits_per_chunk
  • endianness
unpacked_to_packed_bb_sptr.active_thread_priority(self) → int
unpacked_to_packed_bb_sptr.set_thread_priority(self, int priority) → int
unpacked_to_packed_bb_sptr.thread_priority(self) → int
gnuradio.blocks.unpacked_to_packed_ii(unsigned int bits_per_chunk, endianness_t endianness) → sptr

Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts.

input: stream of int; output: stream of int

This is the inverse of gr::blocks::packed_to_unpacked_XX.

The low bits are extracted from each input byte or short. These bits are then packed densely into the output bytes or shorts, such that all 8 or 16 bits of the output bytes or shorts are filled with valid input bits. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr::blocks::packed_to_unpacked_XX followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

Constructor Specific Documentation:

Parameters:
  • bits_per_chunk
  • endianness
unpacked_to_packed_ii_sptr.active_thread_priority(self) → int
unpacked_to_packed_ii_sptr.set_thread_priority(self, int priority) → int
unpacked_to_packed_ii_sptr.thread_priority(self) → int
gnuradio.blocks.unpacked_to_packed_ss(unsigned int bits_per_chunk, endianness_t endianness) → sptr

Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts.

input: stream of short; output: stream of short

This is the inverse of gr::blocks::packed_to_unpacked_XX.

The low bits are extracted from each input byte or short. These bits are then packed densely into the output bytes or shorts, such that all 8 or 16 bits of the output bytes or shorts are filled with valid input bits. The right thing is done if bits_per_chunk is not a power of two.

The combination of gr::blocks::packed_to_unpacked_XX followed by gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the general case of mapping from a stream of bytes or shorts into arbitrary float or complex symbols.

Constructor Specific Documentation:

Parameters:
  • bits_per_chunk
  • endianness
unpacked_to_packed_ss_sptr.active_thread_priority(self) → int
unpacked_to_packed_ss_sptr.set_thread_priority(self, int priority) → int
unpacked_to_packed_ss_sptr.thread_priority(self) → int
gnuradio.blocks.pack_k_bits_bb(unsigned int k) → sptr

Converts a stream of bytes with 1 bit in the LSB to a byte with k relevent bits.

Constructor Specific Documentation:

Make a pack_k_bits block.

Parameters:k – number of bits to be packed.
pack_k_bits_bb_sptr.active_thread_priority(self) → int
pack_k_bits_bb_sptr.set_thread_priority(self, int priority) → int
pack_k_bits_bb_sptr.thread_priority(self) → int
gnuradio.blocks.repack_bits_bb(int k, int l = 8, string len_tag_key = "", bool align_output = False) → sptr

Pack bits from the input stream onto bits of the output stream.

No bits are lost here; any value for k and l (within [1, 8]) is allowed. On every fresh input byte, it starts reading on the LSB, and starts copying to the LSB as well.

If a packet length tag is given, this block assumes a tagged stream. In this case, the tag with the packet length is updated accordingly. Also, the number of input bits is padded with zeros if the number of input bits is not an integer multiple of , or bits are truncated from the input if is set to true.

Constructor Specific Documentation:

Parameters:
  • k – Number of relevant bits on the input stream
  • l – Number of relevant bits on the output stream
  • len_tag_key – If not empty, this is the key for the length tag.
  • align_output – If len_tag_key is given, this controls if the input or the output is aligned.
repack_bits_bb_sptr.active_thread_priority(self) → int
repack_bits_bb_sptr.set_thread_priority(self, int priority) → int
repack_bits_bb_sptr.thread_priority(self) → int
gnuradio.blocks.unpack_k_bits_bb(unsigned int k) → sptr

Converts a byte with k relevent bits to k output bytes with 1 bit in the LSB.

Constructor Specific Documentation:

Make an unpack_k_bits block.

Parameters:k – number of bits to unpack.
unpack_k_bits_bb_sptr.active_thread_priority(self) → int
unpack_k_bits_bb_sptr.set_thread_priority(self, int priority) → int
unpack_k_bits_bb_sptr.thread_priority(self) → int

Previous topic

gnuradio.blocks: Peak Detectors

Next topic

gnuradio.blocks: Level Controllers

This Page