kaira.channels.AWGNChannel

Inheritance diagram of AWGNChannel

Inheritance diagram for AWGNChannel

class kaira.channels.AWGNChannel(avg_noise_power: float | None = None, snr_db: float | None = None, *args: Any, **kwargs: Any)[source]

Bases: BaseChannel

Additive white Gaussian noise (AWGN) channel for signal transmission.

This channel adds Gaussian noise to the input signal, supporting both real and complex-valued inputs automatically. For complex inputs, noise is added to both real and imaginary components. AWGN channels are fundamental in communication theory and commonly used as a baseline model [Proakis and Salehi, 2007].

Mathematical Model:

y = x + n where n ~ N(0, σ²) for real inputs or n ~ CN(0, σ²) for complex inputs

Parameters:
  • avg_noise_power (float, optional) – The average noise power σ².

  • snr_db (float, optional) – SNR in dB (alternative to avg_noise_power).

Example

>>> # For real-valued signals
>>> channel = AWGNChannel(avg_noise_power=0.1)
>>> x_real = torch.ones(10, 1)
>>> y_real = channel(x_real)  # Real noisy output
>>> # For complex-valued signals (same channel works)
>>> x_complex = torch.complex(torch.ones(10, 1), torch.zeros(10, 1))
>>> y_complex = channel(x_complex)  # Complex noisy output

Methods

__init__

Initialize the AWGN channel.

forward

Apply AWGN to the input signal.

get_config

Get a dictionary of the channel's configuration.

Attributes

avg_noise_power

snr_db

Examples using kaira.channels.AWGNChannel

Simulating AWGN Channels with Kaira

Simulating AWGN Channels with Kaira

Channel Comparison

Channel Comparison

Composing Multiple Channel Effects

Composing Multiple Channel Effects

Fading Channels in Wireless Communications

Fading Channels in Wireless Communications

Impulsive Noise with Laplacian Channel

Impulsive Noise with Laplacian Channel

Nonlinear Channel Distortion Effects

Nonlinear Channel Distortion Effects

Phase Noise Effects on Signal Constellations

Phase Noise Effects on Signal Constellations

Poisson Channel for Signal-Dependent Noise

Poisson Channel for Signal-Dependent Noise

Modulation Schemes Comparison

Modulation Schemes Comparison

Differential Phase-Shift Keying (DPSK)

Differential Phase-Shift Keying (DPSK)

Higher-Order PSK Modulation

Higher-Order PSK Modulation

Higher-Order QAM Modulation

Higher-Order QAM Modulation

Modulation Schemes for Digital Communication Systems

Modulation Schemes for Digital Communication Systems

Offset QPSK Modulation

Offset QPSK Modulation

Pulse Amplitude Modulation (PAM)

Pulse Amplitude Modulation (PAM)

π/4-QPSK Modulation

π/4-QPSK Modulation

Phase-Shift Keying (PSK) Modulation

Phase-Shift Keying (PSK) Modulation

Quadrature Amplitude Modulation (QAM)

Quadrature Amplitude Modulation (QAM)

Performance Metrics Visualization

Performance Metrics Visualization

Signal and Error Rate Metrics

Signal and Error Rate Metrics

Attention-Feature Module (AFModule)

Attention-Feature Module (AFModule)

Original DeepJSCC Model (Bourtsoulatze 2019)

Original DeepJSCC Model (Bourtsoulatze 2019)

Deep Joint Source-Channel Coding (DeepJSCC) Model

Deep Joint Source-Channel Coding (DeepJSCC) Model

Multiple Access Channel Model for Joint Encoding

Multiple Access Channel Model for Joint Encoding

Sequential Model for Modular Neural Network Design

Sequential Model for Modular Neural Network Design

Discrete Task-Oriented Deep JSCC Model (Xie 2023)

Discrete Task-Oriented Deep JSCC Model (Xie 2023)

FEC Decoders Tutorial

FEC Decoders Tutorial

LDPC Coding and Belief Propagation Decoding

LDPC Coding and Belief Propagation Decoding

Channel Capacity Analysis with Kaira

Channel Capacity Analysis with Kaira
__init__(avg_noise_power: float | None = None, snr_db: float | None = None, *args: Any, **kwargs: Any)[source]

Initialize the AWGN channel.

Parameters:
  • avg_noise_power (float, optional) – The average noise power σ².

  • snr_db (float, optional) – SNR in dB (alternative to avg_noise_power).

  • *args – Variable length argument list passed to the base class.

  • **kwargs – Arbitrary keyword arguments passed to the base class.

avg_noise_power: float | None
snr_db: float | None
forward(x: Tensor, *args: Any, csi=None, noise=None, **kwargs: Any) Tensor[source]

Apply AWGN to the input signal.

Parameters:
  • x (torch.Tensor) – The input tensor.

  • *args – Additional positional arguments (unused).

  • csi (Optional[torch.Tensor]) – Channel state information (unused in AWGN).

  • noise (Optional[torch.Tensor]) – Pre-generated noise tensor. If provided, this noise will be added instead of generating new noise.

  • **kwargs – Additional keyword arguments (unused).

Returns:

The output tensor with AWGN added.

Return type:

torch.Tensor

get_config() Dict[str, Any]

Get a dictionary of the channel’s configuration.

This method returns a dictionary containing the channel’s parameters, which can be used to recreate the channel instance.

Returns:

Dictionary of parameter names and values

Return type:

Dict[str, Any]