kaira.modulations.BaseModulator

Inheritance diagram for BaseModulator
- class kaira.modulations.BaseModulator(bits_per_symbol: int | None = None, *args, **kwargs)[source]
-
Abstract base class for all modulators.
A modulator maps bit sequences to complex symbols according to a specific modulation scheme.
- constellation
Complex-valued tensor of constellation points
Methods
Initialize the modulator.
Modulate bits to symbols.
Plot the constellation diagram.
Reset any stateful components.
Attributes
Number of bits per symbol.
- __init__(bits_per_symbol: int | None = None, *args, **kwargs) None[source]
Initialize the modulator.
- Parameters:
bits_per_symbol – Number of bits to encode in each symbol
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- abstractmethod forward(x: Tensor, *args, **kwargs) Tensor[source]
Modulate bits to symbols.
- Parameters:
x – Input tensor of bits with shape (…, K*N), where K is bits_per_symbol
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- Returns:
Modulated symbols with shape (…, N)