Building an eye
Sixteen bits leave as ±1 V pulses, 1 ms each, through an RC wire (τ = 0.2 ms). The receive filter averages each bit. Its output y(t) wiggles up and down. Is every bit safely clear of 0 V? Hard to tell.
An oscilloscope is triggered by the symbol clock, once per bit. Each tick it draws a 2 ms slice of y(t), centred on that bit's sampling instant. One slice alone tells us little.
Now the scope keeps every slice on screen. All 14 land on the same axes. The lines cross between bits and spread apart in the middle, around a hole. That shape is the eye diagram.
ISI closes it
First, a wire with no low-pass at all. Each slice is then straight ramps between −1 V and +1 V. At the centre every 1 sits at +1 V, every 0 at −1 V: the eye is 2.00 V tall.
The RC wire makes each bit lean on the one before: intersymbol interference (ISI). A bit right after a change reaches only ±0.64 V. Each rail splits into several lines, and the eye shrinks to 1.28 V tall.
Double the time constant to τ = 0.4 ms and the wire smears more. After a change a bit now reaches only ±0.30 V. The eye is 0.60 V tall: a much smaller target for the sampler.
Reading the margins
Back to τ = 0.2 ms, now with white noise added on the wire. After the filter it has spread σ = 0.1 V. Each slice wobbles, so the thin lines become fuzzy bands and the hole gets smaller.
The threshold is 0 V, mid-eye. The noise margin is half the eye height: the closest level sits 0.64 V away, 6.4 σ. Gaussian noise crosses 6.4 σ with chance Q(6.4) ≈ 8×10⁻¹¹ per such bit.
Slide the sampling instant and the gap changes. It is widest at 1.12 ms, 1.45 V: 120 µs late, because the wire delays the pulses. Sample at 0.80 ms instead and it falls to 0.49 V. Steep sides punish clock errors.
In Python
With numpy, two convolutions give y(t). sliding_window_view cuts it into 51-point windows, and [24::25] keeps one starting each bit: the 14 slices. Plotting them all together draws the eye.
The working
# step 1/10 · stream
bits 0100011101101111
(the word "Go" in ASCII, MSB first)
symbols 1 -> +1 V, 0 -> −1 V, NRZ, Tb = 1 ms
wire RC low-pass, τ = 0.2 ms
filter average over one bit (1 ms box)
y(t) is the receive-filter output: the
voltage the sampler would read at
t = 1, 2 … 16 ms
y lags the bits by the 1 ms average:
bit k is read at the END of its bit
time, so on the plot each sample sits
between two bit labels
the whole link: "Inside a digital
communication system"
The bits, the bit rate (1000 bit/s), the RC time constants (0.2 and 0.4 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 waveforms are computed on a 40 µs grid (25 points per bit), so each slice has 51 points and times move in 40 µs steps. Q(x) is the chance that a Gaussian value lands more than x standard deviations above its mean. The error figures assume the filtered noise is Gaussian with σ = 0.1 V and count only the worst bit pattern.