kaira.modulations.BaseDemodulator

Inheritance diagram of BaseDemodulator

Inheritance diagram for BaseDemodulator

class kaira.modulations.BaseDemodulator(bits_per_symbol: int | None = None, *args, **kwargs)[source]

Bases: Module, ABC

Abstract base class for all demodulators.

A demodulator maps received complex symbols back to bit sequences according to a specific demodulation scheme, which may include soft or hard decisions.

Methods

__init__

Initialize the demodulator.

forward

Demodulate symbols to bits or LLRs.

reset_state

Reset any stateful components.

Attributes

bits_per_symbol

Number of bits per symbol.

__init__(bits_per_symbol: int | None = None, *args, **kwargs) None[source]

Initialize the demodulator.

Parameters:
  • bits_per_symbol – Number of bits encoded in each symbol

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

property bits_per_symbol: int

Number of bits per symbol.

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

Demodulate symbols to bits or LLRs.

Parameters:
  • y – Received symbols with shape (…, N)

  • 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 with shape (…, N*bits_per_symbol)

reset_state() None[source]

Reset any stateful components.

For demodulators with memory.