Line Code

What is a line Code
A line code is a waveform that is used in digital telecommunications. There are several possible waveforms that are used in digital communication. In a binary case, a line code can have two possible values of a 1 or a 0. The common pulses used for line codes are On-off, Polar, and Bipolar waveforms.

Regenerative Repeater
Regenerative repeater are use to reconstruct a line code sequence that could have been damage by noise. These are placed in certain areas that will periodically regenerate the line code. Regenerative repeaters are used to reduce the accumulation of noise. If the line code is known, the frequency of the waveform can be obtained and be used to regenerate the signal.

Advantages and Disadvantages
A line code should have particular properties to be practical to use. Some of these properties are:

1. Transmission Bandwidth:
Bandwidth should be as small as possible

2. Power Efficiency
For a particular bandwidth and SNR, transmitted power should be as small as possible.

3. Error Detection and Correction Capability
Should be able to detect and possibly correct errors.

4. Favorable Power Spectral Density
A zero PSD at w=0 would be best due to ac coupling and becuase transformers are used as repeaters. Significant power in low-frequency components causes dc to wander in the pulse stream when ac coupling is used. The ac coupling is required because the dc paths provide by the cable pairs between the repeaters sites are used to transmit the power required to operate the repeaters.

5. Adequate Timing Content
The line code should have extractable clock information from the signal.

6. Transparency
Transparency is defined as a line code in which the bit pattern does not affect the accuracy of the timing. A transmitted signal would not be transparent if there are a long series of 0's which would cause an error in the timing information.

Autocorrelation function
Line codes are random signals that carry data. It is useful to know the autocorrelation function and to be able to predict the outcome of any given signal. The autocorrelation function also provides useful information about the power spectral density of the signal.

$$R_x(\tau)=\frac {1}{T_b} \sum_{n=-\infty }^\infty R_n \delta (\tau -n T_b)$$

$$R_o=\lim$$

Power
As mentioned above, autocorrelation function can generate the PSD of the line code. The Power Spectral Density is important to know because we can analyze many line codes form the knowing the PSD of the output. The only disadvantage of this is if the pulse shape of the line code changes the PSD has to be rederived all over again. In this analysis the pulse shape is assumed to be a rectangular function.

$$p(t) = rect(2t/T_b)$$

Where $$\frac {T_b}{2}$$ is the pulse width.

$$S_x(w)=\frac {1}{T_b} \sum_{n=-\infty }^\infty R_n e^{-jwT_b}$$

$$S_x(w)=\frac {1}{T_b}( R_o + 2\sum_{n=1}^\infty R_n cosnwT_b)$$

$$S_y(w)= \frac {| P(w) |^2}{T_b}( R_o + 2\sum_{n=1}^\infty R_n cosnwT_b)$$

On-off (RZ)
The on-off waveform is the most easiest line code to understand visually. In the on-off waveform for a binary signal, a 1 is transmitted by a pulse p(t) and a 0 is transmitted with a pulse of zero.

Power Spectral Density of a On-Off Line Code
$$S_y(w)=\frac {T_b}{16} \sin c^2 \frac {wT_b}{4}[ 1 + \frac {2\pi}{T_b}\sum_{n=-\infty}^\infty \delta (w - \frac {2\pi n}{T_b})]$$

Polar(RZ)
A polar waveform is another type of line code. In a polar waveform a 1 is transmitted by a pulse p(t) and a 0 is transmitted by a pulse -p(t).

Power Spectral Density of a Polar Line Code
$$S_y(w)=\frac {T_b}{4} \sin c^2 \frac {wT_b}{4}$$

Bipolar(RZ)
A bipolar waveform is yet another type of line code. In a bipolar waveform a 1 is transmitted by a p(t) or a -p(t). The transmitted p(t) pulse is dependant on the pervious value p(t) and alternates as 1's are getting transmitted. A 0 is transmitted by no pulse. Bipolar line code has the advantage over the other line codes by containing an error detection characteristic. As a series of 1's are transmitted in a line code the pulses alternates between p(t) and -p(t). An error can be detected if consecutive 1's do not alternate in sign.



Power Spectral Density of a Bipolar Line Code
$$\S_y(w)=\frac {T_b}{4} \sin c^2 \frac {wT_b}{4} sin^2 \frac {wT_b}{2}$$

How to get the PSD of a Polar RZ line code
In a polar waveform a 1 is transmitted by a pulse p(t) and a 0 is transmitted by a pulse -p(t).

$$R_o=\lim_{N \to \infty} \frac {1}{N} \sum_{k} a_k^2 $$

where N = pulses.

$$R_n=\lim_{T \to \infty} \frac {T_b}{T} \sum_{k} a_k a_{k+n} $$

In this case there is a 50% chance of getting a 1 or a -1 and $$a_k$$ is always 1.

$$R_o=\lim_{N \to \infty} \frac {1}{N} N=1 $$

Since the of a polar signal has equal probability to be a 1 or a -1, out of N terms of the product of $$a_k a_{k+1}$$ is euqal to 1 for N/2 and -1 for N/2.

$$R_n=\lim_{N \to \infty} \frac {1}{N} [\frac {N}{2}(1)+\frac {N}{2}(-1)]=0 $$

The PSD formula:

$$S_y(w)= \frac {| P(w) |^2}{T_b}( R_o + 2\sum_{n=1}^\infty R_n cosnwT_b)$$

Assume the line code, p(t) is a rectangular pulse of width $$T_b/2$$.

$$p(t)=rect(\frac {t}{T_b/2})$$

$$P(w)=\frac{T_b}{2}sinc(\frac {wT_b}{4})$$

The PSD for a Polar RZ:

$$S_y(w)=\frac {T_b}{4} \sin c^2 \frac {wT_b}{4})$$