getTransportBlock

Get transport block from UL-SCH or DL-SCH encoder

Description

trblk = getTransportBlock(encUL) returns the transport block from the specified uplink shared channel (UL-SCH) encoder System object™. The function assumes that a transport block was previously loaded into the specified UL-SCH encoder by using the setTransportBlock function.

example

trblk = getTransportBlock(encDL,trblkID) returns the transport block from the specified downlink shared channel (DL-SCH) encoder System object encDL for the specified transport block number trblkID. The function assumes that a transport block was previously loaded into the specified DL-SCH encoder by using the setTransportBlock function.

example

trblk = getTransportBlock(___,harqID) returns the transport block loaded 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.

trBlkLen1 = 5120;
trBlk1 = randi([0 1],trBlkLen1,1,'int8');

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

targetCodeRate = 567/1024;
encUL = nrULSCH('MultipleHARQProcesses',true);
encUL.TargetCodeRate = targetCodeRate;

Load the transport block into the UL-SCH encoder for HARQ process number 1.

setTransportBlock(encUL,trBlk1,1);

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

encUL('QPSK',1,10240,0,1); 

Retrieve the transport block from the encoder for HARQ process number 1. Verify that the retrieved block is identical to the block originally loaded into the encoder for this HARQ process.

tmp = getTransportBlock(encUL,1);
isequal(tmp,trBlk1) 
ans = logical
   1

Repeat the encoding operation for a new transport block of length 4400 and HARQ process number 2.

trBlkLen2 = 4400;
trBlk2 = randi([0 1],trBlkLen2,1,'int8');
setTransportBlock(encUL,trBlk2,2); 
encUL('QPSK',1,8800,0,2);

Retrieve the first transport block again. Verify that the first transport block is still unchanged.

tmp = getTransportBlock(encUL,1);
isequal(tmp,trBlk1)
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 with multiple HARQ processes and the specified target code rate.

targetCodeRate = 567/1024;
encDL = nrDLSCH('MultipleHARQProcesses',true);
encDL.TargetCodeRate = targetCodeRate;

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

Retrieve the transport block for transport block number 0 from the encoder, specifying HARQ process number 2. Verify that the retrieved block is identical to the block originally loaded into the encoder for this HARQ process.

tmp = getTransportBlock(encDL,trBlkID,harqID);
isequal(tmp,trBlk)
ans = logical
   1

Input Arguments

collapse all

UL-SCH encoder, specified as an nrULSCH System object. The objects implements the UL-SCH processing chain specified in TS 38.212 Section 6.2.

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

Output Arguments

collapse all

Transport block, returned as a binary column vector.

Data Types: int8

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