Field Guide · algorithm

Also known as: Manchester code, Manchester encoding, biphase-L

Manchester coding is a line code in which each data bit is represented not by a steady level but by a transition in the middle of the bit period — the direction of that mid-bit edge carries the bit value.1 This makes the code self-clocking (a transition in every bit lets the receiver recover timing) and DC-balanced (equal time high and low), two properties that make it robust over channels that cannot carry DC or a separate clock, such as paging and early Ethernet.

bits 10110 a transition sits in the centre of every bit — the receiver clocks off it
In Manchester coding every bit carries a mid-bit edge, so timing is embedded in the data and the average level stays at zero.

How it works

Manchester coding maps each bit onto a two-level, half-bit-each symbol, equivalent to XORing the data bit with a clock running at the bit rate:

  • The mid-bit transition is the bit. In the common IEEE 802.3 convention a rising mid-bit edge encodes a 1 and a falling edge encodes a 0 (the original G. E. Thomas convention is the opposite). Whatever edges are needed at bit boundaries to set up the next mid-bit transition are “housekeeping” and carry no data.
  • Self-clocking. Because there is guaranteed to be an edge in the centre of every bit, the receiver’s clock-recovery loop always has an event to lock onto — there can be no long run of unchanging level to lose sync on, unlike plain NRZ.
  • DC balance. Each bit spends exactly half its time high and half low, so the running average is zero. That lets the signal pass through transformer- or capacitor-coupled links and AC-coupled receivers without baseline drift.
  • The cost is bandwidth. Guaranteeing a mid-bit edge doubles the maximum signalling rate, so Manchester needs roughly twice the bandwidth of an NRZI-style code carrying the same data rate. That trade — spectral efficiency for robust timing and DC balance — is the whole design decision.

A receiver decodes by sampling the two half-bit levels (or detecting the direction of the central edge); ambiguity from an inverted signal is handled by a known preamble or by pairing Manchester with differential decoding.

Because every bit is squeezed into two half-bit signalling elements, the line’s symbol rate is twice the data rate — the bandwidth cost that pays for the embedded clock and DC balance.

Variants

Several closely related biphase codes trade off the same properties differently:

  • Differential Manchester (biphase-M/S). Instead of an absolute rising-versus-falling convention, the bit is encoded by whether there is a transition at the bit boundary, while the mandatory mid-bit edge is used only for clocking. Like NRZI this makes the code immune to a whole-signal inversion, at the cost of the simple “edge direction = value” read-out. It is the physical coding of Token Ring and some fieldbus links.
  • Thomas vs. IEEE 802.3 convention. The two mainstream conventions assign the rising and falling mid-bit edges to opposite bit values, so a decoder must know which one a transmitter uses (or resolve it from a known preamble) to avoid inverting every bit.
  • Biphase mark/space (FM0/FM1). Related self-clocking codes used in RFID (EPC Gen2), audio time-code (SMPTE/LTC), and aviation ARINC buses, chosen for the same AC-coupling robustness.

Because Manchester needs no separate clock line and tolerates AC coupling, it appears wherever a simple, robust, self-synchronising bitstream is wanted: POCSAG and other paging bursts, 10BASE-T and 10-Mbit Ethernet, near-field/RFID tag links, IR remote and consumer-IR protocols, and countless low-rate telemetry and sensor radios. It is favoured in bursty, preamble-then-data formats where fast, reliable clock acquisition matters more than squeezing out bandwidth.

Relevance to SDR

For a scanner the most relevant case is POCSAG paging, where the 2-level FSK baseband is essentially a Manchester-style self-clocking stream a decoder must bit-sync and slice. Recognising Manchester’s guaranteed mid-bit transition tells the decoder where the symbol clock is and how to reject an accidental level inversion. GopherTrunk decodes POCSAG and similar self-clocked paging/telemetry formats; understanding the line code explains how bit timing is recovered from the demodulated FSK baseband before framing.

Sources

  1. Manchester code — Wikipedia, for the mid-bit-transition encoding, self-clocking and DC-balance properties, and conventions. 

See also