kaira.channels.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:
BaseChannelChannel 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:
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
Initialize the Laplacian channel.
Apply Laplacian noise to the input signal.
Get a dictionary of the channel's configuration.
Attributes
- __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.
- 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: