ENع
←Shannon's limit
Lesson 67 · Noise, errors and OFDM

Channel capacity: Shannon's limit

16 min11 steps5 questionsAdvanced
About this lesson

Every channel has a top speed for reliable bits. Follow one link with bandwidth B = 3000 Hz and S/N = 15: bandwidth caps the symbol rate at 2B, noise caps how many levels a symbol can use, and together they give Shannon's capacity C = B·log₂(1 + S/N) = 12 000 bit/s. Then turn the two dials, power and bandwidth, find the floor Eb/N₀ = −1.59 dB, and compute C in Python with numpy. Builds on the lessons on noise and SNR, bit error rate and entropy in this module.

You'll learn to

Tick what you feel confident about. These self-checks do not affect your lesson score.

Fig 67 · Interactive
01 / 11

How fast can bits get through?

A transmitter sends symbols down a wire to a receiver. The wire passes frequencies only up to B = 3000 Hz, and noise is added on the way. How many bits a second can get through with almost no errors?

transmitter -> channel -> + noise -> receiver

bandwidth   B = 3000 Hz
signal      power S (what arrives)
noise       power N in the band
S/N         = 15  (a power ratio)
            = 10·log10(15) = 11.76 dB

the question: the most bits per second
that can arrive almost error-free
Loading figure…
or ← →
Read the lesson step by step
  1. How fast can bits get through?

    A transmitter sends symbols down a wire to a receiver. The wire passes frequencies only up to B = 3000 Hz, and noise is added on the way. How many bits a second can get through with almost no errors?

    transmitter -> channel -> + noise -> receiver
    
    bandwidth   B = 3000 Hz
    signal      power S (what arrives)
    noise       power N in the band
    S/N         = 15  (a power ratio)
                = 10·log10(15) = 11.76 dB
    
    the question: the most bits per second
    that can arrive almost error-free
  2. Bandwidth caps the symbol rate

    A symbol is one pulse with one chosen voltage. Nyquist showed a channel of bandwidth B carries at most 2B independent symbols a second: 2 × 3000 = 6 000. Send faster and neighbouring symbols smear together.

    Nyquist (1927):  symbols/s <= 2B
    
    2 × 3000 Hz = 6000 symbols per second
    
    the plot: 24 symbols, each held for one
    symbol time 1/6000 s = 167 µs
    
    motion in the figure: slowed down a lot
    (ISI and the Nyquist pulse have their own lessons)
  3. More levels, more bits per symbol

    Each symbol picks one of M voltage levels, so it carries log₂ M bits. Four levels carry 2 bits; sixteen carry 4. With no noise we could use a million levels and send without limit.

    bits per symbol = log2(M)
      M =  2  ->  1 bit
      M =  4  ->  2 bits
      M = 16  ->  4 bits
    
    4 levels at average power S = 1 V²:
      −1.34  −0.45  0.45  1.34 V
      spacing 2d = 0.89 V
    
    bits/s = 2B · log2(M)   (Hartley, 1928)
  4. Noise blurs every symbol

    Noise adds a random voltage to each symbol. Here the signal power is 15 times the noise power: S/N = 15, about 11.8 dB. The receiver picks the nearest level. With 4 levels it got 1 of 24 wrong.

    received  y = x + n
    n: Gaussian, power N = S/15
       standard deviation 0.26 V
    
    nearest level wins
    half the spacing: d = 0.45 V
    = 1.73 noise standard deviations
    
    4 levels: 1 wrong out of 24
    (dots: received y; a ring marks a wrong pick)
  5. Too many levels: noise wins

    Squeeze 16 levels into the same power and they sit only 0.22 V apart, closer than the noise spreads. Same noise, and now 12 of 24 picks are wrong. Extra levels stop adding information.

    16 levels at the same S = 1 V²:
      spacing 2d = 0.22 V
      d = 0.11 V = 0.42 standard deviations
    
    the SAME noise values as before
    16 levels: 12 wrong out of 24
     4 levels:  1 wrong out of 24
    
    more levels: more bits per symbol,
    but far more of them wrong
  6. How many levels does noise allow?

    Voltages scale as the square root of power, so roughly √(1 + S/N) = √16 = 4 levels can be told apart. That is log₂ 4 = 2 bits per symbol, times 6 000 symbols a second: 12 000 bits a second.

    amplitude ratio = √(power ratio)
    
    levels   M ≈ √(1 + S/N) = √(1 + 15) = 4
    bits     log2(4) = 2 per symbol
    rate     2B · log2 M = 6000 × 2
           = 12000 bit/s
    
    a rule of thumb, not a guarantee:
    plain 4 levels still made 1 errors
  7. Shannon's formula

    Shannon (1948): C = B·log₂(1 + S/N) bits a second. Here 3000 × log₂ 16 = 12 000. Below C, a good code makes errors as rare as you like; above C, no code can. Plain 4 levels erred; coding closes that gap.

    C = B · log2(1 + S/N)      (bit/s)
      B   in Hz, S/N as a power ratio
      assumes white Gaussian noise
    
    C = 3000 × log2(1 + 15)
      = 3000 × log2(16) = 3000 × 4
      = 12000 bit/s
    
    rate R < C: error rate -> 0 is possible
    rate R > C: impossible, whatever the code
  8. More power: only a log gain

    Double the signal power: S/N = 30. C = 3000 × log₂ 31 = 14.9 kbit/s, only 24% more. Power sits inside the logarithm: one more bit per symbol needs S/N = 63, about four times the power.

    C = 3000 × log2(1 + 30)
      = 3000 × 4.954
      = 14863 bit/s   (+24 %)
    
    bits per symbol = ½·log2(1 + S/N)
      +1 bit  ->  (1 + S/N) × 4
      S/N: 15 -> 63  (4.2 × the power)
    
    high S/N: each +3 dB adds about B bit/s
  9. More bandwidth: noise grows too

    Double the bandwidth instead. White noise has the same power in every hertz, so N doubles and S/N falls to 7.5. C = 6000 × log₂ 8.5 = 18.5 kbit/s. With endless bandwidth C stops at 1.44·S/N₀ = 64.9 kbit/s.

    white noise: N = N0 · B
      N0 = noise power per hertz
    
    B = 6000 Hz:  S/N = 15 / 2 = 7.5
    C = 6000 × log2(8.5)
      = 18525 bit/s   (+54 %)
    
    B -> endless:  C -> (S/N0)·log2(e)
      S/N0 = 15 × 3000 = 45000 Hz
      C -> 1.443 × 45000 = 64921 bit/s
  10. The floor: Eb/N0 = −1.59 dB

    Energy per bit, Eb, is power divided by bit rate. Even with endless bandwidth, reliable bits need Eb/N₀ ≥ ln 2, or −1.59 dB. No code beats that. Long LDPC codes, used in Wi-Fi and 5G, come very close.

    Eb = S / R       (joules per bit)
    N0 = N / B       (noise per hertz)
    
    at R = C and B -> endless:
      Eb/N0 -> ln 2 = 0.693
            = 10·log10(0.693) = −1.59 dB
    
    with finite bandwidth the floor is higher
    bit error rates vs Eb/N0: see the BER lesson
    LDPC and turbo codes: a later lesson
  11. Capacity in Python

    In Python with numpy, np.log2 gives the base-2 logarithm, so one line gives C = 12000.0 bit/s. Give S/N as a power ratio: convert decibels first with snr = 10 ** (db / 10).

    import numpy as np
    B = 3000.0  # Hz
    snr = 15.0  # S/N, not dB
    C = B * np.log2(1 + snr)
    
    >>> C
    12000.0
    >>> snr_db = 10 * np.log10(snr)
    >>> round(snr_db, 2)
    11.76
    >>> 10 ** (30 / 10)    # 30 dB
    1000.0
    
    (Python 3 with numpy)

Quiz Unlocks after the last step.