You are on page 1of 12

Line Coding on Mac

20. Line Coding


Introduction Line coding involves converting a sequence of 1s and 0s 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. A long string of consecutive 1s and 0s should not cause a problem in clock recovery. 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. 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. Low probability of error. When the received signal is corrupted by noise, the receiver can easily recover the uncoded signal with low error probability. Error detection and correction capability. The line code should have error detection capability, and preferably have error correction capability. Transparency. It should be possible to transmit every signal sequence correctly regardless of the patterns of 1s and 0s. If the data are coded so that the coded signal is received faithfully, the code is transparent.

2.

3.

4.

5.

6.

Given a sequence of pulses, there are two possible waveform formats that we can use to send a pulse of duration Tb 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.

20.1

Line Coding on Mac

Classification of Line Waveforms [1] There are many types of line codes and we shall only discuss a few of them here. Figure 20.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 +A volts and a 0 is represented by -A volts. Figure 20.1 (a) and Figure 20.1 (b) show polar NRZ and RZ signals, respectively. A 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]. Alternatively, we could have used negative logic, where a 1 is represented by -A volts and a 0 is represented by +A volts. 2. Unipolar Signal

In positive logic, a 1 is represented by +A volts and a 0 is represented by 0 volts. Figure 20.1 (c) and Figure 20.1 (d) show unipolar NRZ and RZ signals, respectively. 3. Bipolar (Pseudo-Ternary or Alternate Mark Inverted) Signal

In positive logic, 1s are sent as alternative positive or negative voltage values. 0s are represented by 0 volt. The term pseudo-ternary refers to the use of 3 encoded logic levels to represent a 2-level signal. Figure 20.1 (e) and Figure 20.1 (f) show bipolar NRZ and RZ signals, respectively. A bipolar RZ signal is also called a pseudo-ternary signal or a RZ-AMI signal, where AMI 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 +A volts over a half-pulse period followed by -A volts over a half-pulse period. A 0 is represented by -A volts over a half-pulse period followed by +A volts over a half-pulse period. This is shown in Figure 20.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].
20.2

Line Coding on Mac

A Manchester signal can be generated by multiplying a polar NRZ signal by a synchronised square-wave clock having a period Tb [4]. It can also be generated by exclusive-ORing a polar NRZ signal with a synchronised but inverted square-wave clock having a period Tb [3]. 5. Miller (delay modulation) Coding [5]

A 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 0. For a 0 followed by a 0, a transition occurs at the symbol interval. For a 0 followed by a 1 or a 1 followed by a 0, no transition occurs at the symbol interval. This is shown in Figure 20.1 (h). Miller coding is also called delay modulation. Power Spectra of Line Codes Figure 20.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 Tb is [1] sin f Tb 2T P(f) = A b f Tb 2 (20.1)

Figure 20.2 (a) shows the power spectral density of the polar NRZ signal where A is set to 1 so that the normalised average power of the signal is unity. Advantages: 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 0s will cause a loss of clock signal.

20.3

Line Coding on Mac

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 Tb is [1] 2 2 A T sin f T b b [1 + 1 (f)] P(f) = 4 fT T b b

(20.2)

Figure 20.2 (b) shows the power spectral density of the unipolar NRZ signal where A is set to 2 so that the normalised average power of the signal is unity. Advantage: Relatively easy to generate the signal (TTL/CMOS) from a single power supply. Disadvantages: A 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 0s 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 Tb/2 is [1] 2 2 A T sin ( f T /2 ) b b [1 + 1 P(f) = 16 (f - n )] f T /2 T n = T b b b

(20.3)

Figure 20.2 (c) shows the power spectral density of the unipolar RZ signal where A is set to 2 so that the normalised average power of the signal is unity. Advantage : Good clock recovery - periodic impulses at f = n/Tb can be used for clock recovery. Disadvantages: The first null bandwidth is twice that for the polar NRZ signal or the unipolar NRZ signal. A discrete impulse term is present at dc - waste of power. The spectrum is not negligible near dc.
20.4

Line Coding on Mac

For the same bit error performance, this signal requires 3 dB more signal power than the polar RZ signal. 4. Bipolar RZ Signal (RZ-AMI)

The power spectral density for a polar RZ signal with a pulse duration of Tb/2 is [1] 2 2 A T sin ( f T /2 ) b b P(f) = 4 f T / 2 sin2( fTb) b

(20.4)

Figure 20.2 (d) shows the power spectral density of the bipolar RZ signal where A is set to 2 so that the normalised average power of the signal is unity. Advantages: 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. A string of 0s 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 Tb/2 is [1] 2 sin ( f Tb / 2) 2 P(f) = A2Tb f T /2 sin ( fTb/2) b

(20.5)

Figure 20.2 (e) shows the power spectral density of the Manchester signal where A is set to 1 so that the normalised average power of the signal is unity. Advantages: There is always a zero dc level regardless of the data sequence. Good clock recovery - a string of 0s will not cause a loss of clock signal.

20.5

Line Coding on Mac

Disadvantage: Null bandwidth is twice that of the polar NRZ (NRZ-L), unipolar NRZ, or bipolar RZ (RZ-AMI) signals. 6. Miller Coding

The power spectral density for a Miller signal with a pulse duration of Tb/2 is [5] 2 A T

P(f) =

(23 - 2 cos - 22 cos 2 - 12 cos 3 + 2 (17 + 8cos 8 ) 5 cos 4 + 12 cos 5 + 2 cos 6 - 8 cos 7 + 2cos 8) 2 (20.6)

where = fTb. Figure 20.2 (f) shows the power spectral density of the Miller signal where A is set to 1 so that the normalised average power of the signal is unity. Advantages : Attractive for magnetic recording and PSK signalling includes [5]: 1. 2. 3. 4. 5. Majority of signal energy lies in frequencies less than 0.5 of the symbol rate R = 1/Tb. Small spectrum at dc facilitates carrier tracking, and important in tape recording with poor dc response. Small spectrum at dc, lower magnetic-tape recording speed can be used (higher packing density is possible). Insensitive to 180o phase ambiguity common to NRZ-L and Manchester coding. 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-to20.6

Line Coding on Mac

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 20.1 Comparison of various line codes. ________________________________________________________________________ Clock recovery First zero crossing Error detection Average dc ________________________________________________________________________ Polar NRZ Poor R No 0 Polar RZ Best 2R No 0 Unipolar NRZ Unipolar RZ Poor Good R 2R No No +ve +ve

Bipolar RZ Good R Built-in 0 (RZ-AMI) ________________________________________________________________________ Poor - fails string of 1s or 0s; Good - fails string of 0s 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: A 1 is represented by a change in level between two consecutive symbol times. A 0 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 20.3 (b) shows a NRZ-M signal.

20.7

Line Coding on Mac

If a 1 is represented by no change in level between two consecutive symbol times and a 0 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 20.3 (c) shows a NRZ-S signal. Figure 20.3 Waveforms for (a) polar NRZ, (b) NRZ-M, and (c) NRZ-S. Unipolar versions are also possible. Figure 20.4 shows the differential encoder and decoder circuits. The truth table of the differential encoder and decoder is shown in Table 20.2. In Figure 20.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 (1) signals are initialised to 0 and 1, respectively. The input sequence {x } = 1 1 0 1 0 is l (1) differentially encoded to the sequence {x ' } = 1 0 0 1 1. If the transmitted sequence l (1) (1) {x ' } is inverted to 0 1 1 0 0, the differential decoder output sequence is {x } = l l 1 1 0 1 0. The errors have been removed. Figure 20.4 (a) Differential encoder, and (b) differential decoder. _______________________________________________________________________ Table 20.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 (1) (1) (1) (1) (1) (1) x ' x x ' x ' x ' x l 1 l l l 1 l l _________________________________ ________________________________ 0 0 0 0 0 0 1 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 _______________________________________________________________________

20.8

Line Coding on Mac

References [1] L. W. Couch II, Digital and Analog Communication Systems, 5/e, Prentice Hall, 1997. B. P. Lathi, Modern Digital and Analog Communication Systems, 3/e, Oxford University Press, 1998. M. S. Roden, Analog and Digital Communication Systems, 3/e, Prentice Hall, 1991. Peebles, Jr., P. Z., Digital Communication Systems, Prentice Hall, 1987. W. C. Lindsey and M. K. Simon, Telecommunication Systems Engineering, Prentice-Hall, 1973. G. Smillie, Analogue and Digital Communication Techniques, Arnold Pubs., 1999.

[2]

[3]

[4] [5]

[6]

20.9

Line Codes on Mac

A 0 -A A 0 -A A 0 A 0

1 M

1 M

0 S

1 M

0 S

0 S

1 M

M - mark S - space Time

(a) Polar NRZ (NRZ-L) Time (b) Polar RZ Time (c) Unipolar NRZ Time (d) Unipolar RZ

Tb

A 0 -A A 0 -A A 0 -A A 0 -A

Time (e) Bipolar NRZ Time (f) Bipolar RZ (RZ-AMI) Time (g) Manchester (Bi - -L) Time (h) Miller (DM)
Figure 20.1 Waveforms for various line codes.
20.10

Line Codes on Mac

T
(a) Polar NRZ (NRZ-L)

P (f ) b

0.5T b

f
0 0.5R

1.5R

2R

Tb
0.5T b (b) Unipolar NRZ

P (f )
Weight = 0.5

R = 1/T b f

0 0.5R P (f ) 0.5T b Weight = 0.25 (c) Unipolar RZ 0 0.5R

1.5R Weight = 0.1

2R

1.5R

2R

P (f )
0.5T b (d) Bipolar RZ (RZ-AMI) 0 0.5T b (e) Manchester (Bi- -L) 2.5T b (f) Miller (DM) 0 0.5R 0 0.5R

f R
1.5R 2R

P (f ) f
0.5R

1.5R

2R

P (f ) f R
1.5R 2R

Figure 20.2 Power spectral densities of various line codes.

20.11

Line Codes on Mac

A 0 -A A 0 -A A 0 -A

1 M

1 M

0 S

1 M

0 S

0 S

1 M Time

Tb

(a) Polar NRZ (NRZ-L) Time (b) NRZ-M Time (c) NRZ-S

Figure 20.3 Waveforms for (a) polar NRZ, (b) NRZ-M, and (c) NRZ-S.
(1) (1) (1) (1)

l
(1)

x'
+
l -1

x'

x
+

x'

Tb

Tb

(1)

x'

l -1

Differential encoder

Differential decoder
(1)

x x' x'

(1) l (1)

1 1 0 1 0 0 1 0 0 1 1 0 0 1 1 (a)

Initial digit

x' x' x

l
(1)

0 1 1 0 0 1 0 1 1 0 Initial 1 1 0 1 0 digit (b)

l -1 (1) l

l -1
(1)

Tb - signalling interval
Figure 20.4 (a) Differential encoder, and (b) differential decoder.

20.12

You might also like