kaira.modulations.BaseDemodulator

Inheritance diagram for BaseDemodulator
- class kaira.modulations.BaseDemodulator(bits_per_symbol: int | None = None, *args, **kwargs)[source]
-
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
Initialize the demodulator.
Demodulate symbols to bits or LLRs.
Reset any stateful components.
Attributes
Number of bits per symbol.
Examples using
kaira.modulations.BaseDemodulator
Advanced LDPC Code Visualization with Belief Propagation Animation
Advanced LDPC Code Visualization with Belief Propagation Animation- __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.
- 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)