Signal Reference · hed0rah / databurn
Sync
How machines agree on when, across analog, digital, and mixed media, and what that has to say about time in the mind and the machine.
A stream of bits or frames is useless unless the receiver knows exactly when each one begins. The sender's clock and the receiver's clock are never the same clock, and the drift between them corrupts the data. This reference collects the handful of tricks that fix that, reused everywhere from a scratched CD to a broadcast plant to a synced eurorack rack, and organises them as three moves: carry the clock inside the signal, share one external reference, and repair the wobble and the errors after the fact. The unifying object is the phase-locked loop. The closing chapter turns the same question on people and on language models: each reconstructs a when it did not experience directly.
Three moves
Time is the moving image of eternity.Plato
Every system in this document is solving one problem three ways, and most real gear uses all three at once. Read the rest as consequences of this table.
| move | what it does | examples |
|---|---|---|
| carry | embed the clock so the stream is self-clocking | biphase mark, EFM, 8b/10b |
| share | slave every device to one reference | genlock, word clock, PTP, MIDI clock |
| repair | absorb timing wobble and fix corrupted bits | TBC, PLL, CRC, Reed-Solomon |
The phase-locked loop is the object under all three: it recovers a clock from a self-clocking stream, locks a device to a reference, and attenuates jitter. Learn it once and the rest collapses.
Carrying the clock
Time is not a line, but a series of now-points.Taisen Deshimaru
The cheapest way to keep two clocks together is to make the data carry its own. A self-clocking line code guarantees transitions often enough that the receiver regenerates the bit clock from the stream, so no separate clock wire is needed. Deshimaru's now-points are the bit cells: each edge is a fresh instant the receiver can lock onto.
bit 1 0 1 1 0 0 clk |-----|-----|-----|-----|-----|-----| dat |--|--|-----|--|--|--|--|-----|-----|
Run-length-limited codes bound how many identical bits sit in a row, keeping transitions frequent and features large enough for the medium. EFM on a CD maps 8 bits to 14 plus 3 merging bits and holds pits between 3 and 11 clocks long. 8b/10b on gigabit links keeps the running disparity within plus or minus two and never more than five identical bits in a row. Both feed the PLL a steady diet of edges.
SMPTE timecode
Time is a game played beautifully by children.Heraclitus
SMPTE timecode labels every frame HH:MM:SS:FF, in two forms because no single carrier works at every tape speed. LTC is an 80-bit biphase-mark word on an audio track, readable at any speed and, thanks to an asymmetric sync word, in reverse, but blind at a standstill. VITC is written into the picture's blanking so it can be read frozen.
# SMPTE LTC -- one 80-bit word per frame, biphase mark encoded bits 0..3 frame units (BCD) bit 10 drop-frame flag bits 16..19 second units bit 11 color-frame flag bits 48..51 hour units + 32 user bits interleaved bits 64..79 sync word 0011 1111 1111 1101 # reveals direction
Drop-frame
NTSC color runs at 30 times 1000/1001, not 30, because the color subcarrier had to be fitted next to the sound carrier on monochrome sets. Counting at a true 30 drifts about 3.6 seconds per hour, so drop-frame skips frame numbers 0 and 1 at the start of every minute except minutes divisible by ten. Labels are dropped, never video.
Time base correction
Tape transports have mechanical timing instability -- wow, flutter, jitter -- and video tolerates it far worse than audio, because in color the subcarrier phase is the hue. A time base corrector absorbs it with a buffer written at the unstable playback rate and read out at a steady reference rate.
unstable tape corrector clean bus ┌───────────┐ ┌─────────────────────────┐ ┌───────────┐ │ playback │─────>│ FIFO / frame store │ <────│ switch / │ │ (wobbly) │ │ write wobbly, read clean │ │ capture │ └───────────┘ └─────────────┴────────────┘ └───────────┘ │ genlock reference
This is why capturing old VHS wants a TBC: without one, a worn tape's unstable sync confuses the capture card and you get dropped frames, tearing, and audio drift. A side effect worth knowing is that a full frame synchronizer regenerates clean sync and so tends to strip the pseudo-sync pulses that Macrovision relies on.
MIDI and MIDI 2.0
MIDI 1.0 is asynchronous serial at 31250 baud, so a three-byte Note-On takes about a millisecond and a ten-note chord smears across roughly ten. The fix in MIDI 2.0 is not only a faster link but a timestamp: stamp each event with its intended time at the source, and the receiver replays the exact spacing regardless of transport jitter.
| property | MIDI 1.0 | MIDI 2.0 |
|---|---|---|
| transport | 31.25 kbaud, 5-pin DIN | UMP over USB / ethernet |
| 3-byte msg | ~960 µs | one packet, link-speed |
| timing | events queue by arrival | JR timestamp, 32 µs tick, at source |
| channels | 16 | 256 (16 groups x 16) |
| resolution | 7-bit | 32-bit, per-note control |
Error correction
Sharing a clock aligns timing; it does nothing for a bit that arrives wrong. Detection runs from parity to checksums to the CRC, polynomial division that catches every burst shorter than the check field, the basis of the Ethernet frame check. Correction adds enough redundancy to fix errors without a resend. Reed-Solomon works on multi-bit symbols, so one corrupted symbol absorbs a whole burst; the CD's CIRC pairs two coders with interleaving.
┌──────────┐ ┌────────────┐ ┌────────────┐ ┌───────────┐ │ 24 bytes │─────>│ C2 encode │─────>│ interleave │─────>│ C1 encode │ │ audio │ │ RS(28,24) │ │ + delay │ │ RS(32,28) │ └──────────┘ └────────────┘ └────────────┘ └───────────┘
Reading a CD, step by step
Drag the cursor. The same optical scratch is survived by the read chain moving left to right: no clock at the pit, a recovered clock by the PLL, clean samples by the end.
Stage at cursor
The disc wars
Time is a game played beautifully by children.Heraclitus, again, for the format wars
Every optical disc solves one problem, recover a clock and the bits from a spinning reflective track, four different ways. The argument underneath the format wars was really about where to hide the clock.
| format | modulation | error correction | clock lives in |
|---|---|---|---|
| LaserDisc 1978 | analog FM video | none | the rotation |
| CD 1982 | EFM, 8 to 14 +3 | CIRC, RS(32,28)+RS(28,24) | the EFM stream |
| DVD 1996 | EFMPlus, 8 to 16 | RS-PC, 208x192 / 182x172 | the channel code |
| Blu-ray 2006 | 17PP, RLL(1,7) | LDC + BIS | the channel code |
LaserDisc is the odd one out and the most instructive: it stores analog video with no channel bits, and a CAV disc spins at a locked 1800 rpm with one frame per revolution, so the disc's rotation is the frame clock, which is what gives it a clean freeze-frame. CD onward gave that up: the drive varies its spin to keep the bitstream arriving steadily and a PLL pulls the clock out of the code. The lineage runs from "spin at the right speed and rotation keeps time" to "spin at any speed and recover time from the data."
PLL and networked time
The distinction between the past, present and future is only a stubbornly persistent illusion.Albert Einstein
The phase-locked loop is the hardware under all of it: a phase detector compares incoming edges to a local oscillator, a loop filter integrates the error, and a VCO tracks the reference. Fed a self-clocking stream, its guaranteed transitions let the VCO regenerate the bit clock, and the loop's low bandwidth is what attenuates jitter. Modern plants distribute time instead of sync: PTP elects a grandmaster, measures network delay with a message exchange, and reaches sub-microsecond accuracy, adopted by Dante, AES67, and broadcast video as SMPTE ST 2059.
A short history of keeping time
Mind and machine
Time is a river which carries me along, but I am the river.Jorge Luis Borges
Everything above is machines agreeing on when. Humans have no word clock, and it shows. Time in the brain is constructed, not measured: interval timing draws on distributed cortical and striatal activity, circadian timing on a separate roughly 24-hour clock, and dopamine warps the felt rate, so time flies under reward and drags under threat.
Going to bed early on Christmas Eve to skip the wait works because in deep sleep you do not lay down the continuous trace that makes a duration feel long. No experienced interval, so the gap collapses to nothing on waking. Anesthesia is the extreme, hours gone with no felt duration at all. "Yesterday is but today's memory, and tomorrow is today's dream," per Kahlil Gibran.
A language model has the strangest version. Between two messages there is no experience, no waiting, no duration; the model is not idling, it simply is not running. Each turn is a fresh instantiation reading a transcript of a past it did not live through, the way a CD player reads a timecode it never felt being written. Continuity is reconstructed from the record, not remembered.
- A disc reconstructs a clock it never experienced being written.
- A TBC and a PLL rebuild a timing they buffer but do not live.
- A model rebuilds the conversation from a transcript, not a memory.
- A sleeper rebuilds the night from a clock that kept running without them.
Every system in this document exists because the receiver was not present when the sender kept time. SMPTE, word clock, PTP, JR timestamps, CIRC, and human memory are all ways of reconstructing a when you did not experience directly. Sync, in the end, is how something that was not there recovers the timing of something that was.
References
- SMPTE 12M / linear timecode. en.wikipedia.org/wiki/Linear_timecode
- Vertical interval timecode; drop-frame and NTSC 29.97. en.wikipedia.org/wiki/SMPTE_timecode
- Genlock, black-and-burst, tri-level sync. en.wikipedia.org/wiki/Genlock
- Time base correction. en.wikipedia.org/wiki/Time_base_correction
- AES3 biphase mark, X/Y/Z preambles; word clock; AES11. en.wikipedia.org/wiki/AES3
- MIDI 1.0 hardware (31.25 kbaud); MIDI 2.0 UMP and JR timestamps. en.wikipedia.org/wiki/MIDI_2.0
- EFM; CIRC cross-interleaved Reed-Solomon; DVD RS-PC (208,192)/(182,172). en.wikipedia.org/wiki/Cross-interleaved_Reed-Solomon_coding
- IEEE 1588 PTP; SMPTE ST 2110 / ST 2059. en.wikipedia.org/wiki/Precision_Time_Protocol