SymbolInds2Bits#

class sionna.phy.mapping.SymbolInds2Bits(num_bits_per_symbol: int, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs: Any)[source]#

Bases: sionna.phy.block.Block

Transforms symbol indices to their binary representations.

Parameters:
  • num_bits_per_symbol (int) – Number of bits per constellation symbol.

  • precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None, precision is used.

  • device (str | None) – Device for tensor operations. If None, device is used.

  • kwargs (Any)

Inputs:

symbol_indtorch.Tensor, torch.int. Symbol indices.

Outputs:

bits – input.shape + [num_bits_per_symbol], torch.float. Binary representation of symbol indices.

Examples

import torch
from sionna.phy.mapping import SymbolInds2Bits

converter = SymbolInds2Bits(4)  # 16-QAM
indices = torch.tensor([0, 5, 10, 15])
bits = converter(indices)
print(bits.shape)
# torch.Size([4, 4])