FEC Async Encoder: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
 
(2 intermediate revisions by 2 users not shown)
Line 27: Line 27:
== Example Flowgraph ==
== Example Flowgraph ==


This flowgraph can be found at [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/examples/fecapi_polar_encoders.grc]
This flowgraph converts the Message Strobe bytes into a PDU of unpacked bits and then encodes them with a Repetition encoder. The encoder output is converted to a stream of float values which are put into a PDU. The Async Decoder reverses the bit order and creates packed bytes of output.


[[File:Fecapi_polar_encoders_fg.png|800px]]
[[File:Fec_async_test_fg.png|799px]]


== Source Files ==
== Source Files ==


; C++ files
; C++ files
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/lib/async_encoder_impl.cc]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-fec/lib/async_encoder_impl.cc async_encoder_impl.cc]


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/lib/async_encoder_impl.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-fec/lib/async_encoder_impl.h async_encoder_impl.h]


; Public header files
; Public header files
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/include/gnuradio/fec/async_encoder.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-fec/include/gnuradio/fec/async_encoder.h async_encoder.h]


; Block definition
; Block definition
: [https://github.com/gnuradio/gnuradio/blob/master/gr-fec/grc/fec_async_encoder.block.yml]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-fec/grc/fec_async_encoder.block.yml fec_async_encoder.block.yml]

Latest revision as of 05:43, 26 January 2022

Encodes frames received as async messages or as a PDU over a message port. This encoder works off a full message as one frame or block to encode. The message length is used as the frame length. To support this, the encoder variable used will have had its frame_size set. This block treats that initial frame_size value as the maximum transmission unit (MTU) and will not process frames larger than that.

This deployment works off messages and expects them to either be messages full of unpacked bits or PDU messages, which means full bytes of a frame from the higher layers, including things like headers, tails, CRC check bytes, etc. For handling PDUs, set the packed option of this deployment block to True. The block will then use the FEC API to properly unpack the bits from the PDU, pass it through the encoder, and repack them to output the PDUs for the next stage of processing.

The packed PDU form of this deployment is designed to work well with other PDU-based blocks to operate within the processing flow of data packets or frames.

Due to differences in how data is packed and processed, this block also offers the ability to change the direction of how bits are unpacked and packed, where reading or writing from the LSB or MSB. By default, the rev_unpack and rev_pack modes are set to True. Using this setup allows the async block to behave with PDUs in the same operation and format as the tagged stream encoders. That is, putting the same data into both the tagged stream encoder deployment and this with these default settings should produce the same data.

Parameters

Encoder Obj.
An FECAPI encoder object child of the generic_encoder class.
MTU (bytes)
The Maximum Transmission Unit (MTU) of the input frame that the block will be able to process. Specified in bytes and defaults to 1500.
Packed
True if working on packed bytes (like PDUs).
Rev. Unpacking
Reverse the unpacking order from input bytes to bits.
Rev. Packing
Reverse the packing order from bits to output bytes.

Example Flowgraph

This flowgraph converts the Message Strobe bytes into a PDU of unpacked bits and then encodes them with a Repetition encoder. The encoder output is converted to a stream of float values which are put into a PDU. The Async Decoder reverses the bit order and creates packed bytes of output.

Fec async test fg.png

Source Files

C++ files
async_encoder_impl.cc
Header files
async_encoder_impl.h
Public header files
async_encoder.h
Block definition
fec_async_encoder.block.yml