Main Content

nrUCIEncode

Encode uplink control information (UCI)

Description

codeduci = nrUCIEncode(ucibits,E) encodes UCI message bits ucibits and returns concatenated, rate-matched, and encoded UCI blocks of length E. The returned blocks can be mapped to either the physical uplink control channel (PUCCH) or the physical uplink shared channel (PUSCH). The function implements TS 38.212 Sections 6.3.1.2–6.3.1.5 for PUCCH and Sections 6.3.2.2–6.3.2.5 for PUSCH [1]. The encoding consists of code block segmentation, cyclic redundancy check (CRC) attachment, channel coding, rate matching, and code block concatenation. The function supports polar encoding and small block lengths. The particular encoding scheme that the function implements depends on the input UCI message length. For more details, see Algorithms.

example

codeduci = nrUCIEncode(ucibits,E,mod) also specifies the modulation scheme for the encoding. The specified modulation scheme applies only when the length of ucibits is 1 or 2. When not specified, the modulation scheme defaults to QPSK. In the output, –1 and –2 represent the x and y placeholders, respectively, in Tables 5.3.3.1-1 and 5.3.3.2-1.

example

Examples

collapse all

Create a random sequence of binary values corresponding to a UCI message of 32 bits.

ucibits = randi([0 1],32,1,'int8');

Encode the message for the specified rate-matched output length.

E = 120;
codeduci = nrUCIEncode(ucibits,E)
codeduci = 120x1 int8 column vector

   1
   1
   1
   0
   1
   0
   1
   0
   0
   0
      ⋮

Create a random sequence of binary values corresponding to a two-bit UCI message.

ucibits = randi([0 1],2,1,'int8');

Encode the message for the specified rate-matched output length and 16-QAM modulation scheme.

E = 12;
codeduci = nrUCIEncode(ucibits,E,'16QAM')
codeduci = 12x1 int8 column vector

    1
    1
   -1
   -1
    0
    1
   -1
   -1
    1
    0
      ⋮

Input Arguments

collapse all

UCI message bits, specified as a column vector of binary values. ucibits is the information bits encoded before transmission on the PUCCH or PUSCH.

Data Types: double | int8

Length of rate-matched UCI codeword, in bits, specified as a positive integer. The valid range of E depends on A, the length of the input ucibits, as shown in this table.

AValid Range of E
1EA
2–11E > A
12–19E > A + 9
20–1706E > A + 11

Data Types: double

Modulation scheme, specified as 'QPSK', 'pi/2-BPSK', '16QAM', '64QAM', or '256QAM'. This modulation scheme determines the modulation type and number of bits used per modulation symbol, as shown in this table.

Modulation SchemeNumber of Bits Per Symbol
'pi/2-BPSK'1
'QPSK'2
'16QAM'4
'64QAM'6
'256QAM'8

This input argument applies only when the input ucibits is one or two bits.

Data Types: char | string

Output Arguments

collapse all

Coded UCI bits, returned as an E-by-1 column vector of integers from –2 to 1. codeduci inherits its data type from the input ucibits. Element values –1 and –2 represent the x and y placeholders, respectively, in Tables 5.3.3.1-1 and 5.3.3.2-1.

Data Types: double | int8

Algorithms

The UCI encoding consists of code block segmentation, cyclic redundancy check (CRC) attachment, channel coding, rate matching, and code block concatenation. The particular UCI encoding scheme that nrUCIEncode implements depends on A, the length of input ucibits.

ACode Block SegmentationCRC BitsEncoding
1N/AN/ARepetition
2N/AN/ASimplex
3–11N/AN/AReed-Muller
12–19N/A6Parity-check Polar
20–1706

Occurs only when A ≥ 1013 or when A ≥ 360 and E ≥ 1088

11Polar

References

[1] 3GPP TS 38.212. “NR; Multiplexing and channel coding.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2019a