Inside a digital communication system
About this lesson
Follow one letter through a complete baseband link. The letter C becomes the bits 01000011, a mapper turns them into +1 V and −1 V symbols, a pulse shaper holds each for 1 ms, an RC wire smears the pulses into each other (intersymbol interference) and noise is added on the way. The receiver averages each bit, samples once per bit and compares with 0 V, and gets C back. Every curve is computed by real convolution, and the whole chain is four lines of numpy. It builds on the Networking lesson "Bits on the wire", the Hardware lesson "Signal integrity", and the white-noise model from "Power spectral density and white noise".
The message is a list of bits
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.
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 -> decisionRead the lesson step by step
The message is a list of bits
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.
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 -> decisionBits become symbols
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.
symbol = 2·bit − 1 bit 1 -> +1 V bit 0 -> −1 V 01000011 -> −1 +1 −1 −1 −1 −1 +1 +1 polar (antipodal): the two levels are as far apart as the power allowsSymbols become pulses
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.
s(t) = Σ a_k · p(t − k·Tb) a_k symbol k (+1 or −1) p(t) 1 for 0 ≤ t < Tb, else 0 (a rectangle: the NRZ pulse) plot: s(t) in volts, t in ms slow motion: 8 ms played in 9 s other pulse shapes: see "Line coding" and "Pulse shaping" in this moduleThe channel smears the pulses
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).
channel = RC low-pass, τ = RC = 0.2 ms c[n] = a·c[n−1] + (1−a)·s[n] computed every dt = 40 µs a = exp(−dt/τ) = exp(−0.2) = 0.8187 after a change, one bit later: c = 1 − 2·exp(−Tb/τ) = 0.987 V same as convolving s with the channel's impulse response g[n] = (1−a)·aⁿThe channel adds noise
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).
r[n] = c[n] + w[n] w[n] Gaussian, mean 0, σ = 0.5 V independent every 40 µs -> flat power spectral density (white) this draw: measured σ = 0.55 V noise and its PSD: see "Power spectral density and white noise"The receive filter averages
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.
y[n] = (1/25) · Σ r[n−m], m = 0 .. 24 = r convolved with a box of height 1/25 and length 1 ms noise spread after averaging: σ / √25 = 0.5 / 5 = 0.1 V this draw: 0.09 V why a box is the best filter for a box pulse: "The matched filter" lessonSample once per bit
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.
y[k] = y(t = (k+1)·Tb), k = 0 .. 7 y[0] = −0.79 V y[1] = +0.67 V y[2] = −0.68 V y[3] = −1.16 V y[4] = −1.04 V y[5] = −0.95 V y[6] = +0.69 V y[7] = +0.94 V in Python: y_full[24::25] (the last point of every bit)Decide: above or below zero
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.
bit = 1 if y[k] > 0 V else 0 y[0] = −0.79 V -> 0 y[1] = +0.67 V -> 1 y[2] = −0.68 V -> 0 y[3] = −1.16 V -> 0 y[4] = −1.04 V -> 0 y[5] = −0.95 V -> 0 y[6] = +0.69 V -> 1 y[7] = +0.94 V -> 1 sent 01000011 received 01000011 errors: 0ISI and noise eat the margin
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.
noiseless samples (signal + ISI only): after a repeat |y| ≥ 1.00 V after a change |y| ≥ 0.64 V with this noise draw the smallest |y[k]| is 0.67 V (bit 1) noise after the filter: σ = 0.1 V a wrong bit needs the noise to cross the whole gap, about 6 σ here reading this at a glance: "Eye diagrams"The whole chain in Python
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.
import numpy as np b = np.array([0,1,0,0,0,0,1,1]) # 'C' = 67 a = np.exp(-0.04 / 0.2) # dt / tau g = (1 - a) * a**np.arange(200) # channel h = np.ones(25) / 25 # 1 ms box n = np.random.default_rng(1).normal(0, 0.5, 200) s = np.repeat(2*b - 1, 25) r = np.convolve(s, g)[:200] + n y = np.convolve(r, h)[24::25] bits = (y > 0).astype(int) >>> bits array([0, 1, 0, 0, 0, 0, 1, 1]) (Python 3 with numpy; numpy's noise is a different draw, the bits come out the same)
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01In which order does a bit pass through a baseband link?
Bits are mapped to symbols, symbols become pulses, the channel filters them and adds noise, then the receiver filters, samples once per symbol and decides.
02The RC channel has τ = 0.2 ms and bits last 1 ms. A bit follows a change from −1 V to +1 V. Without noise, what is the channel output at the end of that bit?
A first-order step from −1 to +1 gives c = 1 − 2·exp(−Tb/τ) = 1 − 2·exp(−5) = 0.987 V. It never quite reaches 1 V: the previous bit still leaks in. That leak is intersymbol interference.
03The receive filter averages 25 independent noise values with σ = 0.5 V each. What is the spread of the average?
The variance of a mean of L independent values is σ²/L, so the standard deviation is σ/√L = 0.5/5 = 0.1 V.
04Why are samples right after a change of bit weaker than samples after a repeated bit?
The low-pass channel cannot jump instantly, so the opposite previous symbol pulls the average down: about 0.64 V instead of 1.00 V here. That is intersymbol interference.
05In the Python version, which line plays the role of the sampler?
np.convolve in its default 'full' mode returns every output point; [24::25] keeps the last point of each 25-point bit, once per bit. y > 0 is the decision.
Glossary
- Symbol
- The value sent for one bit (or group of bits); here +1 V for a 1 and −1 V for a 0.
- Polar (antipodal) signalling
- Sending a bit as one of two opposite voltages, +A or −A.
- NRZ pulse
- Non-return-to-zero: a rectangle that holds the symbol's level for the whole bit time.
- Channel
- Everything between transmitter and receiver. Here a wire modelled as an RC low-pass filter plus additive noise.
- Intersymbol interference (ISI)
- One symbol's pulse spreading into the time of the next symbols, because the channel removes high frequencies.
- White noise
- Random noise whose power is spread evenly over frequency; independent samples give it a flat power spectral density.
- Receive filter
- The filter in front of the sampler that keeps the pulse and removes as much noise as it can; here a 1 ms moving average.
- Decision threshold
- The level a sample is compared with; above it the receiver decides 1, below it 0.
Notes and sources
- 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.
- J. G. Proakis, M. Salehi, Fundamentals of Communication Systems, 2nd ed., Pearson (§1.2.1 the digital communication system, §8.3.2 matched-filter demodulator, §10.1.1 intersymbol interference)
- MIT OpenCourseWare 6.02 Introduction to EECS II: Digital Communication Systems (Fall 2012)
- MIT 6.02 course notes, Bits, Signals, and Packets: ch. 9 Noise, ch. 10 Models for Physical Communication Channels, ch. 11 LTI Models and Convolution
- MIT OpenCourseWare 6.450 Principles of Digital Communications I (Fall 2006)
- MIT OpenCourseWare 6.003 Signals and Systems (Fall 2011)
- Intersymbol interference (Wikipedia): causes include band-limited channels
- Additive white Gaussian noise (Wikipedia)
- ASCII (Wikipedia): C is 67, binary 1000011
- Python documentation: ord()
- NumPy documentation: numpy.repeat
- NumPy documentation: numpy.convolve (default mode 'full')
- NumPy documentation: numpy.random.Generator.normal
Quiz Unlocks after the last step.