Main Content

NR Polar Encoder

Perform polar encoding according to 5G NR standard

Since R2020a

  • NR Polar Encoder block

Libraries:
Wireless HDL Toolbox / Error Detection and Correction

Description

The NR Polar Encoder block implements a streaming polar encoder with hardware-friendly control signals. The 5G NR standard requires polar encoding for channel coding of the DCI, UCI, and BCH transmit channels.

The encoder implementation matches the nrPolarEncode (5G Toolbox) function.

You must specify the link direction because the coding scheme defined by the 5G NR standard is different for downlink and uplink messages. Downlink messages are encoded with interleaving and uplink messages do not use interleaving.

Because the latency of this operation can vary, the block provides an output signal, nextFrame, that indicates when the block is ready to accept new inputs. For more details, see the Latency section on this page.

Ports

Input

expand all

Input data bit, specified as a scalar.

The software supports double and single data types for simulation, but not for HDL code generation.

Data Types: fixdt(0,1,0) | Boolean | double | single

Control signals accompanying the sample stream, specified as a samplecontrol bus. The bus includes the start, end, and valid control signals, which indicate the boundaries of the frame and the validity of the samples.

  • start — Indicates the start of the input frame

  • end — Indicates the end of the input frame

  • valid — Indicates that the data on the input data port is valid

For more details, see Sample Control Bus.

Data Types: bus

Length of information block in bits, specified as a positive integer. For downlink messages, K must be in the range 36 to 164. For uplink messages, K must be in the range 18 to 25 or 31 to 1023.

Dependencies

To enable this port, set the Configuration source parameter to Input port.

Data Types: fixdt(0,10,0)

Rate-matched output length in bits, specified as a positive integer. Specify a value for E that is greater than K and less than or equal to 8192.

Dependencies

To enable this port, set the Configuration source parameter to Input port.

Data Types: fixdt(0,14,0)

Output

expand all

Encoded data bit, returned as a scalar. The block returns a message of N sequential bits. N is a power of two determined from the values of K and E. The maximum output message size is 512 bits when the Link direction is Downlink and 1024 bits when the Link direction is Uplink.

Data Types: fixdt(0,1,0) | Boolean | double | single

Control signals accompanying the sample stream, returned as a samplecontrol bus. The bus includes the start, end, and valid control signals, which indicate the boundaries of the frame and the validity of the samples.

  • start — Indicates the start of the output frame

  • end — Indicates the end of the output frame

  • valid — Indicates that the data on the output data port is valid

For more details, see Sample Control Bus.

Data Types: bus

The block sets this signal to 1 when the block is ready to accept the start of the next frame. If the block receives an input start signal while nextFrame is 0, the block discards the frame in progress and begins processing the new data.

For more information, see Using the nextFrame Output Signal.

Data Types: Boolean

Parameters

expand all

When you select Downlink, the block performs interleaving, as specified in the 5G NR standard. When you select Uplink, the block omits the interleaving logic.

Select Input port to enable the K and E ports. Select Property to use the Message length (K) and Rate-matched length (E) parameters.

For downlink messages, K must be in the range 36 to 164. For uplink messages, K must be in the range 18 to 25 or 31 to 1023.

Dependencies

To enable this parameter, set the Configuration source parameter to Property.

Specify a value for E that is greater than K and less than or equal to 8192.

Dependencies

To enable this parameter, set the Configuration source parameter to Property.

Tips

Algorithms

expand all

This block implements the encoder by using log2(N) parallel encoding stages. The block stores the whole message in the buffer, then interleaves and maps the information bits based on the pattern specified in the standard for the values of K and E. The interleaving step is included only when you set the Link direction parameter to Downlink.

This diagram shows the architecture of the polar encoder.

The block uses the Configuration stage when the input K and E values change. The block computes the new message length, N, and the locations of the information bits, then passes them to the buffer and the mapping stage. Because the mapping patterns are computed as needed, rather than stored in hardware, the block supports all K and E values within the supported range. The Configuration stage also computes the interleave pattern when you set the Link direction parameter to Downlink.

When you set the Configuration source parameter to Property, the K and E values are constants, so the decoder does not implement the Configuration stage. In this case, the block includes static lookup tables that contain the precomputed configuration.

References

[1] 3GPP TS 38.212. "NR; Physical channels and modulation." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network. URL: https://www.3gpp.org.

[2] Arikan, Erdal. "Channel Polarization: A Method for Constructing Capacity-Achieving Codes for Symmetric Binary-Input Memoryless Channels." IEEE Transactions on Information Theory 55, no. 7 (July 2009): 3051–73. https://doi.org/10.1109/TIT.2009.2021379.

Extended Capabilities

Version History

Introduced in R2020a

See Also

(5G Toolbox) |