qam#
- sionna.phy.mapping.qam(num_bits_per_symbol: int, normalize: bool = True, precision: Literal['single', 'double'] | None = None) numpy.ndarray[source]#
Generates a QAM constellation.
This function generates a complex-valued vector, where each element is a constellation point of an M-ary QAM constellation. The bit label of the
nth point is given by the length-num_bits_per_symbolbinary representation ofn.- Parameters:
num_bits_per_symbol (int) – Number of bits per constellation point. Must be a multiple of two, e.g., 2, 4, 6, 8, etc.
normalize (bool) – If True, the constellation is normalized to have unit power. Defaults to True.
precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.
- Outputs:
c – np.ndarray, shape [2**num_bits_per_symbol]. QAM constellation points.
Notes
The bit label of the nth constellation point is given by the binary representation of its position within the array and can be obtained through
np.binary_repr(n, num_bits_per_symbol).The normalization factor of a QAM constellation is given in closed-form as:
\[\sqrt{\frac{1}{2^{n-2}}\sum_{i=1}^{2^{n-1}}(2i-1)^2}\]where \(n= \text{num\_bits\_per\_symbol}/2\) is the number of bits per dimension.
This algorithm is a recursive implementation of the expressions found in Section 5.1 of [3GPPTS38211]. It is used in the 5G standard.
Examples
from sionna.phy.mapping import qam # Generate 16-QAM constellation constellation = qam(4) print(constellation.shape) # (16,)