kaira.channels.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:
BaseChannelAdditive 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:
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
Initialize the AWGN channel.
Apply AWGN to the input signal.
Get a dictionary of the channel's configuration.
Attributes
- __init__(avg_noise_power: float | None = None, snr_db: float | None = None, *args: Any, **kwargs: Any)[source]
Initialize the AWGN channel.
- 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: