TExcelTAD
Home › Information Theory › The Gaussian Channel

The Gaussian Channel

The most important continuous channel adds Gaussian noise to a power-limited signal: Y=X+NY = X + N with N∼N(0,σ2)N \sim \mathcal{N}(0, \sigma^2) and average power E[X2]≤PE[X^2] \le P. It models radio, cable and optical links, and its capacity formula, the Shannon-Hartley theorem, sets the speed limit of every modem.

Capacity

C=12log⁡2(1+Pσ2)bits per channel useC = \frac{1}{2}\log_2\left(1 + \frac{P}{\sigma^2}\right) \quad \text{bits per channel use}

It is achieved by Gaussian inputs. The argument: I(X;Y)=h(Y)−h(N)I(X; Y) = h(Y) - h(N); the noise term is fixed, and h(Y)h(Y) is largest when YY is Gaussian, which happens when XX is Gaussian with variance PP (Differential Entropy). The ratio Pσ2\frac{P}{\sigma^2} is the signal-to-noise ratio (SNR), often quoted in decibels: 10log⁡10SNR10\log_{10}\text{SNR}.

python · try it yourself
import numpy as np

for snr_db in [-10, 0, 3, 10, 20, 30]:
    snr = 10 ** (snr_db / 10)
    print(f"SNR {snr_db:4d} dB (ratio {snr:8.2f}): C = {0.5 * np.log2(1 + snr):.4f} bits per use")
SNR  -10 dB (ratio     0.10): C = 0.0688 bits per use
SNR    0 dB (ratio     1.00): C = 0.5000 bits per use
SNR    3 dB (ratio     2.00): C = 0.7913 bits per use
SNR   10 dB (ratio    10.00): C = 1.7297 bits per use
SNR   20 dB (ratio   100.00): C = 3.3291 bits per use
SNR   30 dB (ratio  1000.00): C = 4.9836 bits per use

At high SNR, each extra 6 dB (a factor of 4 in power) adds one bit per use. At low SNR, capacity is nearly proportional to power.

Bandwidth: the Shannon-Hartley theorem

A channel of bandwidth WW hertz can carry 2W2W independent samples per second. With noise power spectral density N0N_0, the noise power in the band is N0WN_0W, so

C=Wlog⁡2(1+PN0W)bits per secondC = W\log_2\left(1 + \frac{P}{N_0W}\right) \quad \text{bits per second}
python · try it yourself
import numpy as np

P_over_N0 = 1e6                                    # signal power / noise density, in Hz
for W in [1e3, 1e4, 1e5, 1e6, 1e7, 1e8]:
    C = W * np.log2(1 + P_over_N0 / W)
    print(f"W = {W:9.0f} Hz: C = {C / 1e3:9.1f} kbit/s")
print(f"limit as W grows: P/(N0 ln 2) = {P_over_N0 / np.log(2) / 1e3:.1f} kbit/s")
W =      1000 Hz: C =      10.0 kbit/s
W =     10000 Hz: C =      66.6 kbit/s
W =    100000 Hz: C =     345.9 kbit/s
W =   1000000 Hz: C =    1000.0 kbit/s
W =  10000000 Hz: C =    1375.0 kbit/s
W = 100000000 Hz: C =    1435.5 kbit/s
limit as W grows: P/(N0 ln 2) = 1442.7 kbit/s

More bandwidth helps, but with diminishing returns: as W→∞W \to \infty, capacity tends to PN0ln⁡2\frac{P}{N_0 \ln 2}. Equivalently, reliable communication needs at least EbN0≥ln⁡2\frac{E_b}{N_0} \ge \ln 2, about −1.59-1.59 dB of energy per bit: the Shannon limit.

Binary inputs and hard decisions

Real systems often restrict inputs to ±P\pm\sqrt{P} (BPSK). That loses little at low SNR but caps capacity at 1 bit per use. Thresholding the output to a bit (a BSC) loses more:

python · try it yourself
import numpy as np
from scipy.stats import norm
from scipy.integrate import quad

def bpsk_soft_capacity(snr):
    s = 1 / np.sqrt(snr)                                       # amplitude 1, noise std s
    def integrand(y):
        p0, p1 = norm.pdf(y, 1, s), norm.pdf(y, -1, s)
        return p0 * np.log2(2 * p0 / (p0 + p1))
    return quad(integrand, 1 - 12 * s, 1 + 12 * s, limit=200)[0]

H2 = lambda f: -f * np.log2(f) - (1 - f) * np.log2(1 - f)
for snr_db in [-5, 0, 5, 10]:
    snr = 10 ** (snr_db / 10)
    f = norm.cdf(-np.sqrt(snr))
    print(f"{snr_db:3d} dB: Gaussian input {0.5 * np.log2(1 + snr):.4f}, BPSK soft {bpsk_soft_capacity(snr):.4f}, "
          f"BPSK hard {1 - H2(f):.4f}")
 -5 dB: Gaussian input 0.1982, BPSK soft 0.1977, BPSK hard 0.1353
  0 dB: Gaussian input 0.5000, BPSK soft 0.4859, BPSK hard 0.3689
  5 dB: Gaussian input 1.0287, BPSK soft 0.8592, BPSK hard 0.7685
 10 dB: Gaussian input 1.7297, BPSK soft 0.9968, BPSK hard 0.9908

Keeping soft values instead of hard bits is worth about 2 dB at low SNR, which is why modern decoders work with log-likelihood ratios (Sum-Product (Belief Propagation) Decoding).

Parallel channels and water-filling

With several independent Gaussian channels of different noise levels (for example the subcarriers of OFDM in Wi-Fi and 4G/5G) and a total power budget, the best allocation is water-filling: pour power into the channels as water into a vessel whose floor is the noise level. Quiet channels get more power; very noisy channels may get none. This is a small convex optimization problem solved by its KKT conditions (The KKT Conditions).

python · try it yourself
import numpy as np
from scipy.optimize import brentq

noise = np.array([0.5, 1.0, 2.0, 4.0, 8.0])
P_total = 6.0
level = brentq(lambda mu: np.maximum(mu - noise, 0).sum() - P_total, 0, 100)
power = np.maximum(level - noise, 0)
C = 0.5 * np.log2(1 + power / noise).sum()
print("water level:", round(level, 4))
print("power per channel:", np.round(power, 4))
print(f"total capacity {C:.4f} bits;  equal split gives {0.5 * np.log2(1 + P_total / 5 / noise).sum():.4f}")
water level: 3.1667
power per channel: [2.6667 2.1667 1.1667 0.     0.    ]
total capacity 2.4944 bits;  equal split gives 2.0806

In software

  • Modems pick a modulation and code rate from the measured SNR (adaptive coding and modulation), staying a few dB below the Shannon-Hartley limit.
  • Water-filling appears in OFDM bit loading, in MIMO precoding over singular values of the channel matrix, and in rate-distortion for Gaussian sources (reverse water-filling).

Exercises

Exercise 1: Capacity at 15 dB

What is the capacity per use at SNR 15 dB?

Answer

About 2.51 bits.

Solution

101.5=31.610^{1.5} = 31.6, and 12log⁡232.6=2.513\frac{1}{2}\log_2 32.6 = 2.513.

Exercise 2: Doubling the power

At high SNR, how much does doubling the power increase the capacity per use?

Answer

About half a bit.

Solution

12log⁡2(1+2 SNR)−12log⁡2(1+SNR)→12log⁡22=12\frac{1}{2}\log_2(1 + 2\,\text{SNR}) - \frac{1}{2}\log_2(1 + \text{SNR}) \to \frac{1}{2}\log_2 2 = \frac{1}{2}.

Exercise 3: A phone line (code)

A phone line has bandwidth 3100 Hz and SNR 35 dB. What is its Shannon capacity?

Answer

About 36 kbit/s.

Solution
python · try it yourself
import numpy as np

W, snr = 3100, 10 ** 3.5
print(round(W * np.log2(1 + snr) / 1000, 2), "kbit/s")
36.04 kbit/s

This is why analog modems topped out around 33.6 kbit/s.

Test yourself

The capacity of the Gaussian channel per use is…

  1. 12log⁡2(1+SNR)\frac{1}{2}\log_2(1 + \text{SNR})
  2. log⁡2SNR\log_2 \text{SNR}
  3. 1−H2(SNR)1 - H_2(\text{SNR})
  4. SNR\text{SNR}

As bandwidth grows without limit at fixed power, capacity…

  1. approaches PN0ln⁡2\frac{P}{N_0 \ln 2}
  2. grows without limit
  3. drops to zero
  4. stays constant at any bandwidth

Water-filling gives more power to…

  1. the channels with less noise
  2. the channels with more noise
  3. all channels equally
  4. only one channel