GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
gr::fec::code::polar_encoder Class Reference

POLAR encoder for basic details see 'polar_common' class. More...

#include <gnuradio/fec/polar_encoder.h>

Public Member Functions

 ~polar_encoder () override
 
void generic_work (void *in_buffer, void *out_buffer) override
 
double rate () override
 
int get_input_size () override
 
int get_output_size () override
 
bool set_frame_size (unsigned int frame_size) override
 
const char * get_input_conversion () override
 
const char * get_output_conversion () override
 
- Public Member Functions inherited from gr::fec::generic_encoder
int unique_id ()
 
std::string alias ()
 
 generic_encoder (void)
 
 generic_encoder (std::string name)
 
virtual ~generic_encoder ()
 
- Public Member Functions inherited from gr::fec::code::polar_common
 polar_common (int block_size, int num_info_bits, std::vector< int > frozen_bit_positions, std::vector< uint8_t > frozen_bit_values)
 
 ~polar_common ()
 

Static Public Member Functions

static generic_encoder::sptr make (int block_size, int num_info_bits, std::vector< int > frozen_bit_positions, std::vector< uint8_t > frozen_bit_values, bool is_packed=false)
 

Additional Inherited Members

- Public Types inherited from gr::fec::generic_encoder
typedef std::shared_ptr< generic_encodersptr
 
- Public Attributes inherited from gr::fec::generic_encoder
int my_id
 
std::string d_name
 
- Static Public Attributes inherited from gr::fec::generic_encoder
static int base_unique_id
 
- Protected Member Functions inherited from gr::fec::code::polar_common
const int block_size () const
 
const int block_power () const
 
const int num_info_bits () const
 
long bit_reverse (long value, int active_bits) const
 
void print_packed_bit_array (const unsigned char *printed_array, const int num_bytes) const
 
void print_unpacked_bit_array (const unsigned char *bits, const unsigned int num_bytes) const
 
void setup_info_bit_positions_reversed ()
 
void setup_volk_vectors ()
 
void volk_encode (unsigned char *out_buf, const unsigned char *in_buf)
 
void volk_encode_block (unsigned char *out_buf, unsigned char *in_buf)
 
- Protected Attributes inherited from gr::fec::generic_encoder
gr::logger_ptr d_logger
 
- Protected Attributes inherited from gr::fec::code::polar_common
std::vector< int > d_frozen_bit_positions
 
std::vector< uint8_t > d_frozen_bit_values
 
std::vector< int > d_info_bit_positions
 
std::vector< int > d_info_bit_positions_reversed
 
volk::vector< unsigned char > d_volk_temp
 
volk::vector< unsigned char > d_volk_frozen_bit_mask
 
volk::vector< unsigned char > d_volk_frozen_bits
 

Detailed Description

POLAR encoder for basic details see 'polar_common' class.

expects values with MSB first. It needs a full information word and encodes it in one pass. Output is a codeword of block_size.

Constructor & Destructor Documentation

◆ ~polar_encoder()

gr::fec::code::polar_encoder::~polar_encoder ( )
override

Member Function Documentation

◆ generic_work()

void gr::fec::code::polar_encoder::generic_work ( void *  in_buffer,
void *  out_buffer 
)
overridevirtual

◆ get_input_conversion()

const char* gr::fec::code::polar_encoder::get_input_conversion ( )
inlineoverridevirtual

Set up a conversion type required to setup the data properly for this encoder. The encoder itself will not implement the conversion and expects an external wrapper (e.g., fec.extended_encoder) to read this value and "do the right thing" to format the data.

The default behavior is 'none', which means no conversion is required. Whatever the get_input_item_size() value returns, the input is expected to conform directly to this. Generally, this means unpacked bytes.

If 'pack', the block expects the inputs to be packed bytes. The wrapper should implement a gr::blocks::pack_k_bits_bb(8) block for this.

The child class MAY implement this function. If not reimplemented, it returns "none".

Reimplemented from gr::fec::generic_encoder.

◆ get_input_size()

int gr::fec::code::polar_encoder::get_input_size ( )
inlineoverridevirtual

Returns the input size in items that the encoder object uses to encode a full frame. Often, this number is the number of bits per frame if the input format is unpacked. If the block expects packed bytes, then this value should be the number of bytes (number of bits / 8) per input frame.

The child class MUST implement this function.

Implements gr::fec::generic_encoder.

◆ get_output_conversion()

const char* gr::fec::code::polar_encoder::get_output_conversion ( )
inlineoverridevirtual

Set up a conversion type required to understand the output style of this encoder. Generally an encoder will produce unpacked bytes with a bit set in the LSB.

The default behavior is 'none', which means no conversion is required and the encoder produces unpacked bytes.

If 'packed_bits', the block produces packed bits and the wrapper should unpack these (using, for instance, gr::block::unpack_k_bits_bb(8)).

The child class MAY implement this function. If not reimplemented, it returns "none".

Reimplemented from gr::fec::generic_encoder.

◆ get_output_size()

int gr::fec::code::polar_encoder::get_output_size ( )
inlineoverridevirtual

Returns the output size in items that the encoder object produces after encoding a full frame. Often, this number is the number of bits in the outputted frame if the input format is unpacked. If the block produces packed bytes, then this value should be the number of bytes (number of bits / 8) per frame produced. This value is generally something like R*get_input_size() for a 1/R rate code.

The child class MUST implement this function.

Implements gr::fec::generic_encoder.

◆ make()

static generic_encoder::sptr gr::fec::code::polar_encoder::make ( int  block_size,
int  num_info_bits,
std::vector< int >  frozen_bit_positions,
std::vector< uint8_t >  frozen_bit_values,
bool  is_packed = false 
)
static

Factory for a polar code encoder object.

Parameters
block_sizedefines the codeword size. It MUST be a power of 2.
num_info_bitsrepresents the number of information bits in a block. Also called frame_size.
frozen_bit_positionsis an integer vector which defines the position of all frozen bits in a block. Its size MUST be equal to block_size - num_info_bits. Also it must be sorted and every position must only occur once.
frozen_bit_valuesholds an unpacked byte for every frozen bit position. It defines if a frozen bit is fixed to '0' or '1'. Defaults to all ZERO.
is_packedchoose 1 active bit/byte or 8 active bit/byte. if false, VOLK polar encoder is used.

◆ rate()

double gr::fec::code::polar_encoder::rate ( )
inlineoverridevirtual

Returns the rate of the code. For every 1 input bit, there are r output bits, so the rate is 1/r. Used for setting things like the encoder block's relative rate.

This function MUST be reimplemented by the child class.

Implements gr::fec::generic_encoder.

◆ set_frame_size()

bool gr::fec::code::polar_encoder::set_frame_size ( unsigned int  frame_size)
inlineoverridevirtual

Updates the size of the frame to encode.

The child class MUST implement this function and interpret how the frame_size information affects the block's behavior. It should also provide bounds checks.

Implements gr::fec::generic_encoder.


The documentation for this class was generated from the following file: