Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 William Stallings Data and Computer Communications Chapter 5 Data Encoding.

Similar presentations


Presentation on theme: "1 William Stallings Data and Computer Communications Chapter 5 Data Encoding."— Presentation transcript:

1 1 William Stallings Data and Computer Communications Chapter 5 Data Encoding

2 2 Data Communication Basics zAnalog or Digital zThree Components yData ySignal yTransmission

3 3 Analog Data Choices

4 4 Digital Data Choices

5 5 Encoding Techniques zDigital data, digital signal zAnalog data, digital signal zDigital data, analog signal zAnalog data, analog signal

6 6 Transmission Choices zAnalog transmission yonly transmits analog signals, without regard for data content yattenuation overcome with amplifiers zDigital transmission ytransmits analog or digital signals yuses repeaters rather than amplifiers

7 7 Advantages of Digital Transmission zThe signal is exact zSignals can be checked for errors zNoise/interference are easily filtered out zA variety of services can be offered over one line zHigher bandwidth is possible with data compression

8 8 Encoding schemes voice Telephone analog digital Modem analog CODEC digital Digital transmitter digital Analog data, Analog signal Digital data, Analog signal Digital data, Digital signal Analog data, Digital signal

9 9 Encoding and Modulation EncoderDecoder Modulator Demodulator digital or analog digital or analog digital analog g(t) m(t) fc s(f) x(t) t f fc g(t) m(t) x(t) s(t)

10 10 Why encoding? zThree factors determine successfulness of receiving a signal yS/N (Signal to Noise Ratio) ydata rate ybandwidth

11 11 Encoding Schemes' evaluation factors zSignal spectrum zClocking zError detection zSignal interference & noise immunity zCost and complexity

12 12 Digital Data, Digital Signal / Characteristics zDigital signal yUses discrete, discontinuous, voltage pulses yEach pulse is a signal element yBinary data is encoded into signal elements

13 13 Terms (1) zUnipolar yAll signal elements have same sign zPolar yOne logic state represented by positive voltage the other by negative voltage zData rate yRate of data transmission in bits per second zDuration or length of a bit yTime taken for transmitter to emit the bit

14 14 Terms (2) zModulation rate yRate at which the signal level changes yMeasured in baud = signal elements per second zMark and Space yBinary 1 and Binary 0 respectively

15 15 Interpreting Signals zNeed to know yTiming of bits - when they start and end ySignal levels zFactors affecting successful interpretation of signals: ySignal to noise ratio yData rate yBandwidth

16 16 Comparison of Encoding Schemes (1) zSignal Spectrum yLack of high frequencies reduces required bandwidth yLack of dc component allows ac coupling via transformer, providing isolation yIt is important to concentrate power in the middle of the bandwidth zClocking issues ySynchronizing transmitter and receiver is essential yExternal clock is one way used for synchronization ySynchronizing mechanism based on signal is also used & preferred (over using an external clock)

17 17 Spectral density -0.5 0 0.5 1 1.5 0 0.5 1 1.5 NRZ- L, NRZI B8ZS,HDB3 AMI, Pseudoternary Manchester, Differential Manchester Mean square voltage per unit bandwidth Normalized frequency (f/r)

18 18 Comparison of Encoding Schemes (2) zError detection yCan be built into signal encoding zSignal interference and noise immunity ySome codes are better than others zCost and complexity yHigher signal rate (& thus data rate) lead to higher costs ySome codes require signal rate greater than data rate

19 19 Encoding Schemes zNonreturn to Zero-Level (NRZ-L) zNonreturn to Zero Inverted (NRZI) zBipolar -AMI (Alternate Mark Inversion) zPseudoternary zManchester zDifferential Manchester zB8ZS zHDB3

20 20 Digital data, Digital signal 01001100011 NRZ NRZI Bipolar -AMI Pseudoternary Manchester Differential Manchester

21 21 Nonreturn to Zero-Level (NRZ-L) zTwo different voltages for 0 and 1 bits zVoltage constant during bit interval zMost often, negative voltage for one value and positive for the other

22 22 Nonreturn to Zero Inverted zNonreturn to zero inverted on ones zConstant voltage pulse for duration of bit zData encoded as presence or absence of signal transition at beginning of bit time zTransition (low to high or high to low) denotes a binary 1 zNo transition denotes binary 0 zAn example of differential encoding (Data represented by changes rather than levels)

23 23 NRZ

24 24 NRZ pros and cons zPros yEasy to engineer yMakes good use of bandwidth zCons ydc component yLack of synchronization capability zUsed for magnetic recording zNot often used for signal transmission

25 25 Multilevel Binary zUse more than two levels zBipolar-AMI yzero represented by no line signal yone represented by positive or negative pulse yone pulses alternate in polarity yNo loss of sync if a long string of ones happens (zeros still a problem) yNo net dc component  Can use a transformer for isolating transmission line yLower bandwidth yEasy error detection

26 26 Pseudoternary zOne represented by absence of line signal zZero represented by alternating positive and negative zNo advantage or disadvantage over bipolar-AMI

27 27 Bipolar-AMI and Pseudoternary

28 28 Trade Off for Multilevel Binary zNot as efficient as NRZ yWith multi-level binary coding, the line signal may take on one of 3 levels, but each signal element, which could represent log 2 3 = 1.58 bits of information, bears only one bit of information yReceiver must distinguish between three levels (+A, -A, 0) yRequires approx. 3dB more signal power for same probability of bit error

29 29 Biphase zManchester yTransition in middle of each bit period yTransition serves as clock and data yLow to high represents one yHigh to low represents zero yUsed by IEEE 802.3 (Ethernet) zDifferential Manchester yMidbit transition is for clocking only yTransition at start of a bit period represents zero yNo transition at start of a bit period represents one yNote: this is a differential encoding scheme yUsed by IEEE 802.5 (Token Ring)

30 30 Biphase Pros and Cons zCon yAt least one transition per bit time and possibly two yMaximum modulation rate is twice NRZ yRequires more bandwidth zPros ySynchronization on mid bit transition (self clocking) yNo dc component yError detection xAbsence of expected transition points to error in transmission

31 31 Modulation Rate R=Data Rate=bits/sec=1 Mbps for both cases Modulation Rate=Baud Rate=Rate at which signal elements are generated=R for NRZI=2R for Manchester

32 32 Scrambling Techniques zUsed to reduce signaling rate relative to the data rate by replacing sequences that would produce constant voltage for a priod of time with a filling sequence that accomplishes the following goals: yMust produce enough transitions to maintain syncchronization yMust be recognized by receiver and replaced with original data sequence yis same length as original sequence zNo dc component zNo long sequences of zero level line signal zNo reduction in data rate zError detection capability zAs an example, fax machines use the modified Huffman code to accomplish this.

33 33 B8ZS zBipolar With 8 Zeros Substitution zBased on bipolar-AMI zIf octet of all zeros and last voltage pulse preceding was positive, encode as 000+-0-+ zIf octet of all zeros and last voltage pulse preceding was negative, encode as 000-+0+- zCauses two violations of AMI code zThis is unlikely to occur as a result of noise zReceiver detects and interprets the sequence as octet of all zeros

34 34 HDB3 zHigh Density Bipolar 3 Zeros zBased on bipolar-AMI zString of four zeros replaced with one or two pulses Note: The following is the explanation for the HDB3 code example on the next slide (see rules in Table 5.4, page 142): Assuming that an odd number of 1's have occurred since the last substitution, since the polarity of the preceding pulse is "-", then the first 4 zeros are replaced by "000-". For the next 4 zeros, since there have been no Bipolar pulses since the 1st substitution, then they are replaced by"+00+" since the preceding pulse is a "-". For the 3rd case where 4 zeros happen, 2 (even) Bipolar pulses have happened since the last substitution and the polarity of the preceding pulse is "+", so "-00-" is substituted for the zeros.

35 35 B8ZS and HDB3 (Assume odd number of 1s since last substitution) See Table 5.4 for HDB3 Substitution Rules

36 36 Digital Data, Analog Signal zTransmitting digital data through PSTN (Public telephone system) y300Hz to 3400Hz bandwidth ymodem (modulator-demodulator) is used to convert digital data to analog signal and vice versa zThree basic modulation techniques are used: zAmplitude shift keying (ASK) zFrequency shift keying (FSK) zPhase shift keying (PSK)

37 37 Modulation Techniques

38 38 Amplitude Shift Keying zValues represented by different amplitudes of carrier zUsually, one amplitude is zero yi.e. presence and absence of carrier is used zSusceptible to sudden gain changes zInefficient zUp to 1200bps on voice grade lines zUsed over optical fiber

39 39 ASK Vd(t) Vc(t) VASK(t) fc fc-f0fc-3f0 fc+f0 fc+3f0 Signal power Frequency frequency spectrum

40 40 Frequency Shift Keying zValues represented by different frequencies (near carrier) zLess susceptible to error than ASK zUp to 1200bps on voice grade lines zHigh frequency radio (3-30 MHz) zHigher frequency on LANs using co-ax

41 41 FSK Carrier 2 Data signa l Carrier 1 vd(t) v1(t) v2(t) vFSK(t) f1 Signal power Frequency frequency spectrum f2

42 42 FSK in modem (on Voice Grade Line) 400 980 (1070) 1850 (2225) 1180 (1270) 1650 (2025) 3400 Amplitude Frequency(Hz) PSTN bandwidth frequency spectrum

43 43 Phase Shift Keying zPhase of carrier signal is shifted to represent data zDifferential PSK yPhase shifted relative to previous transmission rather than some reference signal

44 44 PSK Data Signal Carrier Phase coherent Differential vc(t) vPSK(t) v’PSK(t) 180=00=1 phase diagram zbit rate = signaling rate Differential example: for every logic 1, 180 degree phase shift

45 45 Quadrature PSK zMore efficient use by each signal element representing more than one bit ye.g. shifts of  /2 (90 o ) yEach element represents two bits yCan use 8 phase angles and have more than one amplitude y9600bps modems use 12 angles, four of which have two amplitudes

46 46 Multilevel modulation method 01 10 00 0°+90 ° +180°+270 ° 11 zbit rate = n x signaling rate

47 47 Multilevel modulation method +90°=01 0°=00 +270°=11 +180°=10 4-PSK phase diagram 16-QAM phase diagram

48 48 Performance of Digital to Analog Modulation Schemes zBandwidth yASK and PSK bandwidth directly related to bit rate yFSK bandwidth related to data rate for lower frequencies yrequires more analog bandwidth than ASK y(See Stallings for math) zIn the presence of noise, bit error rate of PSK and QPSK are about 3dB superior to ASK and FSK

49 49 Analog Data, Digital Signal zDigitization yConversion of analog data into digital data yDigital data can then be transmitted using NRZ-L or using other codes yDigital data can then be converted to analog signal yAnalog to digital conversion done using a codec yPulse code modulation yDelta modulation

50 50 Analog data, Digital signal zTwo principle techniques used yPCM (Pulse Code Modulation) yDM (Delta Modulation) Analog voice signal Sampling clock PAM signal PCM signal Sampling Circuit Sampling Circuit Quantizer and compander Quantizer and compander Digitized voice signal

51 51 Pulse Code Modulation(PCM) (1) zIf a signal is sampled at regular intervals at a rate higher than twice the highest signal frequency, the samples contain all the information of the original signal y(Proof - Stallings appendix 4A) zVoice data limited to below 4000Hz zRequire 8000 sample per second zAnalog samples (Pulse Amplitude Modulation, PAM) zEach sample assigned digital value

52 52 Pulse Code Modulation(PCM) (2) z4 bit system gives 16 levels zQuantized yQuantizing error or noise yApproximations mean it is impossible to recover original exactly z8 bit sample gives 256 levels zQuality comparable with analog transmission z8000 samples per second of 8 bits each gives 64kbps

53 53 The process starts with an analog signal, which is sampled by PAM sample. the resulting pulse are quantized to produced PCM pulses and then encoded to produce bit stream. At the receiver end, the process is reversed to reproduce the analog signal.

54 54 PCM zSampling signal based on nyquist theorem 3.2 3.9 2.8 3.4 1.2 4.2 3 4 3 3 1 4 011100011 001100 Original signal PAM pulse PCM pulse with quantized error 011100011011001100 PCM output

55 55 Nonlinear Encoding  Quantization levels are not necessarily equally spaced. The problem with equal spacing is that the mean absolute error for each sample is the same, regardless the signal level. Lower amplitude values are relatively more distorted. zNonlinear encoding reduces overall signal distortion zCan also be done by companding

56 56 Nonlinear encoding 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Strong signal Weak signal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Quantizing level Without nonlinear encodingWith nonlinear encoding

57 57 Prior to the input signal being sampled and converted by ADC into a digital form, it is passed through a circuit known as a compressor. Similarly, at the destination, the reverse operation is perform on the output of the DAC by a circuit known as expander.

58 58 Delta Modulation zAnalog input is approximated by a staircase function zMove up or down one level (  ) at each sample interval zBinary behavior yFunction moves up or down at each sample interval

59 59 Delta Modulation - example

60 60 Delta Modulation - Performance zGood voice reproduction yPCM - 128 levels (7 bit) yVoice bandwidth 4khz yShould be 8000 x 7 = 56kbps for PCM zData compression can improve on this ye.g. Interframe coding techniques for video

61 61 Analog Data, Analog Signals zWhy modulate analog signals? yHigher frequency can give more efficient transmission yPermits frequency division multiplexing (chapter 8) zTypes of modulation yAmplitude yFrequency yPhase

62 62 Analog Modulation

63 63 Spread Spectrum zAnalog or digital data zAnalog signal zSpread data over wide bandwidth zMakes jamming and interception harder z2 schemes are used: zFrequency hoping ySignal broadcast over seemingly random series of frequencies zDirect Sequence yEach bit is represented by multiple bits in transmitted signal known as a chipping code


Download ppt "1 William Stallings Data and Computer Communications Chapter 5 Data Encoding."

Similar presentations


Ads by Google