kaira.modulations.QPSKModulator

Inheritance diagram of QPSKModulator

Inheritance diagram for QPSKModulator

class kaira.modulations.QPSKModulator(normalize: bool = True, *args, **kwargs)[source]

Bases: BaseModulator

Quadrature Phase-Shift Keying (QPSK) modulator.

Maps pairs of bits to complex constellation points in QPSK modulation. Following standard Gray-coded QPSK convention where: - 00 maps to (1+j)/√2 (first quadrant) - 01 maps to (1-j)/√2 (fourth quadrant) - 10 maps to (-1+j)/√2 (second quadrant) - 11 maps to (-1-j)/√2 (third quadrant)

Methods

__init__

Initialize the QPSK modulator.

forward

Modulate bit pairs to QPSK symbols.

plot_constellation

Plot the QPSK constellation diagram.

reset_state

Reset any stateful components.

Attributes

bits_per_symbol

Number of bits per symbol.

constellation

bit_patterns

constellation: Tensor
bit_patterns: Tensor
__init__(normalize: bool = True, *args, **kwargs) None[source]

Initialize the QPSK modulator.

Parameters:
  • 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 pairs to QPSK symbols.

Parameters:
  • x – Input tensor of bits with shape (…, 2*N)

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

Returns:

Complex tensor of QPSK symbols with shape (…, N)

plot_constellation(**kwargs) Tuple[Figure, Axes][source]

Plot the QPSK constellation diagram.

Parameters:

**kwargs – Additional arguments passed to plot_constellation

Returns:

Matplotlib figure object

property bits_per_symbol: int

Number of bits per symbol.

reset_state() None

Reset any stateful components.

For modulators with memory (like differential schemes).