kaira.modulations.BPSKModulator

Inheritance diagram of BPSKModulator

Inheritance diagram for BPSKModulator

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

Bases: BaseModulator

Binary Phase-Shift Keying (BPSK) modulator.

Maps binary inputs (0, 1) to constellation points (1, -1). Following standard convention where: - Bit 0 maps to +1 - Bit 1 maps to -1

Methods

__init__

Initialize the BPSK modulator.

forward

Modulate binary inputs to BPSK symbols.

plot_constellation

Plot the BPSK constellation diagram.

reset_state

Reset any stateful components.

Attributes

bits_per_symbol

Number of bits per symbol.

constellation

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

Initialize the BPSK modulator.

Parameters:
  • complex_output – Whether to output complex values (default: True for consistency with other PSK modulators)

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

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

Modulate binary inputs to BPSK symbols.

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

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

Returns:

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

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

Plot the BPSK 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).