kaira.modulations.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:
BaseDemodulatorQuadrature Amplitude Modulation (QAM) demodulator.
Methods
Initialize the QAM demodulator.
Demodulate QAM symbols.
Reset any stateful components.
Attributes
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