kaira.modulations.DPSKModulator

Inheritance diagram of 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: BaseModulator

Differential 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

__init__

Initialize the DPSK modulator.

forward

Modulate bit groups to DPSK symbols.

plot_constellation

Plot the DPSK constellation diagram.

reset_state

Reset the internal phase memory to the default state.

Attributes

bits_per_symbol

Number of bits per symbol.

constellation

bit_patterns

constellation: Tensor
bit_patterns: Tensor
__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)

reset_state() None[source]

Reset the internal phase memory to the default state.

plot_constellation(**kwargs) Figure[source]

Plot the DPSK constellation diagram.

Parameters:

**kwargs – Additional arguments passed to plot_constellation

Returns:

Matplotlib figure object

property bits_per_symbol: int

Number of bits per symbol.