kaira.modulations.PAMModulator

Inheritance diagram for PAMModulator
- class kaira.modulations.PAMModulator(order: Literal[2, 4, 8, 16, 32, 64], gray_coding: bool = True, normalize: bool = True, *args, **kwargs)[source]
Bases:
BaseModulatorPulse Amplitude Modulation (PAM) modulator.
Maps groups of bits to amplitude levels for transmission.
Standard PAM modulation with uniform amplitude levels. Can use Gray coding for bit-to-symbol mapping, and supports normalization to unit average energy.
Methods
Initialize the PAM modulator.
Modulate bit groups to PAM symbols.
Plot the PAM constellation diagram.
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 modulator.
- Parameters:
order – Modulation order (must be a power of 2)
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 PAM 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 PAM symbols with shape (…, N)