Main Content


Layer mapping of modulated and scrambled codewords



out = nrLayerMap(in,nLayers) performs layer mapping of one or two codewords, specified by in, based on the number of transmission layers nLayers. The transmission layers in the output are formed by multiplexing the modulation symbols from either one or two codewords. The function implements the transpose of the overall layer mapping specified in TS 38.211 Section and Section [1]. In other words, the symbols in a layer lie in columns rather than rows.


collapse all

Perform layer mapping of one codeword of length 40, using 4 transmission layers.

out = nrLayerMap(ones(40,1),4);
sizeOut = size(out)
sizeOut = 1×2

    10     4

Perform layer mapping of two codewords of length 20 and 30 respectively, using 5 transmission layers.

out = nrLayerMap({ones(20,1),ones(30,1)},5);
sizeOut = size(out)
sizeOut = 1×2

    10     5

Input Arguments

collapse all

Modulation symbols in codewords, specified as one of these values:

  • Complex column vector — Use this value to specify one codeword.

  • Cell array of one or two complex column vectors — Use this value to specify one or two codewords.

Data Types: double
Complex Number Support: Yes

Number of transmission layers, specified as an integer from 1 to 8.

Data Types: double

Output Arguments

collapse all

Layered modulation symbols, returned as a complex matrix of size M-by-nLayers. M is the number of modulation symbols (rows) in a transmission layer (column). The output out inherits the data type of the input in.


[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™.

Version History

Introduced in R2018b