Perform PUSCH descrambling
returns a column vector of soft bits resulting from the inverse operation of physical uplink
shared channel (PUSCH) scrambling from TS 38.211 Section 220.127.116.11 .
cw = nrPUSCHDescramble(
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). The function only performs data descrambling. Because uplink control
information (UCI) placeholder bit locations are unknown, the function cannot correctly
descramble UCIs if present in the input.
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.
ans = logical 1
in— Approximate LLR soft bits
Approximate log-likelihood ratio (LLR) soft bits, specified as a real column vector. Sign represents scrambled hard bit.
nid— Scrambling identity
Scrambling identity, specified as an integer from 0 to 1023.
higher layer parameter dataScramblingIdentityPUSCH, ranging from 0 to
1023, if the higher layer parameter is configured. Otherwise,
is physical layer cell identity number NCellID, ranging from 0 to
1007. For more information, see TS 38.211 Section 18.104.22.168.
rnti— RNTI of UE
RNTI of the UE, specified as an integer from 0 to 65,535.
cw— Descrambled approximate LLR soft bits
Descrambled approximate LLR soft bits, returned as a numeric column vector. Sign represents descrambled hard bit.
 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.