komm.PSKModulation
Phase-shift keying (PSK) modulation. It is a complex modulation scheme in which the constellation symbols are uniformly arranged in a circle. More precisely, the the $i$-th constellation symbol is given by $$ x_i = A \exp \left( \mathrm{j} \frac{2 \pi i}{M} \right) \exp(\mathrm{j} \phi), \quad i \in [0 : M), $$ where $M$ is the order (a power of $2$), $A$ is the amplitude, and $\phi$ is the phase offset of the modulation. The PSK constellation is depicted below for $M = 8$.
__init__
Constructor for the class.
Parameters:
-
order
(int
) –The order $M$ of the modulation. It must be a power of $2$.
-
amplitude
(Optional[float]
) –The amplitude $A$ of the constellation. The default value is
1.0
. -
phase_offset
(Optional[float]
) –The phase offset $\phi$ of the constellation. The default value is
0.0
. -
labeling
(Optional[Array1D[int] | str]
) –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.
The PSK modulation with order $M = 4$, base amplitude $A = 1$, phase offset $\phi = \pi/4$, and Gray labeling is depicted below.
Examples:
>>> psk = komm.PSKModulation(4, phase_offset=np.pi/4.0)
>>> psk.constellation
array([ 0.70710678+0.70710678j, -0.70710678+0.70710678j, -0.70710678-0.70710678j, 0.70710678-0.70710678j])
>>> psk.labeling
array([[0, 0],
[1, 0],
[1, 1],
[0, 1]])
>>> psk.modulate([0, 0, 1, 1, 0, 0, 1, 0, 1, 0])
array([ 0.70710678+0.70710678j, -0.70710678-0.70710678j, 0.70710678+0.70710678j, -0.70710678+0.70710678j, -0.70710678+0.70710678j])