Main Content

nrPUSCHDescramble

Perform PUSCH descrambling

Description

example

cw = nrPUSCHDescramble(in,nid,rnti) returns a column vector of soft bits resulting from the inverse operation of physical uplink shared channel (PUSCH) scrambling from TS 38.211 Section 6.3.1.1 [1]. in is a vector of scrambled soft bits, nid is the scrambling identity, and rnti is the radio network temporary identifier (RNTI) of the user equipment (UE). When you use this syntax, the function descrambles only the data bits because the placeholder bit locations for any uplink control information (UCI), if present, are unknown in this case.

example

cw = nrPUSCHDescramble(in,nid,rnti,xInd,yInd) returns a column vector of soft bits by taking into account the UCI placeholder X bit locations, xInd, and the UCI placeholder Y bit locations, yInd. The inputs xInd and yInd are 1-based column vectors within the codeword and indicate the respective placeholder locations.

Examples

collapse all

Create a random sequence of binary values corresponding to a codeword containing 3000 bits. Perform PUSCH scrambling initialized with the specified physical layer cell identity number and RNTI.

cw = randi([0 1],3000,1);
ncellid = 42;
rnti = 101;
scrambled = nrPUSCHScramble(cw,ncellid,rnti);

Modulate the scrambled data using 16-QAM modulation. Demodulate the result.

modulation = '16QAM';
sym = nrSymbolModulate(scrambled,modulation);
demod = nrSymbolDemodulate(sym,modulation);

Perform PUSCH descrambling of the demodulated symbols.

descrambled = nrPUSCHDescramble(demod,ncellid,rnti)
descrambled = 3000×1
1010 ×

   -1.6000
   -1.6000
    0.4000
   -0.4000
   -1.6000
    0.4000
    0.4000
   -0.4000
   -0.4000
   -0.4000
      ⋮

Perform hard decision on the soft metric.

rxcw = double(descrambled<0)
rxcw = 3000×1

     1
     1
     0
     1
     1
     0
     0
     1
     1
     1
      ⋮

Compare the result with the original codeword.

isequal(cw,rxcw)
ans = logical
   1

Create a codeword for 1 bit.

cw = [1 -2 -1 -1]';

Specify the scrambling identity as 100 and radio network temporary identifier as 65,350.

nid = 100;
rnti = 65350;

Perform PUSCH scrambling that is initialized with the UCI placeholder X and Y bit locations.

xind = find(cw == -1);
yind = find(cw == -2);
scrambled = nrPUSCHScramble(cw,nid,rnti);

Modulate the scrambled data using 16-QAM scheme. Demodulate the result.

modulation = '16QAM';
sym = nrSymbolModulate(scrambled,modulation);
demod = nrSymbolDemodulate(sym,modulation);

Perform PUSCH descrambling of the demodulated symbols.

descrambled = nrPUSCHDescramble(demod,nid,rnti,xind,yind)
descrambled = 4×1
1010 ×

   -1.6000
   -1.6000
   -0.4000
   -0.4000

Compare the result with the original codeword.

isequal(descrambled(1)<0,cw(1))
ans = logical
   1

Input Arguments

collapse all

Approximate log-likelihood ratio (LLR) soft bits, specified as a real column vector. Sign represents scrambled hard bit.

Data Types: double | single

Scrambling identity, specified as an integer from 0 to 1023. nid is higher layer parameter dataScramblingIdentityPUSCH, ranging from 0 to 1023, if the higher layer parameter is configured. Otherwise, nid is physical layer cell identity number NCellID, ranging from 0 to 1007. For more information, see TS 38.211 Section 6.3.1.1.

Data Types: double

RNTI of the UE, specified as an integer from 0 to 65,535.

Data Types: double

X placeholder indices of the UCI, specified as a column vector of positive values. When you specify this input, the function descrambles the input codeword, in, at all locations except the X placeholder locations. A value of [] indicates no X placeholder indices.

Data Types: double

Y placeholder indices of the UCI, specified as a column vector of positive values. The input codeword, in, at the placeholder locations, yInd, is descrambled with the previous values of the scrambling sequence. A value of [] indicates no Y placeholder indices.

Data Types: double

Output Arguments

collapse all

Descrambled approximate LLR soft bits, returned as a numeric column vector. Sign represents descrambled hard bit.

Data Types: double | single

References

[1] 3GPP TS 38.211. “NR; Physical channels and modulation.” 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

Introduced in R2019a