gr::blocks::kernel::pack_k_bits
gnuradio/blocks/pack_k_bits.h
unsigned unsigned gr::blocks::kernel::pack_k_bits::d_k d_k gr::blocks::kernel::pack_k_bits::d_k
gr::blocks::kernel::pack_k_bits::pack_k_bits
(unsigned k)
pack_k_bits
gr::blocks::kernel::pack_k_bits::pack_k_bits
unsigned k

Make a pack_k_bits object.

k

number of bits to be packed.

k
gr::blocks::kernel::pack_k_bits::~pack_k_bits
()
~pack_k_bits
gr::blocks::kernel::pack_k_bits::~pack_k_bits
void void gr::blocks::kernel::pack_k_bits::pack (unsigned char *bytes, const unsigned char *bits, int nbytes) const pack gr::blocks::kernel::pack_k_bits::pack unsigned char * bytes const unsigned char * bits int nbytes

Perform the packing.

This block performs no bounds checking. It assumes that the input, `in`, has of length k*nbytes and that the output vector, `out`, has `nbytes` available for writing.

bytes

output vector (k-bits per byte) of the unpacked data

bits

The input vector of bits to pack

nbytes

The number of output bytes

void void gr::blocks::kernel::pack_k_bits::pack_rev (unsigned char *bytes, const unsigned char *bits, int nbytes) const pack_rev gr::blocks::kernel::pack_k_bits::pack_rev unsigned char * bytes const unsigned char * bits int nbytes

Same as pack() but reverses the bits.

int int gr::blocks::kernel::pack_k_bits::k () const k gr::blocks::kernel::pack_k_bits::k pack_k_bits

Converts a vector of bytes with 1 bit in the LSB to a byte with k relevant bits.

Example: k = 4 in = [0,1,0,1, 0x81,0x00,0x00,0x00] out = [0x05, 0x08]

k = 8 in = [1,1,1,1, 0,1,0,1, 0,0,0,0, 1,0,0,0] out = [0xf5, 0x08]

- gr::blocks::kernel::pack_k_bits
  d_k
- gr::blocks::kernel::pack_k_bits
  k
- gr::blocks::kernel::pack_k_bits
  pack
- gr::blocks::kernel::pack_k_bits
  pack_k_bits
- gr::blocks::kernel::pack_k_bits
  pack_rev
- gr::blocks::kernel::pack_k_bits
  ~pack_k_bits