Skip to content

Null Environments

Abstract environments that do not require physical device placements.

ControlledSNREnvironment

Bases: NullEnvironment

A single-channel environment that applies additive white Gaussian noise (AWGN) to a specific signal-to-noise ratio (SNR).

A null environment with controllable SNR that supports a single transmitter and receiver pair. During propagation, the transmitted signal is reduced to unit power. The correct amount of AWGN is then generated to achieve the specified SNR.

Raises ValueError: If more than one transmitter or more than one receiver.

snr: float property

Get the currently set signal-to-noise ratio in dB.

Returns Current signal-to-noise ratio in dB.

__init__(snr)

Create a ControlledSNREnvironment for single channel simulations with Gaussian noise.

Parameters:

Name Type Description Default
snr float

Desired signal-to-noise ratio in dB.

required

set_snr(snr)

Set signal-to-noise ratio (SNR) for the receiver in dB.

Parameters:

Name Type Description Default
snr float

Desired signal-to-noise ratio in dB.

required

NullEnvironment

Bases: BaseEnvironment

The simplest possible environment with ideal conditions.

RandomAWGNEnvironment

Bases: NullEnvironment

A null environment that produces a random level of background noise for each receiver.

This random level is sampled per receiver according to the power bounds supplied at instantiation.

bounds: tuple[float, float] property

Get current noise bounds.

Returns Background noise bounds as a tuple.

__init__(p_min, p_max, *, normalize_before_noise=False)

Initialize a new RandomAWGNEnviroment with bounded background noise levels.

Parameters:

Name Type Description Default
p_min float

Minimum background noise power.

required
p_max float

Maximum background noise power.

required
normalize_before_noise bool

Set to True if the aggregated signals should be normalized to unit power before adding background noise. Defaults to False.

False

set_bounds(p_min, p_max)

Set noise bounds for all receivers.

Parameters:

Name Type Description Default
p_min float

Minimum background noise power.

required
p_max float

Maximum background noise power.

required

RandomBoundedSNREnvironment

Bases: ControlledSNREnvironment

A single-channel environment that applies a random amount of additive white Gaussian noise (AWGN) according to preset SNR bounds.

A null environment with bounded SNR that supports a single transmitter and receiver pair. During propagation, the transmitted signal is reduced to unit power. The correct amount of AWGN is then generated to achieve an SNR within the provided bounds.

Raises ValueError: If more than one transmitter or more than one receiver.

__init__(snr_min, snr_max)

Create a RandomBoundedSNREnvironment for single channel simulations with Gaussian noise.

Parameters:

Name Type Description Default
snr_min float

Minimum desired signal-to-noise ratio in dB.

required
snr_max float

Maximum desired signal-to-noise ratio in dB.

required
Raise

ValueError: if snr_max < snr_min.