Main Content

resetSoftBuffer

Reset soft buffer for HARQ process in UL-SCH or DL-SCH decoder

Description

resetSoftBuffer(decUL) resets the soft buffer for hybrid automatic repeat-request (HARQ) process number 0 in the specified UL-SCH decoder decUL.

example

resetSoftBuffer(decDL,cwid) resets the soft buffer for codeword index cwid and HARQ process number 0 in the specified DL-SCH decoder decDL. The codeword index cwid specifies one of the two possible codewords for DL-SCH decoding.

example

resetSoftBuffer = (___,harqID) resets the soft buffer for the specified HARQ process number harqID. Specify harqID in addition to the input arguments in any of the previous syntaxes.

To enable soft combining of retransmissions before low-density parity-check (LDPC) decoding, each decoder object maintains a soft buffer for each HARQ process. Upon successful decoding of the input, the object automatically resets the soft buffer for the HARQ process. Calling the resetSoftBuffer function resets the soft buffer manually. Call this function when decoding different transport blocks for the same HARQ process subsequently or when all redundancy versions for a HARQ process are complete.

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

encUL = nrULSCH('MultipleHARQProcesses',true);

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

harqID = 1;
setTransportBlock(encUL,trBlk1,harqID);

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.

rv = 0;
codedTrBlock1 = encUL('QPSK',1,10240,rv,harqID);

Create and configure an UL-SCH decoder System object with multiple HARQ processes.

decUL = nrULSCHDecoder('MultipleHARQProcesses',true);

Configure the decoder for the encoded transport block.

decUL.TransportBlockLength = trBlkLen1;

Add noise to the soft bits representing the encoded transport block. Call the UL-SCH decoder on the modified soft bits for HARQ process number 1.

rxSoftBits1 = awgn(1-2*double(codedTrBlock1),5);
[decBits1,blkErr1] = decUL(rxSoftBits1,'QPSK',1,rv,harqID);

The added noise results in an error during the decoding.

blkErr1
blkErr1 = logical
   1

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

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

Configure the decoder for the second transport block.

decUL.TransportBlockLength = trBlkLen2;

If an error occurred during the previous decoding with HARQ process number 1, you must reset the soft buffer of the HARQ process before decoding the second transport block.

if blkErr1   
    resetSoftBuffer(decUL,harqID);
end

Call the decoder on the soft bits representing the second encoded transport block using HARQ process number 1.

rxBits2 = 1-2*double(codedTrBlock2);
[decBits2,blkErr2] = decUL(rxBits2,'QPSK',1,rv,harqID);
blkErr2
blkErr2 = logical
   0

Verify that the second transmitted and decoded message bits are identical.

isequal(decBits2,trBlk2)
ans = logical
   1

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

encDL = nrDLSCH('MultipleHARQProcesses',true);

Load the transport block into the DL-SCH encoder for HARQ process number 1 and codeword index 1.

harqID = 1;
cwID = 0;
setTransportBlock(encDL,trBlk1,cwID,harqID);

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 DL-SCH processing chain to the transport block loaded into the object for HARQ process number 1.

rv = 0;
codedTrBlock1 = encDL('QPSK',1,10240,rv,harqID);

Create and configure a DL-SCH decoder System object with multiple HARQ processes.

decDL = nrDLSCHDecoder('MultipleHARQProcesses',true);

Configure the decoder for the encoded transport block.

decDL.TransportBlockLength = trBlkLen1;

Add noise to the soft bits representing the encoded transport block. Call the DL-SCH decoder on the modified soft bits for HARQ process number 1.

rxSoftBits1 = awgn(1-2*double(codedTrBlock1),5);
[decBits1,blkErr1] = decDL(rxSoftBits1,'QPSK',1,rv,harqID);

The added noise results in an error during decoding.

blkErr1
blkErr1 = logical
   1

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

trBlkLen2 = 4400;
trBlk2 = randi([0 1],trBlkLen2,1,'int8');
setTransportBlock(encDL,trBlk2,cwID,harqID); 
codedTrBlock2 = encDL('QPSK',1,8800,rv,harqID);

Configure the decoder for the second transport block.

decDL.TransportBlockLength = trBlkLen2;

If an error occurred during the previous decoding with HARQ process number 1, you must reset the soft buffer of the HARQ process before decoding the second transport block.

if blkErr1   
    resetSoftBuffer(decDL,harqID);
end

Call the decoder on the soft bits representing the second encoded transport block using HARQ process number 1.

rxBits2 = 1-2*double(codedTrBlock2);
[decBits2,blkErr2] = decDL(rxBits2,'QPSK',1,rv,harqID);
blkErr2
blkErr2 = logical
   0

Verify that the second transmitted and decoded message bits are identical.

isequal(decBits2,trBlk2)
ans = logical
   1

Input Arguments

collapse all

UL-SCH decoder, specified as a nrULSCHDecoder System object. The object implements the UL-SCH decoder processing chain corresponding to the inverse operation of UL-SCH encoding specified in TR 38.212 Section 6.2.

DL-SCH decoder, specified as a nrDLSCHDecoder System object. The object implements the DL-SCH decoder processing chain corresponding to the inverse operation of DL-SCH encoding specified in TR 38.212 Section 7.2.

DL-SCH codeword index, 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™.

Introduced in R2019a