kaira.channels.LogNormalFadingChannel

Inheritance diagram of LogNormalFadingChannel

Inheritance diagram for LogNormalFadingChannel

class kaira.channels.LogNormalFadingChannel(shadow_sigma_db: float = 4.0, coherence_time=100, avg_noise_power: float | None = None, snr_db: float | None = None, *args: Any, **kwargs: Any)[source]

Bases: FlatFadingChannel

Log-normal fading channel with configurable shadowing standard deviation.

A specialized version of FlatFadingChannel that uses log-normal fading. Suitable for modeling large-scale shadowing effects in wireless channels where obstacles like buildings, terrain, and foliage cause signal power variations.

Mathematical Model:

y = h*x + n where h includes log-normal shadowing and n ~ CN(0,σ²)

The shadowing standard deviation (shadow_sigma_db) controls the variability of the fading. Higher values lead to more severe shadowing effects.

Parameters:
  • shadow_sigma_db (float) – Standard deviation in dB for log-normal shadowing

  • coherence_time (int) – Number of samples over which the fading coefficient remains constant

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

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

Example

>>> # Create a log-normal shadowing channel with 8 dB standard deviation
>>> channel = LogNormalFadingChannel(shadow_sigma_db=8.0, coherence_time=100, snr_db=15)
>>> x = torch.complex(torch.ones(1000), torch.zeros(1000))
>>> y = channel(x)  # Output with log-normal shadowing

Methods

__init__

Initialize the Log-Normal Fading channel.

forward

Apply flat fading and noise to the input signal.

get_config

Get a dictionary of the channel's configuration.

Attributes

k_factor

avg_noise_power

snr_db

shadow_sigma_db

forward(x: Tensor, *args: Any, csi=None, noise=None, **kwargs: Any) Tensor

Apply flat fading and noise to the input signal.

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

  • *args – Additional positional arguments (unused).

  • csi (Optional[torch.Tensor]) – Pre-computed channel state information (fading coefficients). If provided, these coefficients are used instead of generating new ones.

  • noise (Optional[torch.Tensor]) – Pre-generated noise tensor. If provided, this noise is added.

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

Returns:

The output tensor after applying fading and noise.

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]

k_factor: float | None
avg_noise_power: float | None
snr_db: float | None
shadow_sigma_db: float | None
__init__(shadow_sigma_db: float = 4.0, coherence_time=100, avg_noise_power: float | None = None, snr_db: float | None = None, *args: Any, **kwargs: Any)[source]

Initialize the Log-Normal Fading channel.

Parameters:
  • shadow_sigma_db (float) – Shadowing std dev in dB. Defaults to 4.0.

  • coherence_time (int) – Samples over which fading is constant. Defaults to 100.

  • avg_noise_power (float, optional) – 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.