Perform PUSCH scrambling
returns a column vector resulting from physical uplink shared channel (PUSCH) scrambling, as
defined in TS 38.211 Section 18.104.22.168 .
scrambled = nrPUSCHScramble(
an uplink shared channel (UL-SCH) codeword, as described in TS 38.212 Section 6.2.7 .
the scrambling identity, and
rnti is the radio network temporary
identifier (RNTI) of the user equipment (UE).
Perform PUSCH Scrambling
Create a random sequence of binary values corresponding to a codeword containing 5000 bits.
cw = randi([0 1],5000,1)
cw = 5000×1 1 1 0 1 1 0 0 1 1 1 ⋮
Perform PUSCH scrambling initialized with the specified physical layer cell identity number and RNTI.
ncellid = 42; rnti = 101; scrambled = nrPUSCHScramble(cw,ncellid,rnti)
scrambled = 5000x1 logical array 0 1 1 1 1 0 1 0 0 1 ⋮
cw — UL-SCH codeword
column vector of integers from –2 to 1
UL-SCH codeword from TS 38.212 Section 6.2.7, specified as a column vector of integers from –2 to 1.
0 and 1 represent false and true bit values, respectively.
–1 and –2 represent x and y placeholders in the uplink control information (UCI), respectively. For more details, see TS 38.212 Sections 22.214.171.124 and 126.96.36.199.
nid — Scrambling identity
integer from 0 to 1023
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 188.8.131.52.
rnti — RNTI of UE
integer from 0 to 65,535
RNTI of the UE, specified as an integer from 0 to 65,535.
nrapid — Random access preamble index
 (default) | integer from 0 to 63
Random access preamble index, specified as one of these values.
— Use this value to indicate that the scrambling initialization does not consider msgA on PUSCH.
Integer from 0 to 63 — Use this value to initialize the scrambling sequence for msgA on PUSCH, as defined in Release 16 of TS 38.211 Section 184.108.40.206.
scrambled — Scrambled UL-SCH codeword
logical column vector
Scrambled UL-SCH codeword, returned as a logical column vector.
 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
 3GPP TS 38.212. “NR; Multiplexing and channel coding.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Introduced in R2019a