PAM2QAM#
- class sionna.phy.mapping.PAM2QAM(num_bits_per_symbol: int, hard_in_out: bool = True, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs: Any)[source]#
Bases:
sionna.phy.object.ObjectTransforms PAM symbol indices/logits to QAM symbol indices/logits.
For two PAM constellation symbol indices or logits, corresponding to the real and imaginary components of a QAM constellation, compute the QAM symbol index or logits.
- Parameters:
num_bits_per_symbol (int) – Number of bits per QAM constellation symbol, e.g., 4 for QAM16.
hard_in_out (bool) – Determines if inputs and outputs are indices or logits over constellation symbols. Defaults to True.
precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.device (str | None) – Device for tensor operations. If None,
deviceis used.kwargs (Any)
- Inputs:
pam1 – torch.Tensor, torch.int32, or […, 2**(num_bits_per_symbol/2)], torch.float. Indices or logits for the first PAM constellation.
pam2 – torch.Tensor, torch.int32, or […, 2**(num_bits_per_symbol/2)], torch.float. Indices or logits for the second PAM constellation.
- Outputs:
qam – torch.Tensor, torch.int32, or […, 2**num_bits_per_symbol], torch.float. Indices or logits for the corresponding QAM constellation.
Examples
import torch from sionna.phy.mapping import PAM2QAM converter = PAM2QAM(4) # 16-QAM ind_pam1 = torch.tensor([0, 1, 2, 3]) ind_pam2 = torch.tensor([0, 1, 2, 3]) ind_qam = converter(ind_pam1, ind_pam2) print(ind_qam)