kaira.channels.LaplacianChannel

Inheritance diagram of LaplacianChannel

Inheritance diagram for LaplacianChannel

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

Bases: BaseChannel

Channel with additive Laplacian (double-exponential) noise.

Models a channel with noise following the Laplacian distribution, which has heavier tails than Gaussian noise. This channel supports both real and complex-valued inputs. Laplacian noise is often used to model impulsive noise environments [Middleton, 1977].

Mathematical Model:

y = x + n where n follows a Laplacian distribution

Parameters:
  • scale (float, optional) – Scale parameter of the Laplacian distribution.

  • avg_noise_power (float, optional) – The average noise power.

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

Example

>>> # Create a Laplacian channel with scale=0.5
>>> channel = LaplacianChannel(scale=0.5)
>>> x = torch.ones(10, 1)
>>> y = channel(x)  # Output with Laplacian noise

Methods

__init__

Initialize the Laplacian channel.

forward

Apply Laplacian noise to the input signal.

get_config

Get a dictionary of the channel's configuration.

Attributes

scale

avg_noise_power

snr_db

__init__(scale: float | None = None, avg_noise_power: float | None = None, snr_db: float | None = None, *args: Any, **kwargs: Any)[source]

Initialize the Laplacian channel.

Parameters:
  • scale (float, optional) – Scale parameter of the Laplacian distribution.

  • avg_noise_power (float, optional) – The average noise power.

  • snr_db (float, optional) – SNR in dB (alternative to scale or 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
scale: float | None
snr_db: float | None
forward(x: Tensor, *args: Any, **kwargs: Any) Tensor[source]

Apply Laplacian noise to the input signal.

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

  • *args – Additional positional arguments (unused).

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

Returns:

The output tensor with Laplacian noise 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]