decode_mcs_index#
- sionna.phy.nr.utils.decode_mcs_index(mcs_index: int | torch.Tensor, table_index: int | torch.Tensor = 1, is_pusch: bool | torch.Tensor = True, transform_precoding: bool | torch.Tensor = False, pi2bpsk: bool | torch.Tensor = False, check_index_validity: bool = True, verbose: bool = False, device: str | None = None) Tuple[torch.Tensor, torch.Tensor][source]#
Returns the modulation order and target coderate for a given MCS index.
Implements MCS tables as defined in [3GPPTS38214] for PUSCH and PDSCH.
- Parameters:
mcs_index (int | torch.Tensor) – MCS index (denoted as \(I_{MCS}\) in [3GPPTS38214]). Accepted values are
{0,1,...28}.table_index (int | torch.Tensor) – MCS table index from [3GPPTS38214]. Accepted values are
{1,2,3,4}.is_pusch (bool | torch.Tensor) – Specifies whether the 5G NR physical channel is of “PUSCH” type. If False, then the “PDSCH” channel is considered.
transform_precoding (bool | torch.Tensor) – Specifies whether the MCS tables described in Sec. 6.1.4.1 of [3GPPTS38214] are applied. Only relevant for “PUSCH”.
pi2bpsk (bool | torch.Tensor) – Specifies whether the higher-layer parameter tp-pi2BPSK described in Sec. 6.1.4.1 of [3GPPTS38214] is applied. Only relevant for “PUSCH”.
check_index_validity (bool) – If True, a ValueError is raised if the input MCS indices are not valid for the given configuration.
verbose (bool) – If True, additional information is printed.
device (str | None) – Device for computation. If None,
deviceis used.
- Outputs:
modulation_order – […], torch.int32. Modulation order, i.e., number of bits per symbol, associated with the input MCS index.
target_rate – […], torch.float32. Target coderate associated with the input MCS index.
Examples
from sionna.phy.nr.utils import decode_mcs_index import torch # Scalar input mod_order, rate = decode_mcs_index(14, table_index=1) print(f"Modulation order: {mod_order.item()}, Target rate: {rate.item():.3f}") # Tensor input mcs_indices = torch.tensor([10, 14, 20]) mod_orders, rates = decode_mcs_index(mcs_indices, table_index=1)