kaira.modulations.QAMModulator

Inheritance diagram for QAMModulator
- class kaira.modulations.QAMModulator(order: Literal[4, 16, 64, 256], gray_coding: bool = True, normalize: bool = True, *args, **kwargs)[source]
Bases:
BaseModulatorQuadrature Amplitude Modulation (QAM) modulator.
Maps groups of bits to constellation points with different amplitudes and phases.
Methods
Initialize the QAM modulator.
Modulate bit groups to QAM symbols.
Plot the QAM constellation diagram.
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 modulator.
- Parameters:
order – Modulation order (must be a perfect square and power of 4)
gray_coding – Whether to use Gray coding for mapping
normalize – If True, normalize constellation to unit energy
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- forward(x: Tensor, *args, **kwargs) Tensor[source]
Modulate bit groups to QAM 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:
Complex tensor of QAM symbols with shape (…, N)