29
Instructor: Dr. Marvin Mandelbaum Department of Computer Science York University Section A F05 Topics: 1. Digital Information 2. Digital Communications versus Analogue Communications 3. Channel Capacity: Nyquist and Shannon Bounds. 4. Time and Frequency Domain Representations of Signals Garcia: Sections 3.1 – 3.5 COSC 3213: Computer Networks I Chapter 3

COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

Instructor: Dr. Marvin MandelbaumDepartment of Computer Science

York UniversitySection A F05

Topics:1. Digital Information 2. Digital Communications versus Analogue Communications3. Channel Capacity: Nyquist and Shannon Bounds.4. Time and Frequency Domain Representations of Signals

Garcia: Sections 3.1 – 3.5

COSC 3213: Computer Networks IChapter 3

Page 2: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

2

Digital Information

1. Physical layer lowest layer in OSI.2. The transfer of raw bits3. Focus for the next few lectures.4. Communication systems can be classified in two categories:

a. Analogue Communication System dealing with analogue signalsAnalogue signals are defined for the entire duration and can have any value.

b. Digital Communication System dealing with digital signalsDigital signals are defined at fixed instants and can only have one of the pre-selected set of values.

5. Information can be classified in two categories:1. Block-oriented information usually arranged nicely in contiguous blocks. Includes

data files, BW documents, and images2. Stream information usually arising from a natural process such as audio and video.

Page 3: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

3

Block Oriented Information (1)

Color images

Scanned B&W documents

Text Files

InformationType

8 x 10 inch photo scanned @ 400 pixels / in

A4 (8.5 x 11 in) page @ 200 x 100 pixels / inch + overhead

ASCII

Format

38.4 Mbytes

256 Kbytes

Kbytes to Mbytes

Raw Data Size

1.2 – 8 Mbytes(5 – 30)

15–54 KB (1D)5 – 35 KB

(2D)(5 – 50)

(2 – 6)

Compressed Data Size

(CR)

Image storage or transmission

JPEG standard

Storage,Fax Transmission

CCITT Group 3 fax standard

Disk Storage, Modem transmission

Lossless Compression such as Dictionary or Arithmetic codes. Compress, Zip, and variations

ApplicationsData Compression

Activity 1: Show that the raw data size of the color image (last row entry) is indeed 38.4Mbytes/s?

Page 4: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

4

Block Oriented Information (2)

1. Data compression exploit data redundancy to encode information in a fewer number of bytes.

2. Compression ratio (CR) is the ratio between the size of raw data to the size of the compressed data.

3. Why Data Compression?Transmission time of Color image (raw) on V.90 modem = 12 minutesTransmission time of JPEG encoded Color image on V.90 modem = 24 seconds

4. Data Compression schemes can be classified in two categories:a. Lossless Compression: No loss of information but compression ratio limited.b. Lossy Compression: Controlled loss of information for higher compression.

5. Shannon's Source encoding theorem: Bound of lossless compression is provided bythe minimum size of compressed data without loss of information equals the entropy of the source generating the data.

Arranged nicely in contiguous blocks. Includes data files, BW documents, and images

Page 5: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

5

Streamed Information

HDTV19 – 38 MbpsISO MPEG 21.6 Gbps1920×1020 pels/frame @ 30 fps

NTSC TV, DVD2 – 6 MbpsISO MPEG 2249 Mbps720×480 pels/frame @ 30 fps

Video conferencing

64 kbps – 1.544 MbpsITU H.261 coding 2 – 36.5 Mbps

QCIF (176 x 144) or CIF (352 x 288)@ 10 - 30 fps

Video

MPEG audio32 – 384 kbpsMPEG MP3 512-748 kbps16 – 24 kHz audioAudio

Voice

InformationType

4 kHz voice

Format

64 kbps

Raw Data Size

8 - 16 kbps

16 - 32 kbps

64 kbps

Compressed Data Size

Cellular TelephonyLinear Prediction

Voice mail, TelephonyADPCM

Digital telephonyPCM

ApplicationsData Compression

Activity 2: Show that the raw data size of HDTV (last row entry) is indeed 1.6Gbps?

Page 6: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

6

Why Digital Communications (1)?

Digital Communications results in an improved Signal to Noise ratio (SNR) as compared to analogue communications.

Analogue ChannelTransmitter Receiver

Signal Tx Signal Rx

Attenuates and introduces distortion

Repeater

Equalizer Amp.Equalized Signal

Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions.Attenuation must be compacted so that the received signal: (1) is strong enough for the receiverto detect the signal; and (2) maintains a level sufficiently higher than noise for correct bit detection.

Example of an Analogue Communication System:

Page 7: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

7

Why Digital Communications (2)?

Signal is recovered perfectly even when attenuation and distortions are introduced.

Digital ChannelTransmitter ReceiverAttenuates and introduces distortion

AmplifierEqualizer

TimingRecovery

Decision Circuit & Signal Regenerator

Repeater

Example of a Digital Communication System:

Page 8: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

8

Analog Signals

1. Analog signals are classified in two categories:a. Periodic Signals: that repeat themselvesb. Aperiodic or nonperiodic signals: that do not repeat themselves.

Periodic Signal with Period = TT

Sample waveform of “ae” sound as in cat

s (noisy ) | p (air stopped) | ee (periodic) |t(stopped)|sh(noisy)

Waveform for word “speech”

Non-periodic Signal

Page 9: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

9

Periodic Signals

1. Periodic signals repeat over time, i.e.,

2. Aperiodic signals do not repeat themselves regularly.tTtsts allfor )()( +=

s(t) = Asin(2πf0t +φ0)

Page 10: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

10

Periodic Signals: Sine wave

Activity 3: Identify the amplitude, fundamental frequency, and phase of the sinusoidal signals?

Page 11: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

11

( ) ( )∫∑><

−∞=φ+π=φ+π=

Tkk

kkk dttftx

Taetfatx 00 2cos)(2wher2cos)(

Frequency Representation of Periodic Signals (1)

Frequency DomainTime Domain1 0 1 0 1 0 1 0

••• t

0.25 ms

x1(t)

•••f (kHz)

12 2040

|| ka

1 1 1 1 0 0 0 0

••• t

1 ms

x2(t)

•••f (kHz)

8 1240

|| ka

( ) ( ) ( ){ }L+π+π+π= π ))20000(2sin())12000(2sin())4000(2sin()( 51

314

1 ttttx

( ) ( ) ( ){ }L+π+π+π= π ))5000(2sin())3000(2sin())1000(2sin()( 51

314

2 ttttx

Periodic signals with fundamental frequency f0 = 1/T Hz may be represented by the Fourier Series,defined as:

Page 12: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

12

Frequency Representation of Periodic Signals (1)

Fourier Series: any periodic signal with the fundamental frequency of f0 can be represented as a linear combination of a sinusoidal wave with the fundamental frequency of f0 and the higher order harmonics of the sinusoidal wave with fundamental frequencies (kf0) for (2 ≤ k ≤∞).As an example, consider the sum of the first two harmonics of

Including more terms will make theapproximation closer to a square wave.

( ) ( ){ })2sin()2sin()( 031

04

1 L+π+π= π tftftx

)2sin( 0tfπ

( ) ))3(2sin( 031 tfπ

( ) ( ){ }))12000(2sin())4000(2sin()( 314

1 tttx π+π= π

Page 13: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

13

∫∞

∞−

π−= dtetxfX ftj2)()(

Frequency Representation of of Aperiodic Signals (1)

Frequency DomainTime Domain

Non-periodic signals may be represented by the Fourier Transform, defined as:

t0

1 ( )ttx rect)( =

5.05.0−

f

0

1 ( )ffX sinc)( =

11−

f0

( )ffX 2sinc)( =

11−t

0

1 ( )ttx ∆=)(

11−

1

Page 14: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

14

Streamed Data: Analogue to Digital Conversion

There are two steps involved in converting an analogue signal to a digital signal:1. Sampling: obtain the value of signal every T seconds.

⎯ Choice of T is determined by how fast a signal changes, i.e., the frequency content of the signal

⎯ Nyquist Sampling theorem says:signal in thefrequency maximum ) / (1 rate Sampling ≥T

Sampling−∆/2

5∆/2

∆/2

−5∆/2

Analogue Signal:Defined for all timeCan have any amplitude

−∆/2

5∆/2

∆/2

−5∆/2

Discrete-time Signal:Defined for multiples of TCan have any amplitude

T

Page 15: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

15

Analogue to Digital Conversion

There are two steps involved in converting an analogue signal to a digital signal:2. Quantization: approximate signal to certain levels. Number of levels used determine the

resolution.

Quantization −∆/2

5∆/2

∆/2

−5∆/2

Digital Signal:Defined for multiples of TAmplitude limited to a few levels

T

−∆/2

5∆/2

∆/2

−5∆/2

Discrete-time Signal:Defined for multiples of TCan have any amplitude

T

input x(nT)

output y(nT)

0.5∆1.5∆

2.5∆

3.5∆

−0.5∆

−1.5∆−2.5∆

−3.5∆

∆ 2∆ 3∆ 4∆

−∆−2∆−3∆−4∆

Page 16: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

16

Example: Analogue ->Digital

First row of streamed information detailing voice (from previous table):

Voice: maximum frequency = 4 kHz voiceSampling rate (1 / T) >= 2 × 4000 or 8000 samples/secondSampling period (T) = 1 / 8000 = 125 microseconds

For digital telephony, no. of levels (L) used in the uniform quantizer are 256Number of bits required to represent a level = log2(L) = log2 (256) = 8 bits

Data rate = 8000 × 8 or 64 kbps

Activity 4:Repeat for stereo music system that contains a maximum frequency of 22 kHz. The number of levels used by the uniform quantizer are 64K. Remember there are 2 channels (L & R) in a stereo system. How much data will be generated in one hour?

Page 17: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

17

Pulse Code Modulation (PCM)

PCM (sampling followed by quantization) is used to digitize voice signals in telephony. Voice signal is band limited to 4 kHz (Sampling rate = 8 ksamples/s) 8-bit nonuniform quantizer is used to quantize each sample (Data rate = 64 kbits/s) It can be shown that the SNR for PCM = (6m – 10) dB

t

)(tx

-1.00

-0.75

-0.50

-0.25

0

0.25

0.50

0.75

1.00

-0.875

-0.625

-0.375

-0.125

0.125

0.375

0.625

0.875

Decision Levels

Reconstruction Levels

3-bit codewords

000

001

010

011

100

101

110

111

PCM output 011 010 000 001 111 111001 110 101 100

Ts

PCM with m = 3, No. of levels = 23 = 8

Page 18: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

18

Fundamental Problem

Fundamental Question: How fast (maximize data rate) and reliably (minimize errors) digital transmission can occur through a channel?Depends upon a number of factor:⎯ Amount of energy present in the signal⎯ Noise properties of the channel⎯ Distance for signal to propagate⎯ Bandwidth (BW) of the transmission mediumBandwidth: determines the range of frequencies that can be transmitted through a channel.⎯ Consider a sinusoidal wave:

Frequency present in the wave = f0 Hz or 2πf0 radians/s⎯ Apply s(t) at the input of the channel and measure the amplitude of the output⎯ Calculate the ratio of the amplitude of the output to that of the input (referred to as

Amplitude response function) that provides a measure of the Bandwidth

)2sin()( 0 tfAts π=

Page 19: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

19

⎯ Communication channels can be characterized either in the frequency domain or time domain⎯ To obtain the frequency domain characterization, apply a sinusoidal signal at the input

and measure the output

⎯ Amplitude Response A(f): is the ratio of the output amplitude to input amplitude (Aout / Ain) as a function of frequency.

⎯ Phase Shift: is the variation in φ(f ) as a function of frequency.

Communication Channels: Frequency Domain Characterization (1)

)2cos()( inin ftAty π=

Channel tt

Aincos(2πft)Aoutcos(2πft + φ( f ))

))(2cos()( outout tftAty φ+π=

Page 20: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

20

Communication Channels: Frequency Domain Characterization (2)

⎯ Examples of Amplitude and Frequency-response functions

⎯ Bandwidth (BW): is the range of frequencies passed by the channel.⎯ Attenuation: is the reduction in signal power as in propagates through the channel.

Attenuation in dB = 10 log10(Pin / Pout)Activity 5: Show that the attenuation of the above channel is −201og10(A ( f ))?

f

1 22411)(

ffA

π+= φ( f ) = tan-1 2πf

f0

−45o

−90o

1/ 2π

Page 21: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

21

Communication Channels: Frequency Domain Characterization (3)

Activity 6: What are the bandwidth of the channels with the following amplitude-response functions?

f0 W

A(f)

Lowpass Channel0 W

f

A(f)1

Ideal Lowpass Channel

0 W2f

A(f)1

Ideal Bandpass ChannelW1 0 W

f

A(f)1

Ideal Highpass Channel

Page 22: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

22

Communication Channels: Time Domain Characterization

⎯ Time Domain characterization of a channel is determined by applying an impulse at the input of the channel and measuring the output.

where h(t) is called the impulse response.⎯ Impulse response and amplitude-response function are related by the Fourier transform. Knowing

one, the other can be calculated.⎯ Given the impulse response (or the amplitude-response function), the output for any given input

can be calculated.

Channelt

0t

h(t)

td

Page 23: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

23

Baseband Transmission (1)

⎯ Baseband Transmission: is the transmission of digital information over a lowpass channel.⎯ Two parameters used to characterize the performance of a communication system:

⎯ Data rate in bps: Number of bits transmitted per second.⎯ Error rate: Fraction of bits received in error.

⎯ Consider a binary lowpass channel using Polar NRZ representation for bits:

⎯ The communication system is designed in such a way that the response to a single pulse is p(t)

+A

-A0 T 2T 3T 4T 5T

1 1 1 10 0

t

Received signal

Transmitter Filter

Comm. Channel

Receiver Filter Receiver

p(t)

0t

0

Page 24: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

24

Baseband Transmission (2)

Overall response to the binary data 101101 is:

How does the receiver detects bits from r(t)?⎯ Sample r(t) at t = 0, T, 2T, 3T

⎯ If r(kT) > 0, then bit 1 was transmitted at t = kT⎯ If r(kT) < 0, then bit 0 was transmitted at t = kT⎯ For t = 0, we get

⎯ The second term involving the summation results in Intersymbol Interference (ISI).⎯ ISI causes overlapping between neighbouring pulses and therefore degrades the ability of the

receiver in detecting the transmitted bits from the received signal. ISI is a nuisance. ⎯ How do we reduce ISI? Select a pulse p(t) that contributes zero Intersymbol Interference.

4434421ceInterferen lIntersymbo

00 )()0()0( ∑

−+=k

k kTpApAr

∑=

−=

+−−−+−+−−=N

kk kTtpA

TtApTtApTtApTtAptAptr

0

)(

)4()3()2()()()( K

Page 25: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

25

Channel Capacity (1)

Received signal

Transmitter Filter

Comm. Channel

Receiver Filter Receiver

r(t)

0t

0

Width of pulse (T) = 1 / (2W) where W = BW of the channelMaximum transmission rate = 2W pulses / second

tT T T TT

−1

0

1

−2T −T 0 T 2T 3T 4T

Separate Pulses

−2

−1

0

1

2

t−2T −T T 3T 4T2T

Combined

Output to bits 110:

Page 26: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

26

Channel Capacity (2)

Let us calculate the bit rate for a channel with BW = W Hz.⎯ If bandwidth is W Hz, then minimum width of pulse = 1 / 2W seconds.⎯ Nyquist Signaling Rate = 2W pulses/s (maximum data rate assuming a noiseless channel).

⎯ Binary Transmission: 1 bit per pulse => Transmission rate = 1 / duration of pulse = 2W bps⎯ M-level Transmission:

⎯ No. of bits represented by one pulse = log2(M) = m⎯ Nyquist Signaling Rate in bps = m ×(1 / duration of pulse) = 2mW = 2W log2(M) bps⎯ Increasing m, increases the transmission rate !!!! Is there an upper limit?

Channel tt

1/(2W)

1 0 1

t

1/(2W)

00 01 10 11

2-ary Transmission

Page 27: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

27

Channel Capacity (3)

⎯ Channel Capacity (C) is the maximum bit rate supported by a channel.⎯ Can the channel capacity C be made infinite by increasing m?

No! There are other constraints introduced by noise and channel interference.

signal noise signal + noise

HighSNR t t t

signal noise signal + noise

LowSNR

t t t

More Errors

Page 28: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

28

Channel Capacity (4)

⎯ By increasing m, the difference between adjacent levels is reduced affecting SNR⎯ Reduction in SNR affects the Channel Capacity (C).⎯ Shannon Channel Capacity theorem provides an upper bound on the channel capacity in terms

of bandwidth for a noisy channelC = W log2 (1 + SNR) bps

⎯ Recall that the Nqyuist theorem provided the upper bound on the channel capacity for a noiseless channel. The Shannon theorem provides the upper bound for a noisy channel.

⎯ Shannon theorem provides no indication of levels. For M = 2m levels or symbols, the channel capacity based on the Shannon theorem is given by

C = {W log2 (1 + SNR)} / m symbols/s⎯ Activity 7: Calculate the channel capacity of a dial-in modem that has a BW of 3400 Hz if the best

SNR possible in the modem is 40dB. Recall thatSNR in dB = 10 log10(SNR on a linear scale).

Page 29: COSC 3213: Computer Networks I Chapter 3 · Note that the tx signal can not be recovered from the rx signal due to attenuation and distortions. Attenuation must be compacted so that

29

Channel distortion

⎯ Probability of error in presence of additive White Gaussian noise (AWGN):

where δ is the distance between levels and σ is the standard deviation of noise.⎯ Activity 8: Consider a dial-in modem that uses Pulse Shift Keying (PSK) of a sinusoidal wave

having a maximum amplitude of +5V. The bandwidth of the twisted pair wire used is limited to 3400Hz. Assuming that the noise introduced by the channel is AWGN with a variance (σ2) of 2.25. Calculate:(a) the signal-to-noise ratio (SNR) for the channel in dB.(b) the channel capacity C of the twisted pair as a channel.(c) the probability of error Pe for binary transmission.

Answers: (a) 7.45 dB (b) 2.78 kbps (c) 2.43 x 10-6

( )σδ= 22QPe