kaira.modulations.PSKModulator

Inheritance diagram for PSKModulator
- class kaira.modulations.PSKModulator(order: Literal[4, 8, 16, 32, 64] = 4, gray_coding: bool = True, constellation: Tensor | None = None, *args, **kwargs)[source]
Bases:
BaseModulatorGeneral M-ary Phase-Shift Keying (PSK) modulator.
Maps groups of bits to complex constellation points around the unit circle. Follows standard digital communications convention with Gray coding.
Methods
Initialize the PSK modulator.
Modulate bit groups to PSK symbols.
Plot the PSK constellation diagram.
Reset any stateful components.
Attributes
Number of bits per symbol.
- __init__(order: Literal[4, 8, 16, 32, 64] = 4, gray_coding: bool = True, constellation: Tensor | None = None, *args, **kwargs) None[source]
Initialize the PSK modulator.
- Parameters:
order – Modulation order (must be a power of 2)
gray_coding – Whether to use Gray coding for constellation mapping
constellation – Optional custom constellation points (overrides order)
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- forward(x: Tensor, *args, **kwargs) Tensor[source]
Modulate bit groups to PSK symbols.
- Parameters:
x – Input tensor of bits with shape (…, M) or direct indices into the constellation
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- Returns:
Complex tensor of PSK symbols with shape (…, N)