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.A line code will typically reflect technical requirements of the transmission medium, such as optical fiber or shielded twisted pair.