Skip to content


Additive white Gaussian noise (AWGN) channel. It is defined by $$ Y_n = X_n + Z_n, $$ where $X_n$ is the channel input signal, $Y_n$ is the channel output signal, and $Z_n$ is the noise, which is iid according to a Gaussian distribution with zero mean. The channel signal-to-noise ratio is calculated by $$ \snr = \frac{P}{N}, $$ where $P = \mathrm{E}[X^2_n]$ is the average power of the input signal, and $N = \mathrm{E}[Z^2_n]$ is the average power (and variance) of the noise. For more details, see CT06, Ch. 9.

To invoke the channel, call the object giving the input signal as parameter (see example in the constructor below).


Constructor for the class.


  • signal_power (float | str)

    The input signal power $P$. If equal to the string 'measured', then every time the channel is invoked the input signal power will be computed from the input itself (i.e., its squared Euclidean norm).

  • snr (Optional[float])

    The channel signal-to-noise ratio $\snr$ (linear, not decibel). The default value is np.inf, which corresponds to a noiseless channel.


>>> np.random.seed(1)
>>> awgn = komm.AWGNChannel(snr=200.0, signal_power=5.0)
>>> x = [1.0, 3.0, -3.0, -1.0, -1.0, 1.0, 3.0, 1.0, -1.0, 3.0]
>>> y = awgn(x); np.around(y, decimals=2)
array([ 1.26,  2.9 , -3.08, -1.17, -0.86,  0.64,  3.28,  0.88, -0.95,  2.96])

snr property writable

The signal-to-noise ratio $\snr$ (linear, not decibel) of the channel.

signal_power property writable

The input signal power $P$.

noise_power property

The noise power $N$.


Returns the channel capacity $C$. It is given by $C = \frac{1}{2}\log_2(1 + \snr)$, in bits per dimension.


>>> awgn = komm.AWGNChannel(signal_power=1.0, snr=63.0)
>>> awgn.capacity()