Line coding

46
Line Coding EC-353 Digital Communication www.spsu.ac.in [email protected] SIR PADAMPAT SINGHANIA UNIVERSITY Santosh Kumar Bharti

description

RAvi RAthore

Transcript of Line coding

Page 1: Line coding

Line Coding

EC-353Digital Communication

[email protected]

SIR PADAMPATSINGHANIAUNIVERSITY

Santosh Kumar Bharti

Page 2: Line coding

Line CodingAcknowledgments:I would like to thank Wg Cdr (retd) Ramzan for his time andguidance which were very helpful in planning and preparingthis 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 IanA. Glover.

Page 3: Line coding

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 sequenceof ‘0’ may appear as a loss of transmission.

• In order to take care of these and many other requirements, thesymbols are transformed in to various different wave shapes, aprocess named line coding.

• Different wave shapes result in different spectrum suiting differentneeds. Hence in a way, line codes are also spectrum shapingcodes.

• Mapping of binary information sequence into the digital signal thatenters the channel– Ex. “1” maps to +A square pulse; “0” to –A pulse

Page 4: Line coding

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.

Page 5: Line coding

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 heavyattenuation 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 wandershifts the position of the signal waveform relative to the detector threshold and leads tosevere 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 TTLlevel 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 channeland the TTL level signals required by the digital receiver.

Page 6: Line coding

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 thereceived 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.

Page 7: Line coding

Line CodingIntroduction:Binary data can be transmitted using a number of different types of pulses. Thechoice of a particular pair of pulses to represent the symbols 1 and 0 is called LineCoding and the choice is generally made on the grounds of one or more of thefollowing 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 canbe 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 improvetheir properties: for example, their spectral efficiency and/ or immunity tointersymbol interference.

Page 8: Line coding

Different Types of Line Coding

Page 9: Line coding

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 binarydata. 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. Thistype of signalling is also called on–off keying (OOK).

– Polar Signalling: Binary 1’s and 0’s are represented by equal positive andnegative levels

– Bipolar (Pseudo ternary) Signaling: Binary 1’s are represented byalternating positive or negative values. The binary 0 is represented by azero level. The term pseudo ternary refers to the use of 3 encoded signallevels to represent two–level (binary) data. This is also called alternatemark inversion (AMI) signaling.

– Manchester Signaling: Each binary 1 is represented by a positive half–bitperiod pulse followed by a negative half–bit period pulse. Similarly, a binary0 is represented by a negative half–bit period pulse followed by a positivehalf–bit period pulse. This type of signaling is also called split–phaseencoding.

Page 10: Line coding

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 onmark (binary 1)

Page 11: Line coding

Unipolar Signalling

Unipolar signalling (also called on-off keying, OOK) is the type of line coding inwhich one binary symbol (representing a 0 for example) is represented by theabsence of a pulse (i.e. a SPACE) and the other binary symbol (denoting a 1) isrepresented 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).

Page 12: Line coding

Unipolar SignallingUnipolar Non-Return to Zero (NRZ):

In unipolar NRZ the duration of the MARK pulse (Ƭ ) is equal to the duration (To) of thesymbol slot.

1 0 1 0 1 1 1 1 1 0

V

0

Page 13: Line coding

Unipolar SignallingUnipolar Non-Return to Zero (NRZ):

In unipolar NRZ the duration of the MARK pulse (Ƭ ) is equal to the duration (To) of thesymbol 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.

Page 14: Line coding

Unipolar SignallingUnipolar Non-Return to Zero (NRZ):

Figure. PSD of Unipolar NRZ

Page 15: Line coding

Unipolar SignallingUnipolar Non-Return to Zero (NRZ):

When Unipolar NRZ signals are transmitted over links with either transformer orcapacitor coupled (AC) repeaters, the DC level is removed converting them into apolar format.

The continuous part of the PSD is also non-zero at 0 Hz (i.e. contains lowfrequency components). This means that AC coupling will result in distortion of thetransmitted pulse shapes. AC coupled transmission lines typically behave likehigh-pass RC filters and the distortion takes the form of an exponential decay ofthe signal amplitude after each transition. This effect is referred to as “SignalDroop” and is illustrated in figure below.

Page 16: Line coding

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

Page 17: Line coding

Unipolar SignallingReturn 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

Ƭ

Page 18: Line coding

Unipolar SignallingReturn 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

Ƭ

Page 19: Line coding

Unipolar SignallingUnipolar Return to Zero (RZ):

Advantages:– Simplicity in implementation.– Presence of a spectral line at symbol rate which can be used as symboltiming 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

Page 20: Line coding

Unipolar SignallingUnipolar Return to Zero (RZ):

Figure. PSD of Unipolar RZ

Page 21: Line coding

Unipolar Signalling

In conclusion it can be said that neither variety of unipolar signals is suitable fortransmission over AC coupled lines.

Page 22: Line coding

Polar SignallingIn polar signalling a binary 1 is represented by a pulse g1(t) and a binary 0 by theopposite (or antipodal) pulse g0(t) = -g1(t). Polar signalling also has NRZ and RZforms.

1 0 1 0 1 1 1 1 1 0

+V

-V

0

Figure. Polar NRZ

Page 23: Line coding

Polar SignallingIn polar signalling a binary 1 is represented by a pulse g1(t) and a binary 0 by theopposite (or antipodal) pulse g0(t) = -g1(t). Polar signalling also has NRZ and RZforms.

+V

-V

0

Figure. Polar RZ

1 0 1 0 1 1 1 0 0 0

Page 24: Line coding

Polar SignallingPSD 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

Page 25: Line coding

Polar SignallingPSD 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

Page 26: Line coding

Polar SignallingPolar 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.

Page 27: Line coding

Polar SignallingPolar 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, clockcan be extracted by rectifying the received signal.– Occupies twice as much bandwidth as Polar NRZ.

Page 28: Line coding

BiPolar SignallingBipolar Signalling is also called “alternate mark inversion” (AMI) uses three voltagelevels (+V, 0, -V) to represent two binary symbols. Zeros, as in unipolar, arerepresented by the absence of a pulse and ones (or marks) are represented byalternating voltage levels of +V and –V.

Alternating the mark level voltage ensures that the bipolar spectrum has a null at DCAnd that signal droop on AC coupled lines is avoided.

The alternating mark voltage also gives bipolar signalling a single error detectioncapability.

Like the Unipolar and Polar cases, Bipolar also has NRZ and RZ variations.

Page 29: Line coding

BiPolar Signalling

Figure. BiPolar NRZ

1 0 1 0 1 1 1 1 1 0

+V

-V

0

Page 30: Line coding

Polar SignallingPSD of BiPolar/ AMI NRZ Signalling:

Figure. PSD of BiPolar NRZ

Page 31: Line coding

BiPolar SignallingBiPolar / 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.

Page 32: Line coding

BiPolar Signalling

Figure. BiPolar RZ

1 0 1 0 1 1 1 1 1 0

+V

-V

0

Page 33: Line coding

BiPolar SignallingPSD of BiPolar/ AMI RZ Signalling:

Figure. PSD of BiPolar RZ

Page 34: Line coding

BiPolar SignallingBiPolar / 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.

Page 35: Line coding

Manchester SignallingIn Manchester encoding , the duration of the bit is divided into two halves. The voltageremains at one level during the first half and moves to the other level during thesecond 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

Page 36: Line coding

Manchester Signalling

Figure. Manchester Encoding.

1 0 1 0 1 1 1 1 1 0

+V

-V

0

Note: There is always a transition atthe centre of bit duration.

Page 37: Line coding

Manchester SignallingPSD of Manchester Signalling:

Figure. PSD of Manchester

Page 38: Line coding

Manchester SignallingThe transition at the centre of every bit interval is used for synchronization at thereceiver.

Manchester encoding is called self-synchronizing. Synchronization at the receiving endcan 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 signalcannot be used for synchronization in Manchester encoding. This is because the PSD ofManchester encoding does not include a spectral line/ impulse at symbol rate (1/To).Even rectification does not help.

Page 39: Line coding

Manchester SignallingManchester 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 largebandwidth.– 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.

Page 40: Line coding

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(differentialencoding)

1 0 1 0 1 1 0 01

DifferentialManchester

encoding

LAN codes –Manchester,differential Manchester.mB/nB

Page 41: Line coding

Differential Manchester coding

Each digit in an differential encoded sequence is obtained by comparing thepresent input bit with the past encoded bit. A binary 1 is encoded if the presentinput bit and past encoded bit are of opposite state. A binary 0 is encoded if thestates are the same. d(k)=m(k)⊕d(k-1)

Page 42: Line coding

Line coding examples

NRZ-inverted(differentialencoding)

1 0 1 0 1 1 0 01

UnipolarNRZ

Bipolarencoding

Manchesterencoding

DifferentialManchester

encoding

Polar NRZ

Page 43: Line coding

Comparative study of line codes:

• 1. UPNRZ and UPRZ are unipolar codes and need only single sidedpower supply to generate them. Whereas PNRZ, PRZ, AMI andManchester need double sided power supply.

• 2. AMI receiver needs to detect 3 levels. All other codes need todetect 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 andAMI do not have this benefit. A long sequence of ‘0’ may be mistakenas failure of transmission.

• 4. AMI has a built in error detecting capability since any ‘0’ beingconverted to ‘1’ or vice versa will violate the code.

Page 44: Line coding

PSD of line codes:

Page 45: Line coding

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 thesynchronizing 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 beextracted.

Page 46: Line coding

Reference Text Books1. “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