Encoding Techniques Lecture 19 Overview n n n

  • Slides: 65
Download presentation
Encoding Techniques Lecture 19

Encoding Techniques Lecture 19

Overview n n n n n Data Representation Signaling Encoding Techniques Digital Data, Digital

Overview n n n n n Data Representation Signaling Encoding Techniques Digital Data, Digital Signals (Line Coding) Advantages of Digital Transmission Disadvantages of Digital Transmission Signal Elements Vs. Data Elements Data Rate Vs. Signal Rate (Bit Rate Vs. Baud Rate/Pulse Rate/Modulation Rate) Unipolar Encoding n Polar Encoding and its Types n n n Bi. Phase Encoding n n n n Manchester and Diff Manchester Bipolar Encoding n n NRZ-L NRZ-I RZ Alternate Mark Inversion Multirate 2 B 1 Q Multirate 8 B 6 T 4 D-PAM 5 Multitransition MLT-3 Block Coding 4 B/5 B 2

Introduction n The user data can be in one of two formats: n n

Introduction n The user data can be in one of two formats: n n n The transmitted signals, representing the data, can also be in one of two formats: n n Analog: Human voice as converted by typical home telephones Digital: Computer files Analog or Digital The conversion of the user data into a transmission signal is called Encoding. 3

Encoding Techniques n In data communications, the user data must be put in a

Encoding Techniques n In data communications, the user data must be put in a format (signal) suitable for the transmission media (nature, quality, length, etc. ) 4

Encoding: Data-Signal Conversion n There are four possible cases: n n Digital data, digital

Encoding: Data-Signal Conversion n There are four possible cases: n n Digital data, digital signals: We use Line Coding. Less complex and less expensive. Analog data, digital signals: We use A/D conversion for voice and video. Digital data, analog signals: We use Digital Modulation for optical fiber and unguided media. Analog data, analog signals: We use Analog Modulation to transmit baseband signal easily and cheaply. 5

Digital Data, Digital Signal n digital signal n n n discrete, discontinuous voltage pulses

Digital Data, Digital Signal n digital signal n n n discrete, discontinuous voltage pulses each pulse is a signal element binary data encoded into signal elements 6

Advantages of Digital Transmission n Digital technology n n Data integrity n n n

Advantages of Digital Transmission n Digital technology n n Data integrity n n n High bandwidth links economical High degree of multiplexing easier with digital techniques Security & Privacy n n Longer distances over lower quality lines Capacity utilization n n Low cost LSI/VLSI technology Encryption Integration n Can treat analog and digital data similarly 7

Disadvantages of Digital Signals n n greater attenuation digital now preferred choice 8

Disadvantages of Digital Signals n n greater attenuation digital now preferred choice 8

DIGITAL-TO-DIGITAL CONVERSION n how we can represent digital data by using digital signals. The

DIGITAL-TO-DIGITAL CONVERSION n how we can represent digital data by using digital signals. The conversion involves three techniques: • Line coding • Block coding • Scrambling. n Line coding is always needed; block coding and scrambling may or may not be needed. 9

Line coding is the process of converting digital data to digital signals. We assume

Line coding is the process of converting digital data to digital signals. We assume that data, in the form of text, numbers, graphical images, audio, or video, are stored in computer memory as sequences of bits. Line coding and decoding Signal Element Versus Data Element In data communications, our goal is to send data elements. A data element is the smallest entity that can represent a piece of information: this is the bit. In digital data communications, a signal element carries data elements. A signal element is the shortest unit (timewise) of a digital signal. In other words, data elements are what we need to send; signal elements are what we can send. Data elements are being carried; signal elements are the carriers. 10

We define a ratio r which is the number of data elements carried by

We define a ratio r which is the number of data elements carried by each signal element. Figure 4. 2 shows several situations with different values of r. Signal element versus data element Data Rate Versus Signal Rate The data rate defines the number of data elements (bits) sent in is. The unit is bits per second (bps). The signal rate is the number of signal elements sent in Is. The unit is the baud. The data rate is sometimes called the bit rate; the signal rate is sometimes called the pulse rate, the modulation rate, or the baud rate. 11

We now need to consider the relationship between data rate and signal rate (bit

We now need to consider the relationship between data rate and signal rate (bit rate and baud rate). This relationship, of course, depends on the value of r. It also depends on the data pattern C. If we have a data pattern of all 1 s or all Os, the signal rate may be different from a data pattern of alternating Os and 1 s. where N is data rate c is the case factor (worst, best & avg. ) r is the ratio between data element & signal element Example A signal is carrying data in which one data element is encoded as one signal element ( r = 1). If the bit rate is 100 kbps, what is the average value of the baud rate if c is between 0 and 1? Solution We assume that the average value of c is 1/2. The baud rate is then 12

Although the actual bandwidth of a digital signal is infinite, the effective bandwidth is

Although the actual bandwidth of a digital signal is infinite, the effective bandwidth is finite. we can say that the bandwidth (range of frequencies) is proportional to the signal rate (baud rate). The minimum bandwidth can be given as We can solve for the maximum data rate if the bandwidth of the channel is given. 13

Baseline Wandering In decoding a digital signal, the receiver calculates a running average of

Baseline Wandering In decoding a digital signal, the receiver calculates a running average of the received signal power. This average is called the baseline. The incoming signal power is evaluated against this baseline to determine the value of the data element. A long string of Os or 1 s can cause a drift in the baseline (baseline wandering) and make it difficult for the receiver to decode correctly. A good line coding scheme needs to prevent baseline wandering. DC Components When the voltage level in a digital signal is constant for a while, the spectrum creates very low frequencies. These frequencies around zero, called DC (direct-current) components, present problems for a system that cannot pass low frequencies or a system that uses electrical coupling (via a transformer). For example, a telephone line cannot pass frequencies below 200 Hz. Also a longdistance link may use one or more transformers to isolate different parts of the line electrically. For these systems, we need a scheme with no DC component. Self-synchronization To correctly interpret the signals received from the sender, the receiver's bit intervals must correspond exactly to the sender's bit intervals. If the receiver clock is faster or slower, the bit intervals are not matched and the receiver might misinterpret the signals. 14

Effect of lack of synchronization A self-synchronizing digital signal includes timing information in the

Effect of lack of synchronization A self-synchronizing digital signal includes timing information in the data being transmitted. This can be achieved if there are transitions in the signal that alert the receiver to the beginning, middle, or end of the pulse. If the receiver' s clock is out of synchronization, these points can reset the clock. 15

Example In a digital transmission, the receiver clock is 0. 1 percent faster than

Example In a digital transmission, the receiver clock is 0. 1 percent faster than the sender clock. How many extra bits per second does the receiver receive if the data rate is 1 kbps? How many if the data rate is 1 Mbps? Solution At 1 kbps, the receiver receives 1001 bps instead of 1000 bps. At 1 Mbps, the receiver receives 1, 000 bps instead of 1, 000 bps. 16

Terminology n n n unipolar – all signal elements have the same sign polar

Terminology n n n unipolar – all signal elements have the same sign polar – one logic state represented by positive voltage and the other by negative voltage data rate – rate of data ( R ) transmission in bits per second duration or length of a bit – time taken for transmitter to emit the bit (1/R) modulation rate – rate at which the signal level changes, measured in baud = signal elements per second. mark and space – binary 1 and binary 0 17

Unipolar Encoding n Unipolar uses only one signal level (one polarity) n n n

Unipolar Encoding n Unipolar uses only one signal level (one polarity) n n n Unipolar encoding is easy to implement. However: n n n High voltage is binary “ 1” No voltage is binary “ 0” Not self-synchronized Has a DC component Compared with its polar counterpart, this scheme is very costly. The normalized power (power needed to send 1 bit per unit line resistance) is double that for polar NRZ. For this reason, this scheme is normally not used in data communications today. 18

Unipolar Encoding n Unipolar uses only one signal level (one polarity) n n n

Unipolar Encoding n Unipolar uses only one signal level (one polarity) n n n Unipolar encoding is easy to implement. However: n n n High voltage is binary “ 1” No voltage is binary “ 0” Not self-synchronized Has a DC component Compared with its polar counterpart, this scheme is very costly. The normalized power (power needed to send 1 bit per unit line resistance) is double that for polar NRZ. For this reason, this scheme is normally not used in data communications today. 19

Types of Polar Encoding n Polar encoding uses two signal levels n Positive &

Types of Polar Encoding n Polar encoding uses two signal levels n Positive & Negative Polarities 20

Non-Return to Zero (NRZ) Encoding n n n NRZ encoding can be of two

Non-Return to Zero (NRZ) Encoding n n n NRZ encoding can be of two types: NRZ-Level (NRZ-L) n “ 0” is encoded with one polarity, say “+5 V” n “ 1” is encoded with another polarity, say “-5 V” NRZ-Invert (NRZ-I) n “ 0” is encoded with no change in polarity from previous bit n “ 1” is encoded with a change in polarity from previous bit NRZ-I provides better synchronization than NRZL if “ 1” bits exist in data stream A stream of many “ 0” can still cause synch. problems 21

NRZ-L and NRZ-I Encoding 22

NRZ-L and NRZ-I Encoding 22

NRS Pros and Cons n Pros n n n Cons n n Easy to

NRS Pros and Cons n Pros n n n Cons n n Easy to engineer Make good use of bandwidth dc component Lack of synchronization capability Used for magnetic recording Not often used for signal transmission 23

Return to Zero (RZ) Encoding n n n We have seen that: n NRZ-L

Return to Zero (RZ) Encoding n n n We have seen that: n NRZ-L has poor synch. Performance n NRZ-I has better synch. for streams of “ 1” but faces the same problem for streams of “ 0” RZ encoding overcomes this synch. issue by using three voltage levels: Positive, Negative and Zero n “ 1” is encoded as: (“+V”, Transition “+V ↓ 0 V”) n “ 0” is encoded as: (“ −V”, Transition “−V ↑ 0 V”) RZ is less spectrally efficient than NRZ because it has more transitions i. e. higher freq. components. 24

RZ Encoding 25

RZ Encoding 25

Types of Polar Encoding n Polar encoding uses two signal levels n Positive &

Types of Polar Encoding n Polar encoding uses two signal levels n Positive & Negative Polarities 26

Manchester Encoding Manchester uses a polarity inversion in the middle of each bit period

Manchester Encoding Manchester uses a polarity inversion in the middle of each bit period n n n Low to high represents one High to low represents zero This transition is used for bit representation as well as synch. purposes. n Manchester achieves the same level of synch. as RZ but with two voltage levels only n 27

Diff. Manchester Encoding n Polarity inversion in the middle of each bit period (Tb)

Diff. Manchester Encoding n Polarity inversion in the middle of each bit period (Tb) is used for synch. only n n n Transition at start of a bit period represents zero No transition at start of a bit period represents one Diff. Manchester requires two signal changes to represent “ 0” and one signal change to represent “ 1” 28

Manchester and Diff. Manchester Encoding 29

Manchester and Diff. Manchester Encoding 29

Manchester vs. Diff. Manchester n n n Both Manchester and Diff. Manchester encoding rely

Manchester vs. Diff. Manchester n n n Both Manchester and Diff. Manchester encoding rely on signal transition to encode data Both have better performance in the presence of noise than any encoding scheme that relies on the absolute voltage level to encode data However, it is easy to lose sense of the polarity of a signal in a complex transmission layout 30

Biphase Pros and Cons n Con n n At least one transition per bit

Biphase Pros and Cons n Con n n At least one transition per bit time and possibly two Maximum modulation rate is twice NRZ Requires more bandwidth Pros n n n Synchronization on mid bit transition (self clocking) No dc component Error detection 31

Bipolar Encoding n n Bipolar encoding uses three voltage levels: Positive, Negative and Zero

Bipolar Encoding n n Bipolar encoding uses three voltage levels: Positive, Negative and Zero n “ 0” is encoded as: (“ 0 V”) n “ 1” is encoded by alternating between (“+V”) and (“−V”) If the first “ 1” is encoded as (“+V”) then the next “ 1” is encoded as (“−V”), and so on. This alternation occurs in the case whether these “ 1”s are consecutive or not Types of Bipolar Encoding n Alternate Mark Inversion (AMI) n Bipolar n-Zero Substitution (Bn. ZS) n High Density Bipolar 3 -Zero (HDB 3) 32

Alternate Mark Inversion (AMI) n n n “Mark” means “ 1” in telegraphy AMI

Alternate Mark Inversion (AMI) n n n “Mark” means “ 1” in telegraphy AMI means Alternate “ 1” Inversion AMI alternates the voltage polarity for successive “ 1” bits “ 0” bits will be represented by “ 0 V” AMI lacks self-synchronization for long streams of “ 0” AMI encoding has no DC component 33

Bipolar AMI Encoding Example 34

Bipolar AMI Encoding Example 34

In bipolar encoding (sometimes called multilevel binary), we use three levels: positive, zero, and

In bipolar encoding (sometimes called multilevel binary), we use three levels: positive, zero, and negative. Bipolar schemes: AMI and pseudoternary The bipolar scheme was developed as an alternative to NRZ. The bipolar scheme has the same signal rate as NRZ, but there is no DC component. The NRZ scheme has most of its energy concentrated near zero frequency, which makes it unsuitable for transmission over channels with poor performance around this frequency. The concentration of the energy in bipolar encoding is around frequency N/2. 35

(two binary, one quaternary). uses data patterns of size 2 and encodes the 2

(two binary, one quaternary). uses data patterns of size 2 and encodes the 2 -bit patterns as one signal element belonging to a fourlevel signal. Multilevel: 2 B 1 Q scheme Using 2 B 1 Q, we can send data 2 times faster than by using NRZ-L. However, 2 B 1 Q uses four different signal levels, which means the receiver has to discern four different thresholds. 36

Multilevel: 8 B 6 T scheme eight binary, six ternary The idea is to

Multilevel: 8 B 6 T scheme eight binary, six ternary The idea is to encode a pattern of 8 bits as a pattern of 6 signal elements, where the signal has three levels (ternary). In this type of scheme, we can have 28 = 256 different data patterns and 36 = 478 different signal patterns. The mapping table is shown in Appendix D. There are 478 - 256 = 222 redundant signal elements that provide synchronization and error detection. Part of the redundancy is also used to provide DC balance. Each signal pattern has a weight of 0 or +1 DC values. This means that there is no pattern with the weight -1. To make the whole stream DC-balanced, the sender keeps track of the weight. The minimum bandwidth is very close to 6 N/8. 37

4 D-PAM 5 is called four dimensional five-level pulse amplitude modulation. The 4 D

4 D-PAM 5 is called four dimensional five-level pulse amplitude modulation. The 4 D means that data is sent over four wires at the same time. It uses five voltage levels, such as -2, -1, 0, 1, and 2. However, one level, level 0, is used only forward error detection. The technique is designed to send data over four channels (four wires). 38

Multitransition: MLT-3 scheme 1. If the next bit is 0, there is no transition.

Multitransition: MLT-3 scheme 1. If the next bit is 0, there is no transition. 2. If the next bit is 1 and the current level is not 0, the next level is 0. 3. If the next bit is 1 and the current level is 0, the next level is the opposite of the last nonzero level. The signal rate is the same as that for NRZ-I, but with greater complexity (three levels and complex transition rules). It turns out that the shape of the signal in this scheme helps to reduce the required bandwidth. 39

Summary of line coding schemes 40

Summary of line coding schemes 40

DIGITAL-TO-DIGITAL CONVERSION n In this section, we see how we can represent digital data

DIGITAL-TO-DIGITAL CONVERSION n In this section, we see how we can represent digital data by using digital signals. The conversion involves three techniques: • Line coding • Block coding • Scrambling. n Line coding is always needed; block coding and scrambling may or may not be needed. 41

Block Coding Block coding can ensure synchronization, provide error detection and improve the performance

Block Coding Block coding can ensure synchronization, provide error detection and improve the performance of line coding. In general, block coding changes a block of m bits into a block of n bits, where n is larger than m. Block coding is normally referred to as m. B/n. B coding; it replaces each m-bit group with an n-bit group. 42

Block Coding n Block coding normally involves three steps: • Division : In the

Block Coding n Block coding normally involves three steps: • Division : In the division step, a sequence of bits is divided into groups of m bits. For example, in 4 B/5 B encoding, the original bit sequence is divided into 4 -bit groups. • • Substitution: In substitution step, we substitute an m-bit group for an nbit group. For example, in 4 B/5 B encoding we substitute a 4 -bit code for a 5 -bit group. Combination: The n-bit groups are combined together to form a stream. The new stream has more bits than the original bits. 43

4 B/5 B mapping codes 44

4 B/5 B mapping codes 44

Substitution in 4 B/5 B block coding 45

Substitution in 4 B/5 B block coding 45

AMI used with scrambling • • • Bipolar AMI encoding, has a narrow bandwidth

AMI used with scrambling • • • Bipolar AMI encoding, has a narrow bandwidth and does not create a DC component. However, a long sequence of Os upsets the synchronization. If we can find a way to avoid a long sequence of Os in the original stream, we can use bipolar AMI for long distances. To provide synchronization but not increasing the number of bits, a solution is to substitutes long zero-level pulses with a combination of other levels to provide synchronization is called scrambling. Note that scrambling, as opposed to block coding, is done at the same time as encoding. The system needs to insert the required pulses based on the defined scrambling rules. Two common scrambling techniques are B 8 ZS and HDB 3. 46

Example We need to send data at a 1 -Mbps rate. What is the

Example We need to send data at a 1 -Mbps rate. What is the minimum required bandwidth, using a combination of 4 B/5 B and NRZ-I or Manchester coding? Sol: First 4 B/5 B block coding increases the bit rate to 1. 25 Mbps. The minimum bandwidth using NRZ-I is N/2 or 625 k. Hz. The Manchester scheme needs a minimum bandwidth of 1. 25 MHz. The first choice needs a lower bandwidth, but has a DC component problem; the second choice needs a higher bandwidth, but does not have a DC component problem. 47

8 B/10 B block encoding 48

8 B/10 B block encoding 48

More bits - better error detection n The 8 B 10 B block code

More bits - better error detection n The 8 B 10 B block code adds more redundant bits and can thereby choose code words that would prevent a long run of a voltage level that would cause DC components. 49

Scrambling n n The best code is one that does not increase the bandwidth

Scrambling n n The best code is one that does not increase the bandwidth for synchronization and has no DC components. Scrambling is a technique used to create a sequence of bits that has the required c/c’s for transmission - self clocking, no low frequencies, no wide bandwidth. It is implemented at the same time as encoding, the bit stream is created on the fly. It replaces ‘unfriendly’ runs of bits with a violation code that is easy to recognize and removes the unfriendly c/c. 50

Two cases of B 8 ZS scrambling technique • B 8 ZS substitutes eight

Two cases of B 8 ZS scrambling technique • B 8 ZS substitutes eight consecutive zeros with 000 VB 0 VB. • HDB 3 substitutes four consecutive zeros with 000 V or B 00 V depending on the number of nonzero pulses after the last substitution. 51

B 8 ZS substitutes eight consecutive zeros with 000 VB 0 VB. 52

B 8 ZS substitutes eight consecutive zeros with 000 VB 0 VB. 52

Different situations in HDB 3 scrambling technique 53

Different situations in HDB 3 scrambling technique 53

HDB 3 substitutes four consecutive zeros with 000 V or B 00 V depending

HDB 3 substitutes four consecutive zeros with 000 V or B 00 V depending on the number of nonzero pulses after the last substitution. 54

55

55

Summary n n n n n Data Representation Signaling Encoding Techniques Digital Data Digital

Summary n n n n n Data Representation Signaling Encoding Techniques Digital Data Digital Signals (Line Coding) Advantages of Digital Transmission Disadvantages of Digital Transmission Signal Elements Vs. Data Elements Data Rate Vs. Signal Rate (Bit Rate Vs. Baud Rate/Pulse Rate/Modulation Rate) Unipolar Encoding n Polar Encoding and its Types n n n Bi. Phase Encoding n n n n Manchester and Diff Manchester Bipolar Encoding n n NRZ-L NRZ-I RZ Alternate Mark Inversion Multirate 2 B 1 Q Multirate 8 B 6 T 4 D-PAM 5 Multitransition MLT-3 Block Coding 4 B/5 B 56

57

57

58

58

Key Data Transmission Terms 59

Key Data Transmission Terms 59

Interpreting Signals need to know: • timing of bits - when they start and

Interpreting Signals need to know: • timing of bits - when they start and end • signal levels factors affecting signal interpretation: • signal to noise ratio • data rate • bandwidth • encoding scheme 60

Digital Signal Encoding Formats 61

Digital Signal Encoding Formats 61

Encoding Schemes 62

Encoding Schemes 62

Manchester Encoding n n n transition in middle of each bit period midbit transition

Manchester Encoding n n n transition in middle of each bit period midbit transition serves as clock and data low to high transition represents a 1 high to low transition represents a 0 used by IEEE 802. 3 63

Differential Manchester Encoding n n n midbit transition is only used for clocking transition

Differential Manchester Encoding n n n midbit transition is only used for clocking transition at start of bit period representing 0 no transition at start of bit period representing 1 n n this is a differential encoding scheme used by IEEE 802. 5 64

Summary n Signal encoding techniques n digital data, digital signal n n analog data,

Summary n Signal encoding techniques n digital data, digital signal n n analog data, digital signal n n PCM, DM digital data, analog signal n n NRZ, multilevel binary, biphase, modulation rate ASK, FSK, BFSK, PSK analog data, analog signal n AM, FM, PM 65