setTransportBlock

Load transport block into UL-SCH or DL-SCH encoder

Description

setTransportBlock(enc,trblk) loads the transport block trblk into the specified uplink (UL) or downlink (DL) shared channel (SCH) encoder System object™ enc. Call this function before calling enc.

example

setTransportBlock(encDL,trblk,trblkID) loads the transport block trblk into the specified DL-SCH encoder System object encDL for the specified transport block number trblkID. Call this function before calling encDL.

example

setTransportBlock(___,harqID) loads the transport block for the specified hybrid automatic repeat-request (HARQ) process number harqID. Specify harqID in addition to the input arguments in any of the previous syntaxes.

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 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

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 a DL-SCH encoder System object for use with multiple HARQ processes.

encDL = nrDLSCH;
encDL.MultipleHARQProcesses = true;

Load transport block trBlk for transport block number 0 into the DL-SCH encoder, specifying HARQ process number 2.

harqID = 2;
trBlkID = 0;
setTransportBlock(encDL,trBlk,trBlkID,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 DL-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 = encDL(mod,nLayers,outlen,rv,harqID);

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

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

Input Arguments

collapse all

UL-SCH or DL-SCH encoder, specified as an nrULSCH or nrDLSCH System object. The objects implement the UL-SCH and DL-SCH processing chains specified in TS 38.212 Section 6.2 and Section 7.2, respectively.

Transport block, specified as a binary column vector or a cell array of one or two binary column vectors. The cell array option applies only when enc is a DL-SCH encoder System object. The two-element cell array option applies only when the transport block number trblkID is not specified for DL-SCH processing.

Data Types: int8 | double | logical

DL-SCH encoder, specified as an nrDLSCH System object. The object implements the DL-SCH processing chain specified in TS 38.212 Section 7.2.

Transport block number in DL-SCH processing, specified as 0 or 1.

Data Types: double

HARQ process number, specified as an integer from 0 to 15.

Data Types: double

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™.

See Also

Functions

Objects

Introduced in R2019a