Main Content


Layer demapping onto scrambled and modulated codewords



out = nrLayerDemap(in) returns one or two codewords obtained from layer demapping the received layered symbols specified by in. The function determines the number of codewords based on the number of layers, as specified in TS 38.211 Table [1].


collapse all

Map a single codeword of length 20 to four transmission layers.

codeword = ones(20,1); 
nLayers = 4; 
layeredOut = nrLayerMap(codeword,nLayers);

Recover the original codeword using layer demapping.

out = nrLayerDemap(layeredOut);

Check for errors.

ans = logical

Input Arguments

collapse all

Layered modulation symbols, specified as a complex matrix of size M-by-nLayers. M is the number of modulation symbols in a transmission layer. nLayers is the number of transmission layers in the range 1 to 8.

Data Types: double
Complex Number Support: Yes

Output Arguments

collapse all

Modulation symbols in codewords, returned as a cell array of one or two complex column vectors. This output inherits the data type of the input in. One vector corresponds to one codeword. The number of codewords is based on the number of layers. The function determines the number of codewords using TS 38.211 Table

Data Types: cell


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

Introduced in R2018b