Line Codes — NRZ / RZ / Manchester / AMI / MLT-3

← Home

Type a binary stream (or hex, or random). Pick a code. See the same bits encoded as voltage levels over time. Compare all six codes side-by-side for the same bit stream to understand the trade-off: DC balance, clock recovery (transitions per bit), and bandwidth (theoretical first-null). Long-form history "why NRZ → RZ → Manchester" lives in the deep-dive blog.

📡 EMFT Hub 📻 Modulation 📶 Digital Mod ⚡ Line Codes ← Home

Bit stream

Code

Voltage + time

⚠ Why so many codes? NRZ is the simplest but has DC drift and long runs of 1s (or 0s) give no clock-recovery transitions. RZ adds transitions for every 1 but is still DC-unbalanced. Manchester gives a transition every bit AND is DC-balanced, but at 2× the bandwidth. AMI and MLT-3 trade off complexity for narrower spectra. See the deep-dive blog for the full history.
① Time-domain voltage waveform v(t)
The y-axis is voltage (in V, scaled to ±Vdd). The x-axis is time in bit periods. Vertical grid lines mark bit boundaries; horizontal grid lines mark the voltage levels of the selected code (e.g., NRZ uses ±Vdd, AMI uses 0 and ±Vdd, MLT-3 cycles through 4 levels).
Same bit stream, six different voltage-level encodings. Watch the trade-off: NRZ is the simplest, RZ has a transition for every 1, Manchester has a transition every bit and is DC-balanced, AMI is DC-balanced at half the BW of Manchester, MLT-3 has the narrowest spectrum but the most levels.
Code
Selected code
Voltage levels
Rates
Bit period Tb
Bit rate Rb = 1/Tb
Baud (= Rb for binary codes)
Signal quality
DC component (mean v)
DC-balanced?
Transitions / bit (clock recovery)
1st-null BW (= x · Rb)
DC-balanced = mean voltage ≈ 0 (good for AC-coupled channels, no baseline wander). Transitions/bit ≈ 1 means the receiver can recover the clock from a long stream (no long runs of constant level).
Why these codes? (the trade-offs)
① NRZ-L: 2 levels, ±Vdd. Simple, but DC-unbalanced and no clock-recovery on long runs of 1s or 0s.
② NRZ-I: 2 levels. DC-balanced only if equal number of 1s and 0s. Differential encoding = no polarity ambiguity at the receiver.
③ RZ: 2 levels, but the "1" pulse returns to 0 mid-bit. Self-clocking for every 1, but still DC-unbalanced.
④ Manchester: always one transition per bit → self-clocking. DC-balanced by construction. Cost: 2× the bandwidth of NRZ.
⑤ AMI: 3 levels, "1"s alternate polarity → DC-balanced. Bandwidth half of Manchester. Used in T1 / E1.
⑥ MLT-3: 3 levels, but 4-state cycle. Lowest spectral content of the set. Used in 100BASE-TX Ethernet.

📖 Deep-dive blog (planned)

The history of why we go NRZ → RZ → Manchester → AMI → MLT-3 is a sequence of trade-offs. Each step solves a problem the previous one couldn't. The blog will walk through this evolution with the full derivation, eye diagrams, and how each code interacts with the channel (transformer coupling, baseline wander, jitter).

Posts are planned. Tool ships first; deep-dives follow.