Main Content

nrULSCH

Apply UL-SCH encoder processing chain

Description

The nrULSCH System object™ applies the uplink shared channel (UL-SCH) encoder processing chain to one or two transport blocks. The UL-SCH encoding process consists of cyclic redundancy check (CRC), code block segmentation and CRC, low-density parity-check (LDPC) encoding, rate matching, and code block concatenation. The object implements these aspects of TS 38.212 [1]:

  • Sections 6.2.1: Transport block CRC attachment

  • Sections 6.2.2: LDPC base graph selection

  • Sections 6.2.3: Code block segmentation and code block CRC attachment

  • Sections 6.2.4: Channel coding of UL-SCH

  • Sections 6.2.5: Rate matching

  • Sections 6.2.6: Code block concatenation

To apply the UL-SCH encoder processing chain:

  1. Create the nrULSCH object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

encUL = nrULSCH creates a UL-SCH encoder System object.

encUL = nrULSCH(Name,Value) creates the object with properties set by using one or more name-value pairs. Enclose the property name inside quotes, followed by the specified value. Unspecified properties take default values.

Example: For example, nrULSCH('MultipleHARQProcesses',true) creates the object and enables multiple hybrid automatic repeat-request (HARQ) processes.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Enable multiple HARQ processes, specified as false or true. When set to false, the object uses a single process. When set to true, the object uses multiple HARQ processes, at most 32. In both cases, to enable retransmissions when a failure occurs, the object buffers the input data.

Data Types: logical

Target code rate, specified as a real number in the interval (0, 1). The default value corresponds to 526/1024.

Tunable: Yes

Data Types: double

Enable limited buffer rate matching, specified as false or true. When set to false, the size of the internal buffer used for rate matching is the full coded length of each code block. When set to true, you can specify the size of the internal buffer used for rate matching by setting the LimitedBufferSize property.

Tunable: Yes

Data Types: logical

Limited buffer size used for rate matching, specified as a positive integer. The default value corresponds to 384×66, which is the maximum coded length of a code block. The default value implies no limit on the buffer size.

Tunable: Yes

Dependencies

To enable this property, set LimitedBufferRateMatching to true.

Data Types: double

Since R2024a

Enable cell output format, irrespective of the number of codewords, specified as one of these logical values:

  • 0 (false) — This option corresponds to the default behavior of the object in which the codedBits output is returned as a column vector for a single codeword or as a cell array for two codewords.

  • 1 (true) — The object returns codedBits as a cell array irrespective of the number of codewords.

Data Types: logical | double

Usage

Description

codedBits = encUL(mod,nLayers,outlen,rv) applies the UL-SCH encoder processing chain to one or two transport blocks. The object returns the encoded, rate-matched, and concatenated code blocks as one or two codewords of length outlen. Before you call this object, you must load the transport blocks into the object by using the setTransportBlock object function. mod specifies the modulation scheme. nLayers specifies the number of transmission layers. rv specifies the redundancy version of the transmission.

example

codedBits = encUL(___,harqID) specifies the HARQ process number harqID used with the current transmission in addition to the input arguments in the previous syntax. To use this syntax, set the MultipleHARQProcesses property to true. When the property is set to false, the object uses HARQ process number 0.

example

Input Arguments

expand all

Modulation scheme, specified as 'pi/2-BPSK', 'QPSK', '16QAM', '64QAM', '256QAM', a string array, or a cell array of character vectors. This modulation scheme determines the modulation type and number of bits used per modulation symbol. For two transport blocks, the modulation scheme applies to both blocks. Alternatively, you can specify different modulation schemes for each transport block by using a string array or a cell array of character vectors.

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

Data Types: char | string

Number of transmission layers, specified as an integer from 1 to 8. For nLayers > 4, the object expects two encoded transports blocks as input.

Data Types: double

Output codeword length, in bits, specified as a nonnegative integer or a 1-by-2 vector of nonnegative integers. If you specify outlen as a scalar, the object applies scalar expansion when processing two transport blocks. To specify a different codeword length for each transport block, specify outlen as a vector.

The actual output length is a multiple of the product of the number of bits per symbol and the number of transmission layers. For example, for 64-QAM and 1 transmission layer, if you specify 16 for outlen, the actual output length is 6x1x3 = 18.

Data Types: double

Redundancy version, specified as one of these options:

  • Integer from 0 to 3 — Use this option to specify the redundancy version for a single transport block.

  • 1-by-2 vector of integers from 0 to 3 — Use this option to specify the redundancy version for two transport blocks.

Data Types: double

HARQ process number, specified as an integer from 0 to 31. To specify a value other than 0, set the MultipleHARQProcesses object property to true.

Data Types: double

Output Arguments

expand all

One or two UL-SCH codewords, returned as a binary column vector or a cell array of two binary column vectors. A codeword is the encoded, rate-matched, and concatenated code blocks obtained by processing one transport block. Specify the length of the codewords by using the outlen input argument.

Data Types: int8

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

getTransportBlockGet transport block from UL-SCH or DL-SCH encoder
setTransportBlockLoad transport block into UL-SCH or DL-SCH encoder
stepRun System object algorithm
cloneCreate duplicate System object
isLockedDetermine if System object is in use
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Generate a random sequence of binary values corresponding to one transport block of length 5120.

trBlkLen = 5120;
trBlk = randi([0 1],trBlkLen,1,'int8');

Create and configure an UL-SCH encoder System object with the specified target code rate.

targetCodeRate = 567/1024;
encUL = nrULSCH;
encUL.TargetCodeRate = targetCodeRate;

Load the transport block into the UL-SCH encoder.

setTransportBlock(encUL,trBlk);

Call the encoder with 64-QAM modulation scheme, 1 transmission layer, an output length of 10,240 bits, and redundancy version 0. The encoder applies the UL-SCH processing chain to the transport block loaded into the object.

mod = '64QAM';
nLayers = 1;
outlen = 10240;
rv = 0;
codedTrBlock = encUL(mod,nLayers,outlen,rv);

Create and configure an UL-SCH decoder System object.

decUL = nrULSCHDecoder;
decUL.TargetCodeRate = targetCodeRate;
decUL.TransportBlockLength = trBlkLen;

Call the UL-SCH decoder on the soft bits representing the encoded transport block. Use the configuration parameters specified for the encoder. The error flag in the output indicates that the block decoding does not have errors.

rxSoftBits = 1.0 - 2.0*double(codedTrBlock);
[decbits,blkerr] = decUL(rxSoftBits,mod,nLayers,rv)
decbits = 5120x1 int8 column vector

   1
   1
   0
   1
   1
   0
   0
   1
   1
   1
      ⋮

blkerr = logical
   0

Verify that the transmitted and received message bits are identical.

isequal(decbits,trBlk)
ans = logical
   1

Generate a random sequence of binary values corresponding to one transport block of length 5120.

trBlkLen = 5120;
trBlk = randi([0 1],trBlkLen,1,'int8');

Create and configure an UL-SCH encoder System object for use with multiple HARQ processes.

encUL = nrULSCH;
encUL.MultipleHARQProcesses = true;

Load the transport block into the UL-SCH encoder, specifying HARQ process number 2.

harqID = 2;
setTransportBlock(encUL,trBlk,harqID);

Call the encoder with QPSK modulation scheme, 3 transmission layers, an output length of 10,002 bits, and redundancy version 3. The encoder applies the UL-SCH processing chain to the transport block loaded into the object for HARQ process number 2.

mod = 'QPSK';
nLayers = 3;
outlen = 10002;
rv = 3;
codedTrBlock = encUL(mod,nLayers,outlen,rv,harqID);

Verify that the encoded transport block has the required number of bits.

isequal(length(codedTrBlock),outlen)
ans = logical
   1

References

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

[2] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

Extended Capabilities

Version History

Introduced in R2019a

expand all

See Also

Objects

Functions