Line code

In telecommunications, a line code is a pattern of voltage, current, or photons used to represent digital data transmitted down a communication channel or written to a storage medium.

Line codes are chosen to meet one or more of the following criteria: Most long-distance communication channels cannot reliably transport a DC component.

There are three ways of eliminating the DC component: Bipolar line codes have two polarities, are generally implemented as RZ, and have a radix of three since there are three distinct output levels (negative, positive and zero).

If the runs are too long, clock recovery is difficult; if they are too short, the high frequencies might be attenuated by the communications channel.

This makes it easier to synchronize the transceivers and detect errors, however, the baud rate is greater than that of NRZ codes.

A line code will typically reflect technical requirements of the transmission medium, such as optical fiber or shielded twisted pair.

These requirements are unique for each medium, because each one has different behavior related to interference, distortion, capacitance and attenuation.

An example of coding a binary signal using rectangular pulse-amplitude modulation with polar non-return-to-zero code
An example of bipolar encoding , or AMI.
Encoding of 11011000100 in Manchester encoding
An example of biphase mark code
An example of MLT-3 encoding
An arbitrary bit pattern in various binary line code formats