2. Line Coding
Acknowledgments:
I would like to thank Wg Cdr (retd) Ramzan for his time and
guidance which were very helpful in planning and preparing
this lecture. I would also like to thank Dr. Ali Khayam and Mr.
Saadat Iqbal for their help and support.
Most of the material for this lecture has been taken from
âDigital Communicationsâ 2nd Edition by P. M. Grant and Ian
A. Glover.
3. What is Line Coding?
⢠Binary 1âs and 0âs, such as in PCM signaling, may be represented in
various serialâbit signaling formats called line codes.
⢠The simplest is to represent â1â by a square pulse and â0â by 0 volt.
But the simplest is not always good enough. Also, a long sequence
of â0â may appear as a loss of transmission.
⢠In order to take care of these and many other requirements, the
symbols are transformed in to various different wave shapes, a
process named line coding.
⢠Different wave shapes result in different spectrum suiting different
needs. Hence in a way, line codes are also spectrum shaping
codes.
⢠Mapping of binary information sequence into the digital signal that
enters the channel
â Ex. â1â maps to +A square pulse; â0â to âA pulse
4. Contâd
⢠Line code selected to meet system requirements:
â Transmitted power: Power consumption = $
â Bit timing: Transitions in signal help timing recovery
â Bandwidth efficiency: Excessive transitions wastes BW
â Low frequency content: Some channels block low
frequencies
⢠long periods of +A or of âA causes signal to âdroopâ
⢠Waveform should not have low-frequency content
â Error detection: Ability to detect errors helps
â Complexity/cost: Is code implementable in chip at high
speed?
⢠There are 2 major categories: returnâtoâzero (RZ) and
non returnâtoâzero (NRZ).
â With RZ coding, the waveform returns to a zeroâvolt level for a
portion (usually oneâhalf) of the bit interval.
5. Why Line Coding?
⢠There are many reasons for using line coding. Each of the line codes you will be
examining offers one or more of the following advantages:
ď Spectrum Shaping and Relocation without modulation or filtering. This is important in
telephone line applications, for example, where the transfer characteristic has heavy
attenuation below 300 Hz.
ď Bit clock recovery can be simplified.
ď DC component can be eliminated; this allows AC (capacitor or transformer) coupling
between stages (as in telephone lines). Can control baseline wander (baseline wander
shifts the position of the signal waveform relative to the detector threshold and leads to
severe erosion of noise margin).
ď Error detection capabilities.
ď Bandwidth usage; the possibility of transmitting at a higher rate than other schemes over
the same bandwidth.
⢠At the very least the LINE-CODE ENCODER serves as an interface between the TTL
level signals of the transmitter and those of the analog channel. Likewise, the LINE-
CODE DECODER serves as an interface between the analog signals of the channel
and the TTL level signals required by the digital receiver.
6. Necessary properties of line code:
⢠1. Self synchronization â It should be possible to recover the clock pulse from
the received data. Clock should not be lost even in case of a long sequence of
â0â. Self-synchronization, where the timing information is extracted from the
received signal itself
⢠2. Low probability of bit error â It should be convenient to design a receiver,
which receives the specific line code and results a low probability of bit error.
⢠3. PSD â Spectrum of the line code should suit the physical medium.
⢠4. Band width â Band width of the line coded signal should be low.
⢠5. No DC â DC power content should be ideally zero to enable AC coupling.
⢠6. Low frequency power â Power at very low frequency should as low as
possible.
⢠7. To suit channel coding â Line code should be such that subsequent coding
for error detection/correction is easy.
⢠8. Power efficiency â Required transmission power should be small.
⢠9. Transparency â Line code should be such that any sequence of â1â & â0â must
have only one inference.
7. Line Coding
Introduction:
Binary data can be transmitted using a number of different types of pulses. The
choice of a particular pair of pulses to represent the symbols 1 and 0 is called Line
Coding and the choice is generally made on the grounds of one or more of the
following considerations:
â Presence or absence of a DC level.
â Power Spectral Density- particularly its value at 0 Hz.
â Bandwidth.
â BER performance (this particular aspect is not covered in this lecture).
â Transparency (i.e. the property that any arbitrary symbol, or bit, pattern can
be transmitted and received).
â Ease of clock signal recovery for symbol synchronisation.
â Presence or absence of inherent error detection properties.
After line coding pulses may be filtered or otherwise shaped to further improve
their properties: for example, their spectral efficiency and/ or immunity to
intersymbol interference.
9. Classification of 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. Some examples include:
â Unipolar Signalling: In positiveâlogic unipolar signalling, the binary 1 is
represented by a high level (+A volts) and a binary 0 by a zero level. This
type of signalling is also called onâoff keying (OOK).
â Polar Signalling: Binary 1âs and 0âs are represented by equal positive and
negative levels
â Bipolar (Pseudo ternary) Signaling: Binary 1âs are represented by
alternating positive or negative values. The binary 0 is represented by a
zero level. The term pseudo ternary refers to the use of 3 encoded signal
levels to represent twoâlevel (binary) data. This is also called alternate
mark inversion (AMI) signaling.
â Manchester Signaling: Each binary 1 is represented by a positive halfâbit
period pulse followed by a negative halfâbit period pulse. Similarly, a binary
0 is represented by a negative halfâbit period pulse followed by a positive
halfâbit period pulse. This type of signaling is also called splitâphase
encoding.
10. Contâd
ď Polar NRZ: Also called NRZâL where L denotes the normal logic
level assignment.
â The NRZ-L is similar to Unipolar, in that the voltage directly depends on the bit it
represents.
â A positive voltage generally represents a â1â, and a negative voltage represents a
â0â (or vice versa).
â Unlike the unipolar scheme, NRZ-L alleviates the problem of the DC component.
ď Bipolar RZ: Also called RZâAMI, where AMI denotes alternate mark
(binary 1) inversion.
ď Bipolar NRZ: Also called NRZâM, where M de-notes inversion on
mark (binary 1)
11. Unipolar Signalling
Unipolar signalling (also called on-off keying, OOK) is the type of line coding in
which one binary symbol (representing a 0 for example) is represented by the
absence of a pulse (i.e. a SPACE) and the other binary symbol (denoting a 1) is
represented by the presence of a pulse (i.e. a MARK).
There are two common variations of unipolar signalling: Non-Return to Zero (NRZ)
and Return to Zero (RZ).
12. Unipolar Signalling
Unipolar Non-Return to Zero (NRZ):
In unipolar NRZ the duration of the MARK pulse (ĆŹ ) is equal to the duration (To) of the
symbol slot.
1 0 1 0 1 1 1 1 1 0
V
0
13. Unipolar Signalling
Unipolar Non-Return to Zero (NRZ):
In unipolar NRZ the duration of the MARK pulse (ĆŹ ) is equal to the duration (To) of the
symbol slot. (put figure here).
Advantages:
â Simplicity in implementation.
â Doesnât require a lot of bandwidth for transmission.
Disadvantages:
â Presence of DC level (indicated by spectral line at 0 Hz).
â Contains low frequency components. Causes âSignal Droopâ (explained later).
â Does not have any error correction capability.
â Does not posses any clocking component for ease of synchronisation.
â Is not Transparent. Long string of zeros causes loss of synchronisation.
15. Unipolar Signalling
Unipolar Non-Return to Zero (NRZ):
When Unipolar NRZ signals are transmitted over links with either transformer or
capacitor coupled (AC) repeaters, the DC level is removed converting them into a
polar format.
The continuous part of the PSD is also non-zero at 0 Hz (i.e. contains low
frequency components). This means that AC coupling will result in distortion of the
transmitted pulse shapes. AC coupled transmission lines typically behave like
high-pass RC filters and the distortion takes the form of an exponential decay of
the signal amplitude after each transition. This effect is referred to as âSignal
Droopâ and is illustrated in figure below.
16. Unipolar Signalling
-V/2
V/2
1 0 1 0 1 1 1 1 1 0
V
0
-V/2
V/2
0
1 0 1 0 1 1 1 1 1 0
V
0
-V/2
V/2
0
Figure Distortion (Signal Droop) due to AC coupling of unipolar NRZ signal
17. Unipolar Signalling
Return to Zero (RZ):
In unipolar RZ the duration of the MARK pulse (ĆŹ ) is less than the duration (To) of the symbol slot.
Typically RZ pulses fill only the first half of the time slot, returning to zero for the second half.
1 0 1 0 1 1 1 0 0 0
V
0
To
ĆŹ
18. Unipolar Signalling
Return to Zero (RZ):
In unipolar RZ the duration of the MARK pulse (ĆŹ ) is less than the duration (To) of the symbol slot.
Typically RZ pulses fill only the first half of the time slot, returning to zero for the second half.
1 0 1 0 1 1 1 0 0 0
V
0
To
ĆŹ
19. Unipolar Signalling
Unipolar Return to Zero (RZ):
Advantages:
â Simplicity in implementation.
â Presence of a spectral line at symbol rate which can be used as symbol
timing clock signal.
Disadvantages:
â Presence of DC level (indicated by spectral line at 0 Hz).
â Continuous part is non-zero at 0 Hz. Causes âSignal Droopâ.
â Does not have any error correction capability.
â Occupies twice as much bandwidth as Unipolar NRZ.
â Is not Transparent
21. Unipolar Signalling
In conclusion it can be said that neither variety of unipolar signals is suitable for
transmission over AC coupled lines.
22. Polar Signalling
In polar signalling a binary 1 is represented by a pulse g1(t) and a binary 0 by the
opposite (or antipodal) pulse g0(t) = -g1(t). Polar signalling also has NRZ and RZ
forms.
1 0 1 0 1 1 1 1 1 0
+V
-V
0
Figure. Polar NRZ
23. Polar Signalling
In polar signalling a binary 1 is represented by a pulse g1(t) and a binary 0 by the
opposite (or antipodal) pulse g0(t) = -g1(t). Polar signalling also has NRZ and RZ
forms.
+V
-V
0
Figure. Polar RZ
1 0 1 0 1 1 1 0 0 0
24. Polar Signalling
PSD of Polar Signalling:
Polar NRZ and RZ have almost identical spectra to the Unipolar NRZ and RZ. However,
due to the opposite polarity of the 1 and 0 symbols, neither contain any spectral lines.
Figure. PSD of Polar NRZ
25. Polar Signalling
PSD of Polar Signalling:
Polar NRZ and RZ have almost identical spectra to the Unipolar NRZ and RZ. However,
due to the opposite polarity of the 1 and 0 symbols, neither contain any spectral lines.
Figure. PSD of Polar RZ
26. Polar Signalling
Polar Non-Return to Zero (NRZ):
Advantages:
â Simplicity in implementation.
â No DC component.
Disadvantages:
â Continuous part is non-zero at 0 Hz. Causes âSignal Droopâ.
â Does not have any error correction capability.
â Does not posses any clocking component for ease of synchronisation.
â Is not transparent.
27. Polar Signalling
Polar Return to Zero (RZ):
Advantages:
â Simplicity in implementation.
â No DC component.
Disadvantages:
â Continuous part is non-zero at 0 Hz. Causes âSignal Droopâ.
â Does not have any error correction capability.
â Does not posses any clocking component for easy synchronisation. However, clock
can be extracted by rectifying the received signal.
â Occupies twice as much bandwidth as Polar NRZ.
28. BiPolar Signalling
Bipolar Signalling is also called âalternate mark inversionâ (AMI) uses three voltage
levels (+V, 0, -V) to represent two binary symbols. Zeros, as in unipolar, are
represented by the absence of a pulse and ones (or marks) are represented by
alternating voltage levels of +V and âV.
Alternating the mark level voltage ensures that the bipolar spectrum has a null at DC
And that signal droop on AC coupled lines is avoided.
The alternating mark voltage also gives bipolar signalling a single error detection
capability.
Like the Unipolar and Polar cases, Bipolar also has NRZ and RZ variations.
31. BiPolar Signalling
BiPolar / AMI NRZ:
Advantages:
â No DC component.
â Occupies less bandwidth than unipolar and polar NRZ schemes.
â Does not suffer from signal droop (suitable for transmission over AC coupled lines).
â Possesses single error detection capability.
Disadvantages:
â Does not posses any clocking component for ease of synchronisation.
â Is not Transparent.
34. BiPolar Signalling
BiPolar / AMI RZ:
Advantages:
â No DC component.
â Occupies less bandwidth than unipolar and polar RZ schemes.
â Does not suffer from signal droop (suitable for transmission over AC coupled lines).
â Possesses single error detection capability.
â Clock can be extracted by rectifying (a copy of) the received signal.
Disadvantages:
âIs not Transparent.
35. Manchester Signalling
In Manchester encoding , the duration of the bit is divided into two halves. The voltage
remains at one level during the first half and moves to the other level during the
second half.
A âOneâ is +ve in 1st half and -ve in 2nd half.
A âZeroâ is -ve in 1st half and +ve in 2nd half.
Note: Some books use different conventions.
1
0
0
-ve
-ve
+ve
+ve
0
38. Manchester Signalling
The transition at the centre of every bit interval is used for synchronization at the
receiver.
Manchester encoding is called self-synchronizing. Synchronization at the receiving end
can be achieved by locking on to the the transitions, which indicate the middle of the bits.
It is worth highlighting that the traditional synchronization technique used for unipolar,
polar and bipolar schemes, which employs a narrow BPF to extract the clock signal
cannot be used for synchronization in Manchester encoding. This is because the PSD of
Manchester encoding does not include a spectral line/ impulse at symbol rate (1/To).
Even rectification does not help.
39. Manchester Signalling
Manchester Signalling:
Advantages:
â No DC component.
â Does not suffer from signal droop (suitable for transmission over AC coupled lines).
â Easy to synchronise with.
â Is Transparent.
Disadvantages:
â Because of the greater number of transitions it occupies a significantly large
bandwidth.
â Does not have error detection capability.
These characteristic make this scheme unsuitable for use in Wide Area Networks. However,
it is widely used in Local Area Networks such as Ethernet and Token Ring.
40. Differential Coding
⢠Errors in some systems cause transposition in polarity, +A become â
A and vice versa
â All subsequent bits in Polar NRZ coding would be in error
⢠Differential line coding provides robustness to this type of error
⢠â1â mapped into transition in signal level
⢠â0â mapped into no transition in signal level
⢠Same spectrum as NRZ
⢠Errors occur in pairs
⢠Also used with Manchester coding
NRZ-inverted
(differential
encoding)
1 0 1 0 1 1 0 01
Differential
Manchester
encoding
LAN codes âManchester,
differential Manchester.
mB/nB
41. Differential Manchester coding
Each digit in an differential encoded sequence is obtained by comparing the
present input bit with the past encoded bit. A binary 1 is encoded if the present
input bit and past encoded bit are of opposite state. A binary 0 is encoded if the
states are the same. d(k)=m(k)âd(k-1)
43. Comparative study of line codes:
⢠1. UPNRZ and UPRZ are unipolar codes and need only single sided
power supply to generate them. Whereas PNRZ, PRZ, AMI and
Manchester need double sided power supply.
⢠2. AMI receiver needs to detect 3 levels. All other codes need to
detect only 2 levels.
⢠3. PNRZ, PRZ and Manchester carries a pulse in every bit. Hence,
loss of pulse will warn about a failure. Whereas, UPNRZ, UPRZ and
AMI do not have this benefit. A long sequence of â0â may be mistaken
as failure of transmission.
⢠4. AMI has a built in error detecting capability since any â0â being
converted to â1â or vice versa will violate the code.
45. Comparative study of line codes:
⢠1. First null BW for UPNRZ, PNRZ and AMI is Rb.
â Whereas for UPRZ, PRZ and Manchester it is 2Rb , i.e. double.
⢠2. PNRZ has maximum DC power content.
â UPNRZ and PRZ also have high DC power content.
â UPNRZ has an additional power spike at DC.
â Hence UPNRZ, PNRZ and PRZ are not at all suitable for AC coupling.
â DC power of UPRZ is much smaller
â DC power of UPRZ is much smaller than in UPNRZ, PNRZ and PRZ. But due to itâs
DC power spike, not advised for AC coupling.
â Both AMI and Manchester are suitable for AC coupling.
⢠3. UPRZ has a distinct power spike at Rb. Hence suitable to extract the
synchronizing clock signal.
⢠4. PRZ, AMI and Manchester do not have power spike at Rb. But if rectified,
these codes resemble UPRZ and hence the synchronizing signal can be
extracted.
46. Reference Text Books
1. âDigital Communicationsâ 2nd Edition by Ian A. Glover and Peter M. Grant.
2. âModern Digital & Analog Communicationsâ 3rd Edition by B. P. Lathi.
3. âDigital & Analog Communication Systemsâ 6th Edition by Leon W. Couch, II.
4. âCommunication Systemsâ 4th Edition by Simon Haykin.
5. âAnalog & Digital Communication Systemsâ by Martin S. Roden.
6. âData Communication & Networkingâ 4th Edition by Behrouz A. Forouzan.
46