1import numpy as np2B = 3000.0 # Hz3snr = 15.0 # S/N, not dB4C = B * np.log2(1 + snr)TXRCB = 3 kHzn(t)RXB = 3000 Hz · S/N = 1500
0510152023-2-1012symbol number kvoltsSENT LEVELS AND RECEIVED y4 levels · 1 wrong16 levels · 12 wrong051015202530010203040506070S/N in 3 kHz (power ratio)kbit/sCAPACITY CB = 3 kHzB = 6 kHzB endless64.9 kbit/s
Coloured parts: what the current step is about; everything else rests in whiteBlocks: transmitter, channel (RC low-pass, bandwidth B), noise source, receiver and a Python code cardPlots: sent levels with the received values, and capacity against S/NSymbol tokens hop in slow motion; a red token is a wrong pickA link of bandwidth 3000 Hz with S/N = 15 carries at most C = B·log₂(1 + S/N) = 12 000 bit/s. √(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 channel

  1. 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?

Levels and noise

Shannon's formula

The floor and the code

The working

# step 1/11 · question

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

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.