2. Line Coding Introduction Line coding involves converting a sequence of 1s and s to a time-domain signal (a sequence of pulses) suitable for transmission over a channel. The following primary factors should be considered when choosing or designing a line code [1, 2]. 1. Self-synchronisation. Timing information should be built into the time-domain signal so that the timing information can be extracted for clock synchronisation. long string of consecutive 1s and s should not cause a problem in clock recovery. 2. Transmission power and bandwidth efficiency. The transmitted power should be as small as possible, and the transmission bandwidth needs to be sufficiently small compared to the channel bandwidth so that intersymbol interference will not be a problem. 3. Favorable Power Spectral Density. The spectrum of the time-domain signal should be suitable for the transmission channel. For example, if a channel is ac coupled, it is desirable to have zero power spectral density near dc to avoid dc wandering in the pulse stream. 4. Low probability of error. When the received signal is corrupted by noise, the receiver can easily recover the uncoded signal with low error probability. 5. Error detection and correction capability. The line code should have error detection capability, and preferably have error correction capability. 6. Transparency. It should be possible to transmit every signal sequence correctly regardless of the patterns of 1s and s. If the data are coded so that the coded signal is received faithfully, the code is transparent. Given a sequence of pulses, there are two possible waveform formats that we can use to send a pulse of duration T b seconds over a channel. The duty cycle of the pulse can be used to define these two waveform formats. If the transmitted pulse waveform is maintained for the entire duration of the pulse, this is called non-return-to-zero (NRZ) format. If the transmitted pulse waveform only occupies a fraction of the pulse duration, this is called return-to-zero (RZ) format. 2.1
Classification of Line Waveforms [1] There are many types of line codes and we shall only discuss a few of them here. Figure 2.1 Waveforms for various line codes. The waveforms for the line code may be further classified according to the rule that is used to assign voltage levels to represent the binary data. 1. Polar Signal In positive logic, a 1 is represented by + volts and a is represented by - volts. Figure 2.1 (a) and Figure 2.1 (b) show polar NRZ and RZ signals, respectively. polar NRZ signal is also called a NRZ-L (L for level) signal because a high voltage level corresponds to a positive logic level [3]. lternatively, we could have used negative logic, where a 1 is represented by - volts and a is represented by + volts. 2. Unipolar Signal In positive logic, a 1 is represented by + volts and a is represented by volts. Figure 2.1 (c) and Figure 2.1 (d) show unipolar NRZ and RZ signals, respectively. 3. Bipolar (Pseudo-Ternary or lternate Mark Inverted) Signal In positive logic, 1s are sent as alternative positive or negative voltage values. s are represented by volt. The term pseudo-ternary refers to the use of 3 encoded logic levels to represent a 2-level signal. Figure 2.1 (e) and Figure 2.1 (f) show bipolar NRZ and RZ signals, respectively. bipolar RZ signal is also called a pseudo-ternary signal or a RZ-MI signal, where MI denotes alternate mark inversion [4]. 4. Manchester (Split-phase, Twinned-Binary) Coding Manchester coding was developed by Manchester University. In positive logic, a 1 is represented by + volts over a half-pulse period followed by - volts over a half-pulse period. is represented by - volts over a half-pulse period followed by + volts over a half-pulse period. This is shown in Figure 2.1 (g). Other names in use for Manchester coding are split-phase and twinned-binary coding. Sometimes it is called biphase-level (Bi-φ-L) [4]. 2.2
Manchester signal can be generated by multiplying a polar NRZ signal by a synchronised square-wave clock having a period T b [4]. It can also be generated by exclusive-oring a polar NRZ signal with a synchronised but inverted square-wave clock having a period T b [3]. 5. Miller (delay modulation) Coding [5] transition occurs at the mid-point of each symbol interval for a 1. For a 1 followed by a 1, no transition occurs at the symbol interval. No transition occurs at the mid-point of each symbol interval for a. For a followed by a, a transition occurs at the symbol interval. For a followed by a 1 or a 1 followed by a, no transition occurs at the symbol interval. This is shown in Figure 2.1 (h). Miller coding is also called delay modulation. Power Spectra of Line Codes Figure 2.2 Power spectral densities of various line codes. 1. Polar NRZ Signal (NRZ-L) The power spectral density for a polar NRZ signal with a pulse duration of T b is [1] P(f) = 2 T b sin π ft b π ft b 2 (2.1) Figure 2.2 (a) shows the power spectral density of the polar NRZ signal where is set to 1 so that the normalised average power of the signal is unity. dvantages: Relatively easy to generate the signal but requires dual supply voltages. Bit error probability performance is superior to other line encoding schemes. Disadvantages : It has a large power spectral density near dc. Poor clock recovery - a string of 1s or s will cause a loss of clock signal. 2.3
2. Unipolar NRZ Signal The unipolar NRZ signal consists of a polar NRZ signal plus a dc term. The power spectral density is therefore similar to that of the polar NRZ signal but with a delta function at dc. The power spectral density for a unipolar NRZ signal with a pulse duration of T b is [1] P(f) = 2 T b 4 sin π ft b π ft b 2 [1 + 1 T b δ(f)] (2.2) Figure 2.2 (b) shows the power spectral density of the unipolar NRZ signal where is set to 2 so that the normalised average power of the signal is unity. dvantage: Relatively easy to generate the signal (TTL/CMOS) from a single power supply. Disadvantages: dc component is always present corresponding to a waste of transmission power. It has a large power spectral density near dc. DC-coupled circuits are needed for this type of signalling. Poor clock recovery - a string of 1s and s will cause a loss of clock signal. 3. Unipolar RZ Signal The power spectral density for a unipolar RZ signal with a pulse duration of T b /2 is [1] P(f) = 2 T b 16 2 sin (π ft /2 ) b [1 + π ft /2 b 1 T b n = δ(f - n T b )] (2.3) Figure 2.2 (c) shows the power spectral density of the unipolar RZ signal where is set to 2 so that the normalised average power of the signal is unity. dvantage : Good clock recovery - periodic impulses at f = n/t b can be used for clock recovery. Disadvantages: The first null bandwidth is twice that for the polar NRZ signal or the unipolar NRZ signal. discrete impulse term is present at dc - waste of power. The spectrum is not negligible near dc. 2.4
For the same bit error performance, this signal requires 3 db more signal power than the polar RZ signal. 4. Bipolar RZ Signal (RZ-MI) The power spectral density for a polar RZ signal with a pulse duration of T b /2 is [1] P(f) = 2 T b 4 2 sin (π ft /2 ) b sin π ft /2 2 (π ft b ) (2.4) b Figure 2.2 (d) shows the power spectral density of the bipolar RZ signal where is set to 2 so that the normalised average power of the signal is unity. dvantages: There is a null at dc so that an ac-coupled circuit may be used in the transmission path. It has single-error-detection capability since a single error will cause a violation (the reception of 2 or more consecutive 1s with the same polarity). Good clock recovery - the clock signal can be easily extracted by converting the bipolar RZ signal to a unipolar RZ signal using full-wave rectification. Disadvantages: The bipolar RZ signal is not transparent. string of s will cause a loss of clock signal. The receiver has to distinguish between 3 logic levels. For the same bit error performance, this signal requires 3 db more signal power than the polar RZ signal. 5. Manchester (Split-phase, Twined-Binary) Coding The power spectral density for a Manchester signal with a pulse duration of T b /2 is [1] 2 P(f) = 2 sin (π ft /2) b T b sin π ft /2 2 (π ft b /2) (2.5) b Figure 2.2 (e) shows the power spectral density of the Manchester signal where is set to 1 so that the normalised average power of the signal is unity. dvantages: There is always a zero dc level regardless of the data sequence. Good clock recovery - a string of s will not cause a loss of clock signal. 2.5
Disadvantage: Null bandwidth is twice that of the polar NRZ (NRZ-L), unipolar NRZ, or bipolar RZ (RZ-MI) signals. 6. Miller Coding The power spectral density for a Miller signal with a pulse duration of T b /2 is [5] P(f) = 2 T b 2θ 2 (23-2 cosθ - 22 cos 2θ - 12 cos 3θ + (17 + 8cos 8θ ) 5 cos 4θ + 12 cos 5θ + 2 cos 6θ - 8 cos 7θ + 2cos 8θ) (2.6) where θ = π ft b. Figure 2.2 (f) shows the power spectral density of the Miller signal where is set to 1 so that the normalised average power of the signal is unity. dvantages : ttractive for magnetic recording and PSK signalling includes [5]: 1. Majority of signal energy lies in frequencies less than.5 of the symbol rate R = 1/T b. 2. Small spectrum at dc facilitates carrier tracking, and important in tape recording with poor dc response. 3. Small spectrum at dc, lower magnetic-tape recording speed can be used (higher packing density is possible). 4. Insensitive to 18 o phase ambiguity common to NRZ-L and Manchester coding. 5. Bandwidth requirements are approximately half those needed by Manchester coding. The clock frequency is embedded in the code for all symbol sequences [6]. Disadvantage : Small spectrum at dc may not be acceptable for some transmission channels [6]. In general, there is no optimum waveform choice for all digital transmission systems. Return-to-zero (RZ) waveforms may be attractive when the bandwidth is available. Because RZ waveforms always have two level transitions per symbol interval, symbol timing recovery can easily be achieved. For bandwidth-efficient systems, non-return-to- 2.6
zero (NRZ) waveforms are more attractive. However, long strings of ones or zeros should be avoided to allow accurate recovery of symbol timing. Polar or unipolar signals are found in most digital circuits, but they may have a nonzero dc level. Bipolar and Manchester signals will always have a zero dc level regardless of the data sequence. Table 2.1 Comparison of various line codes. Clock recovery First zero crossing Error detection verage dc Polar NRZ Poor R No Polar RZ Best 2R No Unipolar NRZ Poor R No +ve Unipolar RZ Good 2R No +ve Bipolar RZ Good R Built-in (RZ-MI) Poor - fails string of 1s or s; Good - fails string of s only; Best - synchronisation guaranteed. Differential Coding The differential form of encoding is actually more the result of a coding technique than it is a line waveform. When serial data are passed through many circuits along a transmission channel, the waveform is often unintentionally inverted. For example, if we employ a polar signal and reverse the two leads at a connection point of a twisted-pair transmission channel, the entire data sequence will be inverted and every symbol will be in error. Differential coding can solve this problem. We can insert a differential encoder before the line encoder at the transmitter and a differential decoder after the line decoder at the receiver to remove these errors. The differential encoding operation can be viewed as a rotation of the previous differential encoder output signals in accordance with the current differential encoder input signals. The differential decoder is performing the reverse operation. The encoding rules are: 1 is represented by a change in level between two consecutive symbol times. is represented by no change. This kind of differential form of encoding has been called NRZ-M (M for mark) signal, where M denotes inversion on mark [3]. Figure 2.3 (b) shows a NRZ-M signal. 2.7
If a 1 is represented by no change in level between two consecutive symbol times and a is represented by a change, this differential waveform has been called NRZ-S (S for space) signal, where S denotes inversion on space [3]. Figure 2.3 (c) shows a NRZ-S signal. Figure 2.3 Waveforms for (a) polar NRZ, (b) NRZ-M, and (c) NRZ-S. Unipolar versions are also possible. Figure 2.4 shows the differential encoder and decoder circuits. The truth table of the differential encoder and decoder is shown in Table 2.2. In Figure 2.4, we have also illustrated how differential encoding and decoding can remove these errors. It is assumed that the previous differential encoder output and the previous differential decoder input signals are initialised to and 1, respectively. The input sequence {x l } = 1 1 1 is differentially encoded to the sequence {x ' l } = 1 1 1. If the transmitted sequence {x ' } is inverted to 1 1, the differential decoder output sequence is {xl } = l 1 1 1. The errors have been removed. Figure 2.4 (a) Differential encoder, and (b) differential decoder. Table 2.2 Truth table for one-bit differential encoding and decoding One-bit differential encoding One-bit differential decoding Previous Current Current Previous Current Current output input output input input output x ' x x ' x ' l 1 l l l 1 x ' l x l 1 1 1 1 1 1 1 1 1 1 1 1 2.8
References [1] L. W. Couch II, Digital and nalog Communication Systems, 5/e, Prentice Hall, 1997. [2] B. P. Lathi, Modern Digital and nalog Communication Systems, 3/e, Oxford University Press, 1998. [3] M. S. Roden, nalog and Digital Communication Systems, 3/e, Prentice Hall, 1991. [4] Peebles, Jr., P. Z., Digital Communication Systems, Prentice Hall, 1987. [5] W. C. Lindsey and M. K. Simon, Telecommunication Systems Engineering, Prentice-Hall, 1973. [6] G. Smillie, nalogue and Digital Communication Techniques, rnold Pubs., 1999. 2.9
Line Codes on Mac - 1 1 1 1 M M S M S S M (a) Polar NRZ (NRZ-L) M - mark S - space - (b) Polar RZ T b (c) Unipolar NRZ (d) Unipolar RZ - - (e) Bipolar NRZ (f) Bipolar RZ (RZ-MI) - - (g) (h) Manchester (Bi - φ Miller (DM) -L) Figure 2.1 Waveforms for various line codes. 2.1
Line Codes on Mac T b P ( f ) (a) Polar NRZ (NRZ-L).5T b T b P ( f ).5R R 1.5R 2 R f.5t b (b) Unipolar NRZ.5Tb (c) Unipolar RZ Weight =.5.5R P ( f ) Weight =.25 P ( f ).5R R = 1/Tb R 1.5R 2R Weight =.1 R 1.5R 2R f f.5t b (d) Bipolar RZ (RZ-MI) (e) Manchester (Bi-φ -L) (f) Miller (DM).5T b 2.5T b P ( f ) P ( f ).5R.5R.5R R R 1.5R 1.5R 1.5R Figure 2.2 Power spectral densities of various line codes. R 2 R 2 R 2 R f f f 2.11
1 1 1 1 M M S M S S M - T b (a) Polar NRZ (NRZ-L) - (b) NRZ-M - (c) NRZ-S Figure 2.3 Waveforms for (a) polar NRZ, (b) NRZ-M, and (c) NRZ-S. Line Codes on Mac x l + x' l x' l + x l x' l -1 T b Tb x' l -1 Differential encoder Differential decoder x l x' l -1 x' l 1 1 1 1 1 1 1 1 (a) Initial digit x' l x' l -1 x l T b - signalling interval 1 1 1 1 1 1 1 1 (b) Figure 2.4 (a) Differential encoder, and (b) differential decoder. Initial digit 2.12