Communication and Networks Assignment

profileTubekbay001
0_Lesson8SignalEncoding.pptx

Communications and Networks

version 1.0

Diploma in Information Technology

Copyright © 2020 by Singapore Institute of Management Pte Ltd. All rights reserved.

Lesson 8: Signal Encoding

1

Lesson 8 Learning Outcomes

Define analogue bandwidth

Describe how information can be represented as digital signal

Define baud and bit rate

Describe how signals are synchronised

Define line coding

Describe Manchester encoding

Define lossy and lossless data compression

2

Lesson 8 Outline

Analog Signal Bandwidth

Digital Signal Bandwidth

Converting Analog to Digital Signal

Data Compression

3

The Electromagnetic Spectrum

Source: https://www.youtube.com/watch?v=cfXzwh3KadE

4

Analog Bandwidth

In networking and communication, the definition of bandwidth varies

Bandwidth: difference between highest and lowest frequencies of the constituent parts

Obtained by Fourier analysis

Known as analog bandwidth

OR bandwidth of an analog signal

5

Analog Bandwidth Example

Consider the frequency domain plot below

audible frequencies to humans

Bandwidth = 5 KHz - 1 KHz = 4 KHz

Source: Douglas, C (2016) Computer Networks and Internets

6

Digital Signals

Some systems use voltage to represent digital values

positive voltage correspond to logical one

zero voltage correspond to logical zero

Example

+5 volts can be used for a logical one

0 volts for a logical zero

7

Two Signal Levels

If only two levels of voltage are used

each level corresponds to one data bit (0 or 1)

Some physical transmission mechanisms can support more than two signal levels

When multiple digital levels are available each level can represent multiple bits

8

Four Signal Levels

Consider a system that uses four levels of voltage:

-5 volts, -2 volts, +2 volts, +5 volts

Each level can correspond to two bits of data

Source: Douglas, C (2016) Computer Networks and Internets

Digital Signal, Two levels

Digital Signal, Four levels

9

Number of Levels Required

Relationship between number of levels required and the number of bits to be sent is straightforward

There must be a signal level for each possible combination of bits

There are 2n combinations possible with n bits

Communication system must use 2n levels to represent n bits

10

Determining Number of Levels

Numbers of levels can be determined by dividing voltage into small increments

Millions of levels between 0 and 1 volts

0.0000001 volts for one level, 0.0000002 for the next level etc.

However, in real world, systems cannot distinguish between signals that differ by small amounts

They are restricted to a few signal levels

11

Practice 8.1

Suppose a system sent the following voltage:

+5, -1, +1, -5, +1, -1, +5, +2, -2, +3, -3

How many bits are sent by this system?

2. Suppose a system need to represent 4 bits, how many number of levels should it have?

12

Bits Per Second

How much data can be sent in each time depends on two aspects

Number of signal levels

Amount of time the system remains at a given level before moving to the next

2)

1)

Source: Douglas, C (2016) Computer Networks and Internets

13

Increasing Bits Per Second

If the communication system is modified to use half as much time for a given bit

Twice as many bits will be sent in the same amount of time

Source: Douglas, C (2016) Computer Networks and Internets

1

1

1

1

14

Limitation on Hardware

As with signal levels, hardware in real-world system places limits on how short the time can be

If signal does not remain at a given level long enough, the receiving hardware will fail to detect it

15

Baud Rate

Baud: how many times the signal can change per second

If a system requires signal to remain at a given level for .001 seconds, it operates at 1000 baud

Both baud and number of signal levels affects bit rate

16

Baud and Bits Per Second

System with two signal levels operates at 1000 baud

can transfer 1000 bits per second

System with four signal levels operates at 1000 baud

can transfer 2000 bits per second (as four signal levels can represent two bits)

Source: Douglas, C (2016) Computer Networks and Internets

17

Practice 8.2

Suppose a system with eight levels with 2000 baud, how many bits per second can the system transfer?

Suppose a system with four levels with 500 baud, how many bits per second can the system transfer?

Suppose a system with two levels with 1000 baud, how many bits per second can the system transfer?

18

Converting Digital to Analog

According to Fourier, any curve can be represented as a composite of sine waves

where each sine wave has specific amplitude, frequency, and phase

Fourier's theorem also applies to a digital signal

However, accurate representation of a digital signal requires infinite set of sine waves

19

Engineer Approach

Engineers adopt a compromise:

conversion of a signal from digital to analog is approximate

generate analog waves that closely approximate the digital signal

approximation involves building a composite signal from only a few sine waves

20

Approximating Digital Signal

Source: Douglas, C (2016) Computer Networks and Internets

21

Lesson 8 Outline

Analog Signal Bandwidth

Digital Signal Bandwidth

Converting Analog to Digital Signal

Data Compression

22

Bandwidth of Digital Signal

Suppose Fourier analysis is applied to a square wave

such as the digital signal illustrated before

A digital signal has infinite bandwidth

as Fourier analysis of a digital signal produces an infinite set of sine waves with frequencies that grow to infinity

23

Synchronised Communication

Electronics at both ends of a physical medium must have circuitry to measure time precisely

if one transmits a signal with 10 elements per second,

Receiver must expect 10 elements per second

At slow speeds, making both ends agree is easy

24

Synchronisation Difficulty

Building electronic systems that synchronise at high speeds is extremely difficult

Problem is how data is represented which will affect synchronisation of sender/receiver

Suppose receiver misses first bit that arrives and starts interpreting data starting at the second bit

Mismatch in interpretation can produce errors

25

Synchronisation Errors

Source: Douglas, C (2016) Computer Networks and Internets

Synchronisation error where receiver allows slightly less time per bit than sender

26

Avoiding Synchronisation Errors

Several techniques have been invented to avoid synchronization errors

Signal agreement: sender transmits a known pattern of bits for receiver to synchronize

typically a set of alternating 0s and 1s,

Avoid ambiguity: Data is represented in a way that there can be no confusion about the meaning

27

Line Coding

Line coding: the way data is encoded in a signal

Eliminates ambiguity

Consider a transmission mechanism that supports three signal levels

Source: Douglas, C (2016) Computer Networks and Internets

three signal levels

two bits

28

Line Coding Efficiency Issues

Using multiple signal elements to represent a single bit means fewer bits can be transmitted per unit time

Designers prefer schemes that transmit multiple bits per signal element

Source: Douglas, C (2016) Computer Networks and Internets

29

Line Coding Variety

Line coding choice depends on the specific needs of a given system

A variety of line coding techniques are available that differ in

How they handle synchronization

Other properties like the bandwidth used

30

Line Coding Types

Source: Douglas, C (2016) Computer Networks and Internets

31

Detecting Signal Transition

One important line coding:

The Manchester Encoding used in Ethernet

Detecting a transition in signal level is easier than measuring the signal level

32

Manchester Encoding

Manchester Encoding uses transitions rather than levels to define bits

1 corresponds to a transition from negative voltage level to positive voltage level

0 corresponds to a transition from a positive voltage level to a negative level

Transitions occur in the “middle” of the time slot of a bit

33

Visualising Manchester Encoding

Differential Manchester Encoding

Manchester Encoding

Source: Douglas, C (2016) Computer Networks and Internets

34

Practice 8.3

State the sequence of bits for the following Manchester Encoding.

35

Differential Manchester in 2mins

Source: https://www.youtube.com/watch?v=du_boiwX1yU

36

Differential Manchester Encoding

Differential Manchester Encoding (or Conditional DePhase Encoding) uses relative transitions rather than absolute

representation of a bit depends on previous bit

Each bit time slot contains one or two transitions

transition always occurs in middle of the bit time

37

Differential Manchester Process

Bit is represented by presence or absence of a transition at the beginning of a bit time:

logical 0 is represented by a transition

logical 1 is represented by no transition

Important property from a practical consideration:

encoding works correctly even if the two wires carrying the signal are accidentally reversed

38

Lesson 8 Outline

Analog Signal Bandwidth

Digital Signal Bandwidth

Converting Analog to Digital Signal

Data Compression

39

Converting Analog to Digital

Many sources of information are analog which means they must be converted to digital form

further processing such as before they can be encrypted

There are two basic approaches:

Pulse Code Modulation (PCM)

Delta Modulation (DM)

40

Pulse Code Modulation

In PCM, level of an analog signal is measured repeatedly at fixed time intervals (sampling) and converted to digital form

Source: Douglas, C (2016) Computer Networks and Internets

41

PCM Steps

Sampling: each measurement is known as a sample

A sample is quantised by converting it into a small integer value

quantized value is not a measure of voltage or any other property of the signal

range of the signal from minimum to maximum levels is divided into a set of slots (in power of 2)

Encoded into a specific format

42

Visualising Sample Quantisation

Source: Douglas, C (2016) Computer Networks and Internets

43

PCM Samples & Quantisation

Six samples are represented by vertical gray lines

each sample is quantized by choosing the closest quantum interval

Example, the third sample, taken near the peak of the curve, is assigned a quantized value of 6

44

Avoiding Inaccuracy

In practice, slight variations in sampling have been invented

To avoid inaccuracy caused by a brief spike or dip in the signal, averaging can be used

instead of relying on single measurement for each sample

Averaging: mean of three measurements taken close together is computed

45

Delta Modulation

Delta modulation (DM) takes samples like PCM

But does not do quantization for each sample

DM sends one quantization value followed by a string of values that give difference between the previous value and current value

46

DM vs PCM

Transmitting differences requires fewer bits than sending full values

Especially when signal does not vary rapidly

Main issue with DM is the effect of an error

if any item in sequence is lost or damaged, subsequent values will be misinterpreted

Communication systems that expect lost or changes during transmission usually use PCM

47

Sampling Rate

Undersampling: taking too few samples

Gives crude approximation of the original signal

Oversampling: taking too many samples

more digital data will be generated which uses extra bandwidth

48

Nyquist Theorem

Mathematician named Nyquist discovered the answer to how much sampling is required

Nyquist Theorem provides a practical solution to the problem

sample a signal at least twice as fast as the highest frequency that must be preserved

fmax is the highest frequency in the composite signal

Source: Douglas, C (2016) Computer Networks and Internets

49

Lesson 8 Outline

Analog Signal Bandwidth

Digital Signal Bandwidth

Converting Analog to Digital Signal

Data Compression

50

Data Compression

Data compression: technique that reduces the number of bits required to represent data

Data compression is useful for communication system:

Reduce number of bits used to represent data reduces the time required for transmission

Communication system can be optimised by compressing data

51

Lossy Data Compression

Lossy: some information is lost during compression

generally for data that human consumes, like image and video/audio

Only need to preserve details to level of human perception

change is acceptable if humans cannot detect the change

JPEG (JPG) for images or MPEG-3 (MP3) for audio recordings employ lossy compression

52

Lossless Data Compression

Lossless: all information is retained in the compressed version

Can be used for documents or in any situation where data must be preserved exactly

For communication, sender compresses data before transmission and receiver decompresses the result

arbitrary data can be compressed by a sender and decompressed by a receiver to recover an exact copy of the original

GIF is lossless

53

Practice 8.4

Differentiate between lossy and lossless data compression. Give an example for each.

54

Reading

Douglas, C. (2016). Computer Networks and Internets, Global Edition (6th ed.). Pearson Education. ISBN: 978-1292061177 Chapter 6

55

End of Lesson

56