kaira.modulations.QAMDemodulator

Inheritance diagram of QAMDemodulator

Inheritance diagram for QAMDemodulator

class kaira.modulations.QAMDemodulator(order: Literal[4, 16, 64, 256], gray_coding: bool = True, normalize: bool = True, *args, **kwargs)[source]

Bases: BaseDemodulator

Quadrature Amplitude Modulation (QAM) demodulator.

Methods

__init__

Initialize the QAM demodulator.

forward

Demodulate QAM symbols.

reset_state

Reset any stateful components.

Attributes

bits_per_symbol

Number of bits per symbol.

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

Initialize the QAM demodulator.

Parameters:
  • order – Modulation order (must be a perfect square and power of 4)

  • gray_coding – Whether Gray coding was used for mapping

  • normalize – If True, assumes normalized constellation

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

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

Demodulate QAM symbols.

Parameters:
  • y – Received tensor of QAM 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

property bits_per_symbol: int

Number of bits per symbol.

reset_state() None

Reset any stateful components.

For demodulators with memory.