Transmitter
We want to send the letter C. In ASCII, the standard text code, C is the number 67: the 8 bits 01000011. The transmitter sends 1000 bits a second, one every Tb = 1 ms.
A wire carries voltages, not digits. The mapper turns each bit into a number called a symbol: 1 becomes +1 V and 0 becomes −1 V. Two opposite levels is called polar signalling.
The pulse shaper holds each symbol's voltage for one bit time, 1 ms. These flat pulses are called NRZ (non-return-to-zero). Together they make s(t), the voltage the transmitter puts on the wire.
Channel
A real wire is a low-pass filter. Ours is an RC filter with time constant τ = 0.2 ms, so sharp edges become curves. Each pulse spills into the next bit: intersymbol interference (ISI).
Electrons in the wire and the receiver jiggle at random. That adds noise: here a fresh random value every 40 µs, spread σ = 0.5 V, as strong at all frequencies (white). The receiver gets r(t) = c(t) + n(t).
Receiver
The receive filter averages the last 1 ms of r(t): a convolution with a 1 ms box. The pulse survives, but averaging 25 independent noise values divides their spread by √25 = 5, from 0.5 V to 0.1 V.
A clock closes the sampler once per bit, at the end of each bit time: t = 1, 2 … 8 ms. Each closing keeps one number y[k]. The receiver must know where bits end; finding that is timing recovery.
The decision device compares each sample with a threshold of 0 V: above means 1, below means 0. Out come 01000011, which is 67, the letter C again. All 8 bits arrived correctly.
Reading the result
Without noise, a bit that repeats the last one reaches 1.00 V, but a bit right after a change only 0.64 V: ISI ate the rest. That gap to the threshold is the noise margin, here 0.64 V against noise of σ = 0.1 V.
In Python with numpy the chain is four lines: repeat makes the pulses, one convolution is the channel, a second is the receive filter, and the slice [24::25] is the sampler. y > 0 decides.
The working
# step 1/10 · source
message "C"
ASCII code ord("C") = 67
in 8 bits 01000011 (most significant first)
bit rate 1000 bit/s
bit time Tb = 1 / 1000 s = 1 ms
8 bits take 8 ms
the whole chain, left to right:
source -> mapper -> pulse shaper -> channel
(+ noise) -> receive filter -> sampler -> decision
The letter, the bit rate (1000 bit/s), the RC time constant (0.2 ms) and the noise level (σ = 0.5 V every 40 µs) are chosen example values. Every curve and number in the figure is computed from this model; the noise is a fixed pseudo-random draw. The motion is slowed down a great deal: 8 ms of signal plays over 9 s. The waveforms are computed on a 40 µs grid (25 points per bit). The RC channel is exact on that grid for an input held constant between grid points.