Channel capacity: Shannon's limit
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.
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-freeRead the lesson step by step
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-freeBandwidth 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)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)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)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 wrongHow 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 errorsShannon'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 codeMore 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/sMore 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/sThe 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 lessonCapacity 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)
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01A channel has bandwidth 2 kHz and S/N = 15 (a power ratio). What is its Shannon capacity?
C = B·log₂(1 + S/N) = 2000 × log₂ 16 = 2000 × 4 = 8000 bit/s.
02A link reports its signal-to-noise ratio as 30 dB. Which value goes into Shannon's formula?
The formula needs a power ratio: 10^(30/10) = 1000. Putting 30 in directly would badly underestimate the capacity.
03What does a capacity of 12 000 bit/s promise?
Shannon's coding theorem: below C, codes exist that make the error rate as small as you like; above C, none do. Plain uncoded symbols still make errors (the figure's 4-level run made some).
04The noise is white, so its power grows with bandwidth. Starting from B = 3000 Hz and S/N = 15, which change raises capacity more?
Double power: 3000 × log₂ 31 = 14.9 kbit/s. Double bandwidth (S/N halves to 7.5): 6000 × log₂ 8.5 = 18.5 kbit/s. Power sits inside the logarithm; bandwidth multiplies it.
05Even with endless bandwidth, what is the smallest Eb/N₀ at which reliable communication is possible?
As bandwidth grows without bound, Shannon's formula needs Eb/N₀ ≥ ln 2 = 0.693, which is −1.59 dB. With finite bandwidth the floor is higher.
Glossary
- Channel capacity (C)
- The highest rate, in bits per second, at which information can cross a channel with an error rate as low as you like.
- Bandwidth (B)
- The width of the band of frequencies the channel passes, in hertz. It limits the channel to 2B independent symbols a second.
- Symbol
- One pulse sent with one chosen voltage (or phase); with M possible values it carries log₂ M bits.
- Signal-to-noise ratio (S/N)
- Signal power divided by noise power in the band. Shannon's formula needs it as a ratio, not in decibels.
- Shannon–Hartley theorem
- C = B·log₂(1 + S/N) for a band-limited channel with additive white Gaussian noise and an average power limit.
- Noise density N₀
- White noise power per hertz of bandwidth; the noise in a band B is N = N₀·B.
- Eb/N₀
- Energy per bit divided by noise density: the fair way to compare systems at different rates. Its absolute floor is −1.59 dB.
Notes and sources
- B = 3000 Hz and S/N = 15 are chosen so the numbers come out round (log₂ 16 = 4); they are an example, not a particular cable. The noise is a seeded random draw, the same in every run, and every number in the figure is computed from this model.
- The motion is slowed down a great deal: the real link sends 6000 symbols a second.
- √(1 + S/N) levels is Hartley's rule of thumb matched to Shannon's result; Shannon's theorem does not promise that plain M-level symbols are error-free. It promises that some code, sending fewer bits than C, makes errors as rare as you like.
- The formula assumes additive white Gaussian noise and an average power limit (Shannon 1948, Theorem 17). Fading radio channels and noise that is not Gaussian need other formulas.
- C. E. Shannon, A Mathematical Theory of Communication, Bell System Technical Journal 27, 1948 (Theorem 17: C = W log((P + N)/N))
- J. G. Proakis, M. Salehi, Fundamentals of Communication Systems, 2nd ed., Pearson (ch. 12 information theory, §12.5.1 Gaussian channel capacity)
- J. G. Proakis, Digital Communications, 3rd ed., McGraw-Hill, 1995 (Internet Archive record)
- B. P. Lathi, Modern Digital and Analog Communication Systems, ch. 8 An introduction to information theory (Internet Archive record)
- MIT 6.02 course notes, Bits, Signals, and Packets: ch. 2 information and entropy, ch. 5 error correction, ch. 9 noise
- MIT OpenCourseWare 6.450 Principles of Digital Communications I (R. Gallager, L. Zheng, Fall 2006)
- Shannon–Hartley theorem (Wikipedia): Nyquist's 2B, Hartley's √(1 + S/N) levels, low-SNR and endless-bandwidth forms
- Noisy-channel coding theorem (Wikipedia): reliable below C, impossible above
- Eb/N0 (Wikipedia): the Shannon limit ln 2 = −1.59 dB, for endless bandwidth only
- Low-density parity-check code (Wikipedia): LDPC in Wi-Fi 6 and the 5G NR data channels
- NumPy documentation: numpy.log2
Quiz Unlocks after the last step.