kaira.modulations.PAMDemodulator

Inheritance diagram of PAMDemodulator

Inheritance diagram for PAMDemodulator

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

Bases: BaseDemodulator

Pulse Amplitude Modulation (PAM) demodulator.

Demodulates PAM symbols using either: 1. Hard decisions - finding the closest constellation point 2. Soft decisions - computing log-likelihood ratios (LLRs)

Methods

__init__

Initialize the PAM demodulator.

forward

Demodulate PAM symbols.

reset_state

Reset any stateful components.

Attributes

bits_per_symbol

Number of bits per symbol.

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

Initialize the PAM demodulator.

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

  • 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 PAM symbols.

Parameters:
  • y – Received tensor of PAM symbols (complex, but only real part is used)

  • 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.