kaira.modulations.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:
BaseDemodulatorPulse 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
Initialize the PAM demodulator.
Demodulate PAM symbols.
Reset any stateful components.
Attributes
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