kaira.modulations.Pi4QPSKModulator

Inheritance diagram of Pi4QPSKModulator

Inheritance diagram for Pi4QPSKModulator

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

Bases: BaseModulator

Π/4-QPSK (π/4 shifted QPSK) modulator.

A variant of QPSK where the constellation is rotated by π/4 radians on alternating symbols, providing improved envelope properties.

Methods

__init__

Initialize the π/4-QPSK modulator.

forward

Modulate bit pairs to π/4-QPSK symbols or symbols to π/4-QPSK signals.

plot_constellation

Plot the π/4-QPSK constellation diagram.

reset_state

Reset internal state (constellation alternation).

Attributes

bits_per_symbol

Number of bits per symbol.

qpsk

qpsk_rotated

constellation

bit_patterns

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

Initialize the π/4-QPSK modulator.

Parameters:
  • gray_coded – Whether to use Gray coding for mapping (default: True)

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

forward(x: Tensor, *args, **kwargs) Tensor[source]

Modulate bit pairs to π/4-QPSK symbols or symbols to π/4-QPSK signals.

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

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

Returns:

Complex tensor of π/4-QPSK symbols with shape (…, N)

reset_state() None[source]

Reset internal state (constellation alternation).

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

Plot the π/4-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.