MCSDecoderNR#

class sionna.phy.nr.utils.MCSDecoderNR(*args: Any, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs: Any)[source]#

Bases: sionna.phy.utils.misc.MCSDecoder

Maps a Modulation and Coding Scheme (MCS) index to the corresponding modulation order, i.e., number of bits per symbol, and coderate for 5G-NR networks. Wraps decode_mcs_index() and inherits from MCSDecoder.

Inputs:
  • mcs_index – […], torch.int32. MCS index.

  • mcs_table_index – […], torch.int32. MCS table index. Different tables contain different mappings.

  • mcs_category – […], torch.int32. 0 for PUSCH, 1 for PDSCH channel.

  • check_index_validitybool. If True, a ValueError is raised if the input MCS indices are not valid for the given configuration. Defaults to True.

  • transform_precoding – […], torch.bool | bool. Specifies whether the MCS tables described in Sec. 6.1.4.1 of [3GPPTS38214] are applied. Only relevant for “PUSCH”. Defaults to False.

  • pi2bpsk – […], torch.bool | bool. Specifies whether the higher-layer parameter tp-pi2BPSK described in Sec. 6.1.4.1 of [3GPPTS38214] is applied. Only relevant for “PUSCH”. Defaults to False.

  • verbosebool. If True, additional information is printed. Defaults to False.

Outputs:
  • modulation_order – […], torch.int32. Modulation order corresponding to the input MCS index.

  • target_coderate – […], torch.float32. Target coderate corresponding to the input MCS index.

Parameters:
  • args (Any)

  • precision (Literal['single', 'double'] | None)

  • device (str | None)

  • kwargs (Any)

Examples

from sionna.phy.nr.utils import MCSDecoderNR
import torch

decoder = MCSDecoderNR()
# Scalar input
mod_order, rate = decoder(mcs_index=14, mcs_table_index=1, mcs_category=0)
print(f"Modulation order: {mod_order.item()}, Target rate: {rate.item():.3f}")

# Tensor input
mcs_indices = torch.tensor([10, 14, 20])
mod_orders, rates = decoder(mcs_index=mcs_indices,
                            mcs_table_index=1, mcs_category=0)