# nrPUSCHCodebook

Generate PUSCH precoding matrix

Since R2019a

## Description

example

w = nrPUSCHCodebook(nLayers,nPorts,tpmi) returns the physical uplink shared channel (PUSCH) precoding matrix for codebook-based transmission. nLayers is the number of layers, nPorts is the number of antenna ports, and tpmi is the transmitted precoding matrix indicator (TPMI). By default, this function disables transform precoding. The returned matrix, w, is the transpose of the precoding matrix defined in TS 38.211 Section 6.3.1.5 [1]. The matrix orientation of w allows the precoding operation to be performed by matrix multiplication on the output of the nrLayerMap function and w.

w = nrPUSCHCodebook(___,transformPrecode) specifies transform precoding as a logical value in addition to the input arguments in the previous syntax. When transformPrecode is set to true, the function applies the transform precoding defined in TS 38.211 Section 6.3.1.4 [1].

## Examples

collapse all

Modulate a random sequence of binary values of length 600 by using 64-QAM modulation. Split the modulated symbols into two layers.

modulation = '64QAM';
nlayers = 2;
in = randi([0 1],600,1);
data = nrSymbolModulate(in,modulation);
y = nrLayerMap(data,nlayers);

Generate the PUSCH precoding matrix for four antennas, two layers, and the specified TPMI.

nports = 4;
tpmi = 7;
w = nrPUSCHCodebook(nlayers,nports,tpmi)
w = 2×4 complex

0.5000 + 0.0000i   0.0000 + 0.0000i   0.5000 + 0.0000i   0.0000 + 0.0000i
0.0000 + 0.0000i   0.5000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.5000i

Precode the layered modulation symbols by using the codebook matrix.

z = y * w
z = 50×4 complex

-0.0772 - 0.3858i   0.3858 - 0.5401i  -0.0772 - 0.3858i   0.5401 + 0.3858i
-0.3858 + 0.0772i  -0.5401 - 0.0772i  -0.3858 + 0.0772i   0.0772 - 0.5401i
-0.5401 - 0.2315i  -0.2315 + 0.0772i  -0.5401 - 0.2315i  -0.0772 - 0.2315i
-0.3858 + 0.2315i  -0.2315 - 0.0772i  -0.3858 + 0.2315i   0.0772 - 0.2315i
-0.0772 - 0.3858i   0.5401 + 0.2315i  -0.0772 - 0.3858i  -0.2315 + 0.5401i
-0.5401 + 0.5401i  -0.0772 + 0.2315i  -0.5401 + 0.5401i  -0.2315 - 0.0772i
-0.3858 + 0.2315i  -0.0772 + 0.5401i  -0.3858 + 0.2315i  -0.5401 - 0.0772i
-0.3858 + 0.5401i   0.5401 + 0.3858i  -0.3858 + 0.5401i  -0.3858 + 0.5401i
-0.2315 + 0.0772i   0.2315 - 0.5401i  -0.2315 + 0.0772i   0.5401 + 0.2315i
-0.2315 - 0.0772i   0.3858 - 0.3858i  -0.2315 - 0.0772i   0.3858 + 0.3858i
⋮

## Input Arguments

collapse all

Number of transmission layers, specified as an integer from 1 to 4. For more information, see TS 38.211 Section 6.3.1.3.

Data Types: double

Number of antenna ports, specified as 1 , 2, or 4. For more information, see TS 38.211 Section 6.3.1.5.

Data Types: double

Transmitted precoding matrix indicator, specified as an integer from 0 to 27. The valid range of tpmi depends on the specified number of transmission layers, nLayers, and number of antenna ports, nPorts. For more information, see TS 38.211 Tables 6.3.1.5-1 to 6.3.1.5-7.

Data Types: double

Transform precoding, specified as false or true. For more information, see TS 38.211 Section 6.3.1.4.

Data Types: double | logical

## Output Arguments

collapse all

PUSCH precoding codebook, returned as a complex matrix of size nLayers-by-nPorts. If nLayers and nPorts are both 1, then w is 1. Otherwise, the function returns the transpose of the matrix selected from Tables 6.3.1.5-1 to 6.3.1.5-7 in TS 38.211 [1].

Data Types: double
Complex Number Support: Yes

## References

[1] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

## Version History

Introduced in R2019a