komm.APSKConstellation
Amplitude- and phase-shift keying (APSK) constellation. It is a complex one-dimensional constellation obtained by the union of $K$ component PSK constellations, called rings.
Parameters:
-
orders
(tuple[int, ...]
) –A $K$-tuple with the orders $M_k$ of each ring, for $k \in [0 : K)$.
-
amplitudes
(tuple[float, ...]
) –A $K$-tuple with the amplitudes $A_k$ of each ring, for $k \in [0 : K)$.
-
phase_offsets
(float | tuple[float, ...]
) –A $K$-tuple with the phase offsets $\phi_k$ of each ring, for $k \in [0 : K)$. If specified as a single float $\phi$, then it is assumed that $\phi_k = \phi$ for all $k \in [0 : K)$. The default value is
0.0
.
Examples:
-
The $8$-APSK constellation with $(M_0, M_1) = (4, 4)$, $(A_0, A_1) = (1, 2)$, and $(\phi_0, \phi_1) = (0, 0)$ is depicted below.
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
-
The $16$-APSK constellation with $(M_0, M_1) = (8, 8)$, $(A_0, A_1) = (1, 2)$, and $(\phi_0, \phi_1) = (0, 1/16)$ is depicted below.
>>> const = komm.APSKConstellation( ... orders=(8, 8), ... amplitudes=(1.0, 2.0), ... phase_offsets=(0.0, 1 / 16) ... )
-
The $16$-APSK constellation with $(M_0, M_1) = (4, 12)$, $(A_0, A_1) = (\sqrt{2}, 3)$, and $(\phi_0, \phi_1) = (1/8, 0)$ is depicted below.
>>> const = komm.APSKConstellation( ... orders=(4, 12), ... amplitudes=(np.sqrt(2), 3.0), ... phase_offsets=(1 / 8, 0.0) ... )
matrix
Array2D[complexfloating]
cached
property
The constellation matrix $\mathbf{X}$.
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.matrix
array([[ 1.+0.j],
[ 0.+1.j],
[-1.+0.j],
[ 0.-1.j],
[ 2.+0.j],
[ 0.+2.j],
[-2.+0.j],
[ 0.-2.j]])
order
int
property
The order $M$ of the constellation.
For the APSK constellation, it is given by $$ M = \sum_{k \in [0:K)} M_k. $$
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.order
8
dimension
int
property
The dimension $N$ of the constellation.
For the APSK constellation, it is given by $N = 1$.
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.dimension
1
mean()
Computes the mean $\mathbf{m}$ of the constellation given prior probabilities $p_i$ of the constellation symbols. It is given by $$ \mathbf{m} = \sum_{i \in [0:M)} p_i \mathbf{x}_i. $$
Parameters:
-
priors
(ArrayLike | None
) –The prior probabilities of the constellation symbols. Must be a 1D-array whose size is equal to the order $M$ of the constellation. If not given, uniform priors are assumed.
Returns:
-
mean
(Array1D[complexfloating]
) –The mean $\mathbf{m}$ of the constellation.
For uniform priors, the mean of the APSK constellation is given by $$ \mathbf{m} = 0. $$
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.mean()
array([0.+0.j])
mean_energy()
Computes the mean energy $E$ of the constellation given prior probabilities $p_i$ of the constellation symbols. It is given by $$ E = \sum_{i \in [0:M)} p_i \lVert \mathbf{x}_i \rVert^2. $$
Parameters:
-
priors
(ArrayLike | None
) –The prior probabilities of the constellation symbols. Must be a 1D-array whose size is equal to the order $M$ of the constellation. If not given, uniform priors are assumed.
Returns:
-
mean_energy
(floating
) –The mean energy $E$ of the constellation.
For uniform priors, the mean energy of the APSK constellation is given by $$ E = \frac{1}{M} \sum_{k \in [0:K)} A^2 M_k. $$
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.mean_energy()
np.float64(2.5)
minimum_distance()
Computes the minimum Euclidean distance $d_\mathrm{min}$ of the constellation. It is given by $$ d_\mathrm{min} = \min_ { i, j \in [0:M), ~ i \neq j } \lVert \mathrm{x}_i - \mathrm{x}_j \rVert. $$
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.minimum_distance()
np.float64(1.0)
indices_to_symbols()
Returns the constellation symbols corresponding to the given indices.
Parameters:
-
indices
(ArrayLike
) –The indices to be converted to symbols. Must be an array of integers in $[0:M)$.
Returns:
-
symbols
(NDArray[complexfloating]
) –The symbols corresponding to the given indices. Has the same shape as
indices
, but with the last dimension expanded by a factor of $N$.
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.indices_to_symbols([3, 0])
array([0.-1.j, 1.+0.j])
closest_indices()
Returns the indices of the constellation symbols closest to the given received points.
Parameters:
-
received
(ArrayLike
) –The received points. Must be an array whose last dimension is a multiple of $N$.
Returns:
-
indices
(NDArray[integer]
) –The indices of the symbols closest to the received points. Has the same shape as
received
, but with the last dimension contracted by a factor of $N$.
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.closest_indices([0.1 - 1.1j, 1.2 + 0.1j])
array([3, 0])
closest_symbols()
Returns the constellation symbols closest to the given received points.
Parameters:
-
received
(ArrayLike
) –The received points. Must be an array whose last dimension is a multiple of $N$.
Returns:
-
symbols
(NDArray[complexfloating]
) –The symbols closest to the received points. Has the same shape as
received
.
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.closest_symbols([0.1 - 1.1j, 1.2 + 0.1j])
array([0.-1.j, 1.+0.j])
posteriors()
Returns the posterior probabilities of each constellation symbol given received points, the signal-to-noise ratio (SNR), and prior probabilities.
Parameters:
-
received
(ArrayLike
) –The received points. Must be an array whose last dimension is a multiple of $N$.
-
snr
(float
) –The signal-to-noise ratio (SNR) of the channel (linear, not decibel).
-
priors
(ArrayLike | None
) –The prior probabilities of the symbols. Must be a 1D-array whose size is equal to $M$. If not given, uniform priors are assumed.
Returns:
-
posteriors
(NDArray[floating]
) –The posterior probabilities of each symbol given the received points. Has the same shape as
received
, but with the last dimension changed by a factor of $M / N$.
Examples:
>>> const = komm.APSKConstellation(orders=(4, 4), amplitudes=(1.0, 2.0))
>>> const.posteriors([0.1 - 1.1j], snr=2.0).round(3)
array([0.104, 0.015, 0.076, 0.516, 0.011, 0. , 0.006, 0.272])