kaira.channels.RicianFadingChannel

Inheritance diagram for RicianFadingChannel
- class kaira.channels.RicianFadingChannel(k_factor: float = 1.0, coherence_time=1, avg_noise_power: float | None = None, snr_db: float | None = None, *args: Any, **kwargs: Any)[source]
Bases:
FlatFadingChannelRician fading channel with configurable K-factor and coherence time.
A specialized version of FlatFadingChannel that uses Rician fading. Suitable for modeling wireless channels with a dominant direct path plus multiple weaker reflection paths.
- Mathematical Model:
y = h*x + n where h follows a Rician distribution with K-factor and n ~ CN(0,σ²)
The K-factor represents the ratio of power in the direct path to the power in the scattered paths. Higher K values indicate a stronger line-of-sight component.
- Parameters:
Example
>>> # Create a Rician channel with K=5 (strong direct path) >>> channel = RicianFadingChannel(k_factor=5, coherence_time=10, snr_db=15) >>> x = torch.complex(torch.ones(100), torch.zeros(100)) >>> y = channel(x) # Output with Rician fading
Methods
Initialize the Rician Fading channel.
Apply flat fading and noise to the input signal.
Get a dictionary of the channel's configuration.
Attributes
- 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:
- 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]
- __init__(k_factor: float = 1.0, coherence_time=1, avg_noise_power: float | None = None, snr_db: float | None = None, *args: Any, **kwargs: Any)[source]
Initialize the Rician Fading channel.
- Parameters:
k_factor (float) – Rician K-factor. Defaults to 1.0.
coherence_time (int) – Samples over which fading is constant. Defaults to 1.
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.