komm.PAModulation
Pulse-amplitude modulation (PAM). It is a real modulation scheme in which the constellation symbols are uniformly arranged in the real line and have zero mean. More precisely, the the $i$-th constellation symbol is given by $$ x_i = A \left( 2i - M + 1 \right), \quad i \in [0 : M), $$ where $M$ is the order (a power of $2$), and $A$ is the base amplitude of the modulation. The PAM constellation is depicted below for $M = 8$.
Parameters:
-
order
(int
) –The order $M$ of the modulation. It must be a power of $2$.
-
base_amplitude
(float
) –The base amplitude $A$ of the constellation. The default value is
1.0
. -
labeling
(Literal['natural', 'reflected'] | ArrayLike
) –The binary labeling of the modulation. Can be specified either as a 2D-array of integers (see base class for details), or as a string. In the latter case, the string must be either
'natural'
or'reflected'
. The default value is'reflected'
, corresponding to the Gray labeling.
Examples:
The PAM modulation with order $M = 4$, base amplitude $A = 1$, and Gray labeling is depicted below.
>>> pam = komm.PAModulation(4)
>>> pam.constellation
array([-3., -1., 1., 3.])
>>> pam.labeling
array([[0, 0],
[1, 0],
[1, 1],
[0, 1]])
>>> pam.modulate([0, 0, 1, 1, 0, 0, 1, 0, 1, 0])
array([-3., 1., -3., -1., -1.])
energy_per_symbol: float
property
The average symbol energy $E_\mathrm{s}$ of the constellation. It assumes equiprobable symbols. It is given by $$ E_\mathrm{s} = \frac{1}{M} \sum_{i \in [0:M)} |x_i|^2, $$ where $|x_i|^2$ is the energy of constellation symbol $x_i$, and $M$ is the order of the modulation.
Examples:
>>> mod = komm.Modulation(constellation=[-0.5, 0.0, 0.5, 2.0], labeling=[[1, 0], [1, 1], [0, 1], [0, 0]])
>>> mod.energy_per_symbol
np.float64(1.125)
>>> mod = komm.Modulation(constellation=[0, -1, 1, 1j], labeling=[[0, 0], [0, 1], [1, 0], [1, 1]])
>>> mod.energy_per_symbol
np.float64(0.75)
symbol_mean: float
property
The mean $\mu_\mathrm{s}$ of the constellation. It assumes equiprobable symbols. It is given by $$ \mu_\mathrm{s} = \frac{1}{M} \sum_{i \in [0:M)} x_i. $$
Examples:
>>> mod = komm.Modulation(constellation=[-0.5, 0.0, 0.5, 2.0], labeling=[[1, 0], [1, 1], [0, 1], [0, 0]])
>>> mod.symbol_mean
np.float64(0.5)
>>> mod = komm.Modulation(constellation=[0, -1, 1, 1j], labeling=[[0, 0], [0, 1], [1, 0], [1, 1]])
>>> mod.symbol_mean
np.complex128(0.25j)
minimum_distance: float
property
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} |x_i - x_j|. $$
Examples:
>>> mod = komm.Modulation(constellation=[-0.5, 0.0, 0.5, 2.0], labeling=[[1, 0], [1, 1], [0, 1], [0, 0]])
>>> mod.minimum_distance
np.float64(0.5)
>>> mod = komm.Modulation(constellation=[0, -1, 1, 1j], labeling=[[0, 0], [0, 1], [1, 0], [1, 1]])
>>> mod.minimum_distance
np.float64(1.0)