kaira.modulations.PSKDemodulator

Inheritance diagram of PSKDemodulator

Inheritance diagram for PSKDemodulator

class kaira.modulations.PSKDemodulator(order: Literal[4, 8, 16, 32, 64] = 4, gray_coding: bool = True, *args, **kwargs)[source]

Bases: BaseDemodulator

General M-ary Phase-Shift Keying (PSK) demodulator.

Demodulates complex constellation points back to bits.

Methods

__init__

Initialize the PSK demodulator.

forward

Demodulate PSK symbols.

reset_state

Reset any stateful components.

Attributes

bits_per_symbol

Number of bits per symbol.

__init__(order: Literal[4, 8, 16, 32, 64] = 4, gray_coding: bool = True, *args, **kwargs) None[source]

Initialize the PSK demodulator.

Parameters:
  • order – Modulation order (must be a power of 2)

  • gray_coding – Whether Gray coding was used for constellation mapping

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

property bits_per_symbol: int

Number of bits per symbol.

reset_state() None

Reset any stateful components.

For demodulators with memory.

forward(y: Tensor, noise_var: float | Tensor | None = None, *args, **kwargs) Tensor[source]

Demodulate PSK symbols.

Parameters:
  • y – Received tensor of PSK symbols

  • noise_var – Noise variance for soft demodulation (optional)

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

Returns:

If noise_var is provided, returns LLRs; otherwise, returns hard bit decisions