16.546 Computer Telecommunications: Modulation and Data Encoding Professor Jay Weitzen Electrical & Computer Engineering Department The University of Massachusetts Lowell 1 Data Encoding at the PL Source node Destination node Application Application Presentation Presentation Session Session Intermediate node transport Network Packets transport Network Network Data link Data link Physical Physical Frames Data link Physical Bits Signals 2 Network A Node 7 6 5 We Need to Encode PL Frame Application AL-Hdr Presentation PL-Hdr Session 4 Transport 3 Network 2 Data Link 1 Physical SL-Hdr DLL-Hdr PL-Hdr Presentation Layer Msg Session Layer Msg TL-Hdr NL-Hdr Application Layer Msg Transport Layer Msg Network Layer Msg Data Link Layer Msg Physical Layer Msg 3 Encoding Techniques Digital data, digital signal Analog data, digital signal Digital data, analog signal Analog data, analog signal 4 Digital Data, Digital Signal Digital signal – Discrete, discontinuous voltage pulses – Each pulse is a signal element – Binary data encoded into signal elements 5 Terminology Unipolar – All signal elements have same sign Polar – One logic state represented by positive voltage the other by negative voltage Data rate – Rate of data transmission in bits per second Duration or length of a bit – Time taken for transmitter to emit the bit Modulation rate – Rate at which the signal level changes – Measured in baud = signal elements per second Mark and Space – Binary 1 and Binary 0 respectively 6 Interpreting Signals Need to know – Timing of bits - when they start and end – Signal levels Factors affecting successful interpreting of signals – Signal to noise ratio – Data rate – Bandwidth 7 Comparison of Encoding Schemes (1) Signal Spectrum – Lack of high frequencies reduces required bandwidth – Lack of dc component allows ac coupling via transformer, providing isolation – Concentrate power in the middle of the bandwidth Clocking – Synchronizing transmitter and receiver – External clock – Sync mechanism based on signal 8 Comparison of Encoding Schemes (2) Error detection – Can be built in to signal encoding Signal interference and noise immunity – Some codes are better than others Cost and complexity – Higher signal rate (& thus data rate) lead to higher costs – Some codes require signal rate greater than data rate 9 Encoding Schemes Nonreturn to Zero-Level (NRZ-L) Nonreturn to Zero Inverted (NRZI) Bipolar -AMI Pseudoternary Manchester Differential Manchester B8ZS HDB3 4B/5B, MLT-3, 8B/10 Schemes 10 Nonreturn to Zero-Level (NRZ-L) Two different voltages for 0 and 1 bits Voltage constant during bit interval – no transition, i.e., no return to zero voltage Absence of voltage for zero, constant positive voltage for one More often, negative voltage for one value and positive for the other This is NRZ-L 11 Nonreturn to Zero Inverted Nonreturn to zero inverted on ones Constant voltage pulse for duration of bit Data encoded as presence or absence of signal transition at beginning of bit time Transition (low to high or high to low) denotes a binary 1 No transition denotes binary 0 An example of differential encoding 12 NRZ 13 Differential Encoding Data represented by changes rather than levels More reliable detection of transition rather than level In complex transmission layouts it is easy to lose sense of polarity 14 NRZ pros and cons Pros – Easy to engineer – Make good use of bandwidth Cons – dc component – Lack of synchronization capability Used for magnetic recording Not often used for signal transmission 15 Multilevel Binary Use more than two levels Bipolar-AMI (Alternate Mark Inversion) – – – – zero represented by no line signal one represented by positive or negative pulse one pulses alternate in polarity No loss of sync if a long string of ones (zeros still a problem) – No net dc component – Lower bandwidth – Easy error detection 16 Pseudoternary One represented by absence of line signal Zero represented by alternating positive and negative No advantage or disadvantage over bipolar-AMI 17 Bipolar-AMI and Pseudoternary 18 Trade Off for Multilevel Binary Not as efficient as NRZ – Each signal element only represents one bit – In a 3 level system could represent log23 = 1.58 bits – Receiver must distinguish between three levels (+A, -A, 0) – Requires approx. 3dB more signal power for same probability of bit error 19 Biphase Manchester – – – – – Transition in middle of each bit period Transition serves as clock and data Low to high represents one High to low represents zero Used by IEEE 802.3 Differential Manchester – – – – – Midbit transition is clocking only Transition at start of a bit period represents zero No transition at start of a bit period represents one Note: this is a differential encoding scheme Used by IEEE 802.5 20 Biphase Pros and Cons Con – At least one transition per bit time and possibly two – Maximum modulation rate is twice NRZ – Requires more bandwidth Pros – Synchronization on mid bit transition (self clocking) – No dc component – Error detection • Absence of expected transition 21 Modulation Rate 22 Scrambling Use scrambling to replace sequences that would produce constant voltage Filling sequence – Must produce enough transitions to sync – Must be recognized by receiver and replace with original – Same length as original No dc component No long sequences of zero level line signal No reduction in data rate Error detection capability 23 B8ZS Bipolar With 8 Zeros Substitution Based on bipolar-AMI If octet of all zeros and last voltage pulse preceding was positive encode as 000+-0-+ If octet of all zeros and last voltage pulse preceding was negative encode as 000-+0+ Causes two violations of AMI code Unlikely to occur as a result of noise Receiver detects and interprets as octet of all zeros 24 HDB3 High Density Bipolar 3 Zeros Based on bipolar-AMI String of four zeros replaced with one or two pulses 25 B8ZS and HDB3 26 Digital Signal Encoding For LANs 4B/5B-NRZI – Used for 100BASE-X and FDDI LANs – Four Data Bits Encoded into Five Code Bits, 80% MLT-3 – 100BASE-TX & FDDI Over Twisted Pair 8B/6T – Uses Ternary Signaling (Pos, Neg, Zero Voltages) – Eight Data Bits Encoded into 6 Ternary Symbols 8B/10B – Used for Fibre Channel & Gigabit Ethernet 27 10 Gigabit Ethernet (1 of 2) • IEEE 802.3ae • MAC: it’s just Ethernet – Maintains 802.3 frame format and size – Full duplex operation only – Throttled to 10.0 for LAN PHY or 9.58464 Gb/s for WAN PHY • PHY: LAN and WAN phys – LAN PHY uses simple encoding mechanisms to transmit data on dark fiber and dark wavelengths – WAN PHY adds a SONET framing sublayer to utilize SONET/SDH as layer 1 transport • PMD: optical media only – – – – 850 nm on MMF to 65m 1310 nm, 4 lambda, WDM to 300 m on MMF; 10 km on SMF 1310 nm on SMF to 10 km 1550 nm on SMF to 40 km 28 10 Gigabit Ethernet (2 of 2) • Supports dark wavelength and SONET/TDM with unlimited reach • Several Coding Schemes (64b/66b; 8B/10B; Scramblers) • Three optional interfaces: XGMII; XAUI; XSBI • Extension of MDIO interface • Continues Ethernet’s reputation for cost effectiveness and simplicity (goal 10X performance for 3X cost) • Expected target for ratification in Spring 2002 29 802.3ae to 802.3z Comparison 10 Gigabit Ethernet 1 Gigabit Ethernet • CSMA/CD + Full Duplex • Carrier Extension • Optical/Copper Media • Leverage Fibre Channel PMD’s • Reuse 8B/10B Coding • Support LAN to 5 km • • • • Full Duplex Only Throttle MAC Speed Optical Media Only Create New Optical PMD’s From Scratch • New Coding Schemes • Support LAN to 40 km; Use SONET/SDH as Layer 1 Transport 30 Converting From Analog To Digital 31 Pulse Code Modulation: a digital encoding scheme used in TDM In this modulation technique, an analog signal is digitized, and interleaved with other digitized voice signal to create a single bit stream At the receiving end, the bit stream is decomposed into separate digital streams of lower frequencies, each stream is then converted back into what resembles the original voice signal. 32 Steps Required to Generate PCM Streams Sampling: periodic measurement of the analog signals at regular intervals Quantizing: assigning discrete values to samples Coding: assigned binary codes to samples using what is known as the PCM code word 33 Sampling (a) (b) (c) Figure 2.2 : creating a PAM wave for a single sinusoid. (a) is a sinusoid signal, (b) a pulse train, (c) the result of passing (a) and (b) through a point by point multiplier. 34 Sampling Sampling rate: how often should we take measurements of the analog signal at least at twice the rate of its highest frequency component For a voice channel with a frequency range between 300 Hz and 3400 Hz (bandwidth of 3100 Hz) we need to take a sample at least at a rate of 2 X 3100 = 6200 Hz or every 1/6200 second 35 Sampling In practical system, we sample multiple channel, we combine the samples of all channels into a single signal called the PAM signal (Pulse Amplitude Modulation signal) In American systems we sample 24 channels In the European systems 30 channels are sampled 36 Quantization To represent samples by a fixed number of bits For example if the amplitude of the PAM signal range between -1 and +1 there can be infinite number of values. For instance one value can be 0.2768987653598364834634 For practicality, we may use 20 different discrete values between -1 and +1 volts Each value at a 0.1 increment 37 Quantization: the binary world Because we live in a binary world, we select the total number of discrete values to be binary number multiple (i.e., 2, 4, 8, 16, 32, 64, 128, 256, and so on) This facilitate binary coding For instance, if there were 4 values they would be as follows: 00, 01, 10, 11 This is a 2-bit code 38 Quantization: 16 coded quantum steps Between -1 and + 1 volts signal 16 discrete steps each step at 0.125 volts increment or decrement from the adjacent step 0 0000 0v 3 0011 0.375v 1 0001 0.125v 4 0100 0.500v 2 0010 0.25v 5 0101 0.625v 39 Quantization: 16 quantum steps (-1 to + 1 volts) +1 Range of standard values (V) 0 -1 15 : 1111 14: 1110 13: 1101 12: 1100 11: 1011 10: 1010 9: 1001 8: 1000 7: 0111 6: 0110 5: 0101 4: 0100 3: 0011 2: 0010 1: 0001 0: 0000 8 9 10 1112 13 12 11 10.. 6 ......... Coded values 40 Quantization Distortion Quantization error is the different between the quantum value and the true value More steps reduce quantizing distortion in linear quantization This will require higher bandwidth, since we need more bits for each code word Voice represent a problem because of the wide dynamic range, the level from the loudest syllable of the loudest talker to the lowest syllable of the quietest talker S/D = 6n + 1.8 dB EX: 7 bit PCM cod 6.7 + 1.8 = 43.8 practical system S/D = 30 - 33 dB 41 Companding Compression/Expanding Non-linear The voltage level between the loudest and the lowest is segmented in non-linear manor The voltage range of each segment varies according to the level of the voltage 42 Non-linear Quantization Segment # Voltage levels 5.0 1 3.0 2 1.5 3 0.5 4 5 0 6 7 8 43 Non-linear Quantization Compressed Output Voltage Segment 2 has 3 steps like all of the other segments Segment 4 Segment 3 Segment 2 Segment 1 -5.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 Input Voltage 4.5 5.0 44 Coding for Modern PCM systems Non-linear Logarithmic A-Law u-Law 45 A-Law AX Y 1 log A Y 1 _ log( AX 1 _ log A for for V 0v A V v V A 46 U-Law log( 1 u | X |) | Y | log( 1 u) 47 Coding for Modern PCM systems i v Y X Where = instantaneous input voltage V B V = maximum input voltage for which peak limitation is absent i = number of quantization steps starting from the center of the range B = number of quantization steps on each side of the center of the range. 48 13-segment A-Law Curve Segment (Chord) Code 6 112 5 96 4 80 1101XXX 3 64 1100XXX 2 48 1011XXX 1111XXX 1/2 1110XXX 1/4 1/8 POSITIVE 1/16 1/32 1 32 1010XXX 1/64 1001XXX 0 1000XXX 0 1/4 2/4 3/4 1 (V) 0000XXX 0001XXX 0010XXX 0011XXX NEGATIVE 0100XXX 0101XXX 0110XXX 0111XXX Figure 2.7: 13-segment approximation of the A-law curve used with E1 PCM equipment 49 PCM Code Word Sign S Segment Number Level Value A B C D Figure 2.8: PCM Code Example 50 S/D for A-law & u-Law For A = 87.6: S/D = 37.5 dB u = 255: S/D = 37 51 Modems: Modulator/Demodulator Used to Package bits for transport over broadband media – 3 ways to encode information on a carrier - Phase - Frequency - Amplitude 52 Definition of Modulation Let m(t) be an arbitrary modulating (information) waveform. (could be either analog or digital) Let c(t)=cos(wct +f(t)) be the carrier The argument of the sinusoid is the instantaneous phase (wct +f( t )) The instantaneous frequency (2pfi)is given by d/dt (wct +f( t )) = wc +d/dt(f(t))2pfi 53 Types of Modulation If c(t)=m(t) cos(wct +f), the information is transported in the amplitude of the carrier. We call this Amplitude Modulation (AM) If fi(t)=km(t), the information is transported in the instantaneous frequency. We call this frequency modulation (FM). If f( t )=km(t) the information is carried in the instantaneous phase, and we call this phase modulation (PM). 54 Modulation Techniques 55 Amplitude Shift Keying Values represented by different amplitudes of carrier Usually, one amplitude is zero – i.e. presence and absence of carrier is used Susceptible to sudden gain changes Inefficient Up to 1200bps on voice grade lines Used over optical fiber 56 Frequency Shift Keying Values represented by different frequencies (near carrier) Less susceptible to error than ASK Up to 1200bps on voice grade lines High frequency radio Even higher frequency on LANs using co-ax 57 Frequency Modulation FM Used for high fidelity audio broadcast and digital transmission. Uses Shannon concept of bandwidth expansion. 58 FSK on Voice Grade Line 59 Phase Shift Keying Phase of carrier signal is shifted to represent data Differential PSK – Phase shifted relative to previous transmission rather than some reference signal 60 Phase Modulation Generally used for digital modulation 61 Quadrature PSK More efficient use by each signal element representing more than one bit – e.g. shifts of p/2 (90o) – Each element represents two bits – Can use 8 phase angles and have more than one amplitude – 9600bps modem use 12 angles , four of which have two amplitudes 62 Constellation Space Create 2-axis (e.g. sine and cosine) actually it could be a ndimensional hyper-plane Express digital modulation alphabet as points in the hyper-plane. The farther apart the points are in the space, the more immunity there is against noise and interference. More distance, better error performance. Keep this in mind. The maximum power is the length of the longest vector. The average transmitter power is the average distance squared of all the points. 63 Case Study 1: ASK • If m(t) = {0,1} and we amplitude modulate a carrier with m(t) then the modulation is called on/off keying (OOK) or 2-amplitude shift keying (2-ASK) • 2-ASK, (points are at (0,0), and (0,1), in the 2 dimensional (sine, cosine plane). Minimum distance between points is 1 for 1 unit of power, and 1 bit per symbol. • Distance between points corresponds to error performance 64 Case Study 2: Multi-Level ASK •If maximum power is normalize to 1 then points are at (0,0), (0,1/3), (0,2/3), (0,1). Distance is reduced from 2-ASK and performance is worse. Requires 3x or 9x power to maintain 1 unit of distance. • From Shannon, as we add more information in a fixed bandwidth, it becomes increasingly expensive in terms of SNR to add more data. 65 Case 3: Orthogonal FSK •Frequencies are chosen so that the waveforms are orthogonal over the period of the bit T. • Points are at (0,1) and (1,0) for 2-FSK. Distance is sqrt(2). Error performance better than 2-ASK but not as good as others. 66 Case 4: QPSK and PSK y(t) y(t) A -A -A A A x(t) x(t) -A Example signal constellation diagram for BPSK signal. 67 Higher Order Modulations Very Inefficient in terms of Power 68 Case 6: QAM Beyond 3 bits/symbol, PSK too power inefficient. Must use hybrid amplitude and phase modulation called QAM 69 Example V.32 Constellation 70 Performance of Digital to Analog Modulation Schemes Bandwidth – ASK and PSK bandwidth directly related to bit rate – FSK bandwidth related to data rate for lower frequencies, but to offset of modulated frequency from carrier at high frequencies – (See Stallings for math) In the presence of noise, bit error rate of PSK and QPSK are about 3dB superior to ASK and FSK 71 Coherent vs. Non-Coherent Detection Coherent detection requires a copy of the carrier to be recovered from the received signal for use in the detection process. It is more efficient because it uses all phase information, but requires added complexity Non-coherent detection using an envelope detector is much easier to implement, but less efficient because it uses only the envelope information and not the phase information. 72 Digital Data, Analog Signal Public telephone system – 300Hz to 3400Hz – Use modem (modulator-demodulator) Amplitude shift keying (ASK) Frequency shift keying (FSK) Phase shift keying (PK) 73 Analog Data, Digital Signal Digitization – Conversion of analog data into digital data – Digital data can then be transmitted using NRZ-L – Digital data can then be transmitted using code other than NRZ-L – Digital data can then be converted to analog signal – Analog to digital conversion done using a codec – Pulse code modulation – Delta modulation 74 Pulse Code Modulation(PCM) (1) If 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 – (Proof - Stallings appendix 4A) Voice data limited to below 4000Hz Require 8000 sample per second Analog samples (Pulse Amplitude Modulation, PAM) Each sample assigned digital value 75 Pulse Code Modulation(PCM) (2) 4 bit system gives 16 levels Quantized – Quantizing error or noise – Approximations mean it is impossible to recover original exactly 8 bit sample gives 256 levels Quality comparable with analog transmission 8000 samples per second of 8 bits each gives 64kbps 76 Nonlinear Encoding Quantization levels not evenly spaced Reduces overall signal distortion Can also be done by companding 77 Delta Modulation Analog input is approximated by a staircase function Move up or down one level () at each sample interval Binary behavior – Function moves up or down at each sample interval 78 Delta Modulation - example 79 Delta Modulation - Operation 80 Delta Modulation - Performance Good voice reproduction – PCM - 128 levels (7 bit) – Voice bandwidth 4khz – Should be 8000 x 7 = 56kbps for PCM Data compression can improve on this – e.g. Interframe coding techniques for video 81 Analog Data, Analog Signals Why modulate analog signals? – Higher frequency can give more efficient transmission – Permits frequency division multiplexing (chapter 8) Types of modulation – Amplitude – Frequency – Phase 82 Analog Modulation 83 Spread Spectrum Analog or digital data Analog signal Spread data over wide bandwidth Makes jamming and interception harder Frequency hoping – Signal broadcast over seemingly random series of frequencies Direct Sequence – Each bit is represented by multiple bits in transmitted signal – Chipping code 84 Encoding Schemes - WAN Techniques 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 AMI 0 0 0 0 V B 0 V B B8ZS 0 0 0 V B 0 0 V B 0 0 V HDB3 Both are well suited to characteristics of WAN channels 85 Encoding Schemes - Spectral Density B8ZS, HDB3 1.2 1.0 Mean Square Voltage .8 per Unit Bandwidth.6 NRZ-L NRZI AMI, Pseudoternary Manchester, Diff. Manchester .4 .2 .2 .4 .6 .8 1.0 1.2 1.4 1.6 1.8 2.0 Normalized Frequency (f/R) 86 Communications Interface Destination WS SourceWS Information Exchange •Content Material •Acquisition •Conversion •Compression •Buffering •Media Access •Protocol •Segmentation •Streaming Transmission Or Network •Packet Routing •Node Switching •Buffering (Network Delay & Transmission Jitter) •Content Material •Acquisition •Conversion •Compression •Buffering •Media Access •Protocol •Reassembly •Synchronization 87 Asynchronous and Synchronous Transmission Timing problems require a mechanism to synchronize the transmitter and receiver Two solutions – Asynchronous – Synchronous 88 Asynchronous Data transmitted one character at a time – 5 to 8 bits Timing only needs maintaining within each character Resync with each character 89 Asynchronous (diagram) 90 Asynchronous - Behavior In a steady stream, interval between characters is uniform (length of stop element) In idle state, receiver looks for transition 1 to 0 Then samples next seven intervals (char length) Then looks for next 1 to 0 for next char Simple Cheap Overhead of 2 or 3 bits per char (~20%) Good for data with large gaps (keyboard) 91 Synchronous - Bit Level Block of data transmitted without start or stop bits Clocks must be synchronized Can use separate clock line – Good over short distances – Subject to impairments Embed clock signal in data – Manchester encoding – Carrier frequency (analog) 92 Synchronous - Block Level Need to indicate start and end of block Use preamble and postamble – e.g. series of SYN (hex 16) characters – e.g. block of 11111111 patterns ending in 11111110 More efficient (lower overhead) than async 93 Synchronous (diagram) 94 Line Configuration Topology – Physical arrangement of stations on medium – Point to point – Multi point • Computer and terminals, local area network Half duplex – Only one station may transmit at a time – Requires one data path Full duplex – Simultaneous transmission and reception between two stations – Requires two data paths (or echo canceling) 95 Traditional Configurations 96 Interfacing Data processing devices (or data terminal equipment, DTE) do not (usually) include data transmission facilities Need an interface called data circuit terminating equipment (DCE) – e.g. modem, NIC DCE transmits bits on medium DCE communicates data and control info with DTE – Done over interchange circuits – Clear interface standards required 97 Characteristics of Interface Mechanical – Connection plugs Electrical – Voltage, timing, encoding Functional – Data, control, timing, grounding Procedural – Sequence of events 98 V.24/EIA-232-F ITU-T v.24 Only specifies functional and procedural – References other standards for electrical and mechanical EIA-232-F (USA) – – – – – RS-232 Mechanical ISO 2110 Electrical v.28 Functional v.24 Procedural v.24 99 Mechanical Specification 100 Electrical Specification Digital signals Values interpreted as data or control, depending on circuit More than -3v is binary 1, more than +3v is binary 0 (NRZ-L) Signal rate < 20kbps Distance <15m For control, more than-3v is off, +3v is on 101 Local and Remote Loopback 102 Procedural Specification E.g. Asynchronous private line modem When turned on and ready, modem (DCE) asserts DCE ready When DTE ready to send data, it asserts Request to Send – Also inhibits receive mode in half duplex Modem responds when ready by asserting Clear to send DTE sends data When data arrives, local modem asserts Receive Line Signal Detector and delivers data 103 Dial Up Operation (1) 104 Dial Up Operation (2) 105 Dial Up Operation (3) 106 Null Modem 107 ISDN Physical Interface Diagram 108 ISDN Physical Interface Connection between terminal equipment (c.f. DTE) and network terminating equipment (c.f. DCE) ISO 8877 Cables terminate in matching connectors with 8 contacts Transmit/receive carry both data and control 109