flatten_precoding_mat#
- sionna.phy.mimo.flatten_precoding_mat(precoding_mat: torch.Tensor, by_column: bool = True) torch.Tensor[source]#
Flattens a […, num_ant_v, num_ant_h] precoding matrix associated with a rectangular array by producing a […, num_ant_v x num_ant_h] precoding vector.
- Parameters:
precoding_mat (torch.Tensor) – Precoding matrix with shape […, num_antennas_vertical, num_antennas_horizontal]. The element \((i,j)\) contains the precoding coefficient of the antenna element located at row \(i\) and column \(j\) of a rectangular antenna array.
by_column (bool) – If True, flattening occurs on a per-column basis, i.e., the first column is appended to the second, and so on. Else, flattening is performed on a per-row basis.
- Outputs:
precoding_vec – […, num_antennas_vertical x num_antennas_horizontal], torch.complex. Flattened precoding matrix.
Examples
mat = torch.randn(4, 8, dtype=torch.complex64) vec = flatten_precoding_mat(mat) # vec.shape = torch.Size([32])