kaira.modulations.DPSKModulator

Inheritance diagram for DPSKModulator
- class kaira.modulations.DPSKModulator(order: Literal[2, 4, 8, 16] | None = None, gray_coding: bool = True, bits_per_symbol: int | None = None, gray_coded: bool | None = None, *args, **kwargs)[source]
Bases:
BaseModulatorDifferential Phase-Shift Keying (DPSK) modulator.
Encodes information in the phase differences between consecutive symbols rather than absolute phases, making it robust to phase ambiguities.
Methods
Initialize the DPSK modulator.
Modulate bit groups to DPSK symbols.
Plot the DPSK constellation diagram.
Reset the internal phase memory to the default state.
Attributes
Number of bits per symbol.
- __init__(order: Literal[2, 4, 8, 16] | None = None, gray_coding: bool = True, bits_per_symbol: int | None = None, gray_coded: bool | None = None, *args, **kwargs) None[source]
Initialize the DPSK modulator.
- Parameters:
order – Modulation order (must be a power of 2)
gray_coding – Whether to use Gray coding for phase mapping
bits_per_symbol – Alternative way to specify order (2^bits_per_symbol)
gray_coded – Alternative name for gray_coding
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- forward(x: Tensor, *args, **kwargs) Tensor[source]
Modulate bit groups to DPSK symbols.
- Parameters:
x – Input tensor of bits with shape (…, K*N), where K is bits_per_symbol, or direct symbol indices with shape (…, N) where each value is < order
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- Returns:
Complex tensor of DPSK symbols with shape (…, N)