Chapter 4 Digital Transmission

 Digital-to-Digital Conversion  Analog-to-Digital Conversion  Transmission Modes

Wireless System Lab, NCNU 1 Digital Transmission

 Before transmission, information is converted to   Analog signal  Chapter 3 discusses advantages of digital transmission over analog transmission.  Techniques used to transmit data digitally  Digital-to-digital conversion.  Analog-to-digital conversion.  Transmission modes of data transmission.

Wireless System Lab, NCNU 2 Digital Transmission

 Before transmission, information is converted to  Digital signal  Analog signal  Chapter 3 discusses advantages of digital transmission over analog transmission.  Techniques used to transmit data digitally  Digital-to-digital conversion.  Analog-to-digital conversion.  Transmission modes of data transmission.

Wireless System Lab, NCNU 3 Chapter 4 Digital Transmission

Digital-to-Digital Conversion

Wireless System Lab, NCNU 4 Digital-to-Digital Conversion

 How to represent digital data (0101011 bit stream) by using digital signals.  Three techniques:

 Line coding

 Block coding

 Scrambling

 Line coding is always needed; block coding and scrambling may or may not be needed.

Wireless System Lab, NCNU 5 Line Coding and Decoding

 Digital data: text, numbers, images, audio, or video, are converted as bit stream.  Sender encodes digital data into digital signal.  Receiver decodes the digital signal to digital data.  Line coding maps binary information sequence into digital signal. (絞肉機)

 Ex: “1” mapped to +A square pulse; “0” to –A pulse Wireless System Lab, NCNU 6 Signal Element versus Data Element

 Data element

 The smallest entity that can represent a piece of information: this is bit.

 Signal element

 The shortest unit (timewise) of a digital signal.

 In other words

 Data element are what we need to send.

 Signal elements are what we can send.

Wireless System Lab, NCNU 7 Signal Element v.s. Data Element

 A signal element (signal) can carry multiple data elements (bits).  It is not an 1-to-1 mapping.

Wireless System Lab, NCNU 8 Data Rate v.s. Signal Rate

 Data rate ()  The number of data elements (bits) sent in 1s  The unit is bits per second (bps)  Called bit rate  Signal rate ( rate)  The number of signal elements sent in 1s  The unit is the baud  Signal rate is sometimes called the pulse rate, the rate, or the baud rate

Wireless System Lab, NCNU 9 Data Rate v.s. Signal Rate

 A signal carries r data bits, bit rate = r * signal rate.  Although the actual bandwidth of a digital signal is infinite, the effective bandwidth is finite.  The signal rate determines the effective bandwidth of digital signal.  Which one is better?

 (c: 4bits in 2 signals, d: 4bits in 3 signals)

Wireless System Lab, NCNU 10 Main Considerations of

 Transmitted power: Power consumption = $  Bit timing: Level transitions in signal (“+A””-A”) can help timing recovery  Bandwidth efficiency: Excessive transitions wastes bw  Low frequency content (DC component):

 Long periods of +A or of –A

 Waveform should not have low-frequency content, which cannot go through transformer and capacitor  Built-in error detection.  Immunity to Noise and Interference.  Complexity/cost: Is the code implementable in chip?

Wireless System Lab, NCNU 11 DC Components

 DC Components

 When the voltage level in a digital signal is constant for a while, the spectrum creates very low frequencies (results of Fourier analysis).

 These frequencies around zero, call DC (direct- current) components.

 A channel may not pass low frequencies.

 Ex: telephone line cannot pass frequencies below 200 Hz.

 A system that uses electrical coupling. (Lower frequencies cannot go through a transformer or capacitor).

Wireless System Lab, NCNU 12 Self-synchronization

 To correctly interpret the signals from the sender, the receiver's bit intervals must correspond exactly to the sender's bit intervals.  If faster or slower, the bit intervals are not matched and the receiver might misinterpret the signals.  Self-synchronization

 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.

Wireless System Lab, NCNU 13 Effect of Lack of Synchronization

 Bit intervals are different in the following example.

Wireless System Lab, NCNU 14 Self-synchronization in Coding

 A widely-used coding scheme

 0: negative, 1: positive.  Without self-synchronization:

 If a string of “1”. 1 1

Which one? 1 1 1 1 1

 With self-synchronization:

 Transitions (“+””-”) can provide timing information.

 If a string of “1”. 1 1 1 1 1

Wireless System Lab, NCNU 15 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. (103*0.1%=1)

 At 1 Mbps, the receiver receives 1,001,000 bps instead of 1,000,000 bps. (106*0.1%=1000)

Wireless System Lab, NCNU 16 Typical Line Coding Schemes

Wireless System Lab, NCNU 17 Line coding examples

1 0 1 0 1 1 1 0 0 Unipolar NRZ

Polar NRZ

NRZ-inverted (differential encoding)

Bipolar encoding

Manchester encoding Differential Manchester

encoding Wireless System Lab, NCNU 18 Spectra of Line codes

 Assume 1s & 0s independent & equally-probable

 NRZ has high content at low frequency  Bipolar tightly packed around ½ fT

1.2  Manchester wastes bandwidth NRZ 1

0.8 Bipolar

0.6

0.4 Manchester

pow erdensity 0.2

0

0 1 2

0.4 0.6 0.8 1.2 1.4 1.6 1.8 -0.2 0.2 fT Wireless System Lab, NCNU 19 Unipolar NRZ Scheme

 “1” maps to +V pulse, “0” maps to no pulse  Unipolar (單極性): all the signal levels are on one side of the time axis, either above or below.

 NRZ: non-return-to-zero (during a bit interval)

Wireless System Lab, NCNU 20 Properties of Unipolar NRZ

 High average Power: 0.5*V2 +0.5*02=V2/2  Long strings of “1” or “0”

 Poor timing

 Low-frequency content  Simple  Bit rate = signal rate.

Wireless System Lab, NCNU 21 Polar NRZ Scheme 1 0 1 0 1 1 1 0 0 Unipolar NRZ

Polar NRZ

 “1” maps to +V/2 pulse, “0” maps to –V/2 pulse  Polar (極性): Voltages are on the both sides of the time axis. (e.g., ”1”: positive; “0”: negative)  Better Average Power: 0.5*(V/2)2 +0.5*(-V/2)2=V2/4  Long strings of +V/2 or –V/2

 Poor timing

 Low-frequency content  Simple

Wireless System Lab, NCNU 22 Polar NRZ-L and NRZ-I Schemes

 NRZ-L (NRZ-Level) : Voltage level determines the value of the bit.  NRZ-I (NRZ-Invert) : Whether inversion or not determines the value of the bit. (No inversion: 0, inversion:1)  NRZ-L and NRZ-I have a DC component problem. (PSD)  Most of the energy is concentrated in frequencies between 0 and NI2.

Wireless System Lab, NCNU 23 Problems in Polar NRZ-L and NRZ-I

 Synchronization problem:

 Long string of “0” in both schemes.

 Long string of “1” affects only NRZ-L.  Sudden change of polarity

 0: negative, 1: positive  1: negative, 0: positive

 Only affects NRZ-L.

Wireless System Lab, NCNU 24 RZ scheme NRZ RZ

 Synchronization issue in NRZ: The receiver does not know when one bit ends and the next bit is starting.  One possible solution: Return-to-zero (RZ) uses three values: positive, negative, and zero.  Signal goes to 0 in the middle of each bit until the next bit.  Bit rate = ½ signal rate.

Wireless System Lab, NCNU 25 Polar RZ scheme

 No DC component (see its PSD).  Disadvantages:

 two signal changes to encode a bit and therefore occupies greater bandwidth.

 Complexity: RZ uses three levels of voltage, more complex to create and detect.  Not used today. Replaced by the better-performing Manchester schemes.

Wireless System Lab, NCNU 26 Biphase: Manchester and Differential Manchester Manchester Differential Manchester

 Biphase: The voltage remains at one level during the first half, and transits to the other level in the second half.  Transition at the middle of bit provides synchronization.  Differential Manchester: the bit values are determined at the beginning of the bit.

 Next bit: “0”, transition; “1” no transition.

Wireless System Lab, NCNU 27 Properties of Manchester and Differential Manchester

 No DC component.  Disadvantage: Min. bandwidth of Manchester and differential Manchester is twice that of NRZ.  Bit rate = ½ signal rate.

Wireless System Lab, NCNU 28 Bipolar Code

1 0 1 0 1 1 1 0 0

Bipolar Encoding

 Three signal levels: {-A, 0, +A}. (Multilevel binary)

 “1” maps to +A or –A in alternation

 “0” maps to no pulse

 Every +pulse matched by –pulse so little content at low frequencies  String of 1s will not produce a square wave

 Long string of 0s causes receiver to lose synch

Wireless System Lab, NCNU 29 Bipolar Schemes: AMI and Pseudoternary

 Alternate mark inversion (AMI):

 “0”: zero voltage.

 “1”: alternating positive and negative voltages.  Pseudoternary:

 “1”: zero. “0”: alternating positive and negative.  No DC component. Spectrum centered at N/2

Wireless System Lab, NCNU 30 Average Bandwidth 1 0 1 0 1 1 1 0 0 Unipolar NRZ

Polar NRZ

NRZ-inverted

Bipolar encoding

 Data rate = N. (r=1)  Signal rate = N. (determining the bandwidth)  By Nyquist bit rate formula: (a rough evaluation.)

 Rmax = 2*Bandwidth*log2L.

 N = 2*Bandwidth*log22  Bandwidth = N/2.

Wireless System Lab, NCNU 31 Average Bandwidth 1 0 1 0 1 1 1 0 0 Manchester encoding Differential Manchester encoding

 Data rate = N.  Signal rate = 2N. (r=½ )  By Nyquist bit rate formula:

 2N = 2*Bandwidth*log22  BW = N.

Wireless System Lab, NCNU 32 Multilevel Schemes: mBnL

 Main considerations of line coding is to

 Increase data rate for a given bandwidth.

 Decrease the required bandwidth for a given data rate.  mBnL scheme: Increase the number of bits per signal to reduce bandwidth

 Encoding m data elements into n signal elements. (m  n)  A group of m data elements can produce 2m possible data patterns. (e.g., m=4 bits, 24 =16)  L possible levels for a signal element (multilevel)  A group of n signal elements can produce Ln possible signal patterns. (e.g., L=4, n=3 signal, 43 =64)

Wireless System Lab, NCNU 33 Properties of mBnL

 If 2m =Ln, each data pattern is encoded into one signal pattern.  If 2m < Ln, data patterns occupy only a subset of signal patterns.

 Can carefully design to provide synchronization, and to detect errors.

 If 2m > Ln, data encoding is not possible

Wireless System Lab, NCNU 34 Note for mBnL

In mBnL schemes, a pattern of m data elements is encoded as a pattern of n signal elements in which 2m ≤ Ln.

Wireless System Lab, NCNU 35 mBnL 之命名

 m is the length of the binary data pattern.  B means binary data.  n is the length of the signal pattern.  L is the number of levels for the signal.

 B (binary) for L =2.

 T (ternary) for L =3.

 Q (quaternary) for L =4.

Wireless System Lab, NCNU 36 Multilevel: Scheme

 m=2 data bits in 1 signal pattern (signal).  L=4 levels for a signal.

2

Wireless System Lab, NCNU 37 Property of 2B1Q Scheme

 4 levels for a signal.

 Complexity: the receiver should discern four different thresholds.

 But can reduce bandwidth.

 r = log24=2 bits in a signal.

 By Nyquist bit rate formula: N=2*BW*log24  BW = N/4.  No redundant signal patterns in this scheme because 22 =41. 2  Used in DSL (Digital Subscriber Line).

Wireless System Lab, NCNU 38 Multilevel: 8B6T Scheme

 Used in 100BASE-4T cable (四對雙絞線).

 8-bit pattern to a pattern of 6 signal elements.  Three levels: -, 0, + (ternary).  28 =256 different data patterns and 36 =729 different signal patterns.

 729 - 256 = 473 redundant signal elements

 Synchronization.

 Error detection.

 DC balance.

Wireless System Lab, NCNU 39 Weight in 8B6T Scheme

 To achieve DC balance, the sender keeps tracking the weight of signal pattern (表示 signal pattern 電位正負).

 00010001: encoded as “- 0 - 0 + +” with weight 0

 01010011: encoded as “- + - + + 0” with weight +1. (電位偏正)  With many redundant signal patterns, we only select the encoded signal patterns with weight “0” and “+1”.  The encoded signal patterns with weight “-1” are reserved for DC balance.

Wireless System Lab, NCNU 40 DC balance in 8B6T Scheme

 If two signal patterns of weight “+1” are encountered one after another, the first one is sent as is, while the next one is totally inverted with a weight of “-1”.

 Invert the pattern (+  -, -  +) to create DC balance.  Signal patters with weight “-1” are reserved.

 If the receiver receive a signal pattern with weight “-1”, it can know that there is an inversion. (Original)

(Original) weight 0 weight +1 weight +1  weight -1

Wireless System Lab, NCNU 41 4D-PAM5

 Four-dimensional five-level pulse amplitude modulation (4D-PAM5)  4D: Data is sent over four wires simultaneously.  Five voltage levels, such as -2, -1, 0, 1, and 2.  The level 0 is used only for forward error detection.  If we consider four wires as one channel, four levels create something similar to 8B4Q.  All 8 bits can be fed into a wire simultaneously, and send one signal element per wire (4 signals in 4 wires).  Gigabit Ethernet:  Send 1-Gbps data over four copper cables. Each can handle data bit rate 1Gbps/4 = 250 bit/s.  Since r =2 bits per signal, signal rate=250/2=125M.

Wireless System Lab, NCNU 42 Multilevel: 4D-PAM5 Scheme

 Each wire carries one signal (2 bits).

 N=2*BW*log24  BW = N/4

Wireless System Lab, NCNU 43 Multiline Transmission: MLT-3

 The multiline transmission, three level (MLT-3)  Three levels (+V, 0, and –V).  Three transition rules to move the levels

 If the next bit is 0, there is no transition (No self-synchronization)

 If the next bit is 1 and the current level is not 0, the next level is 0.

 If the next bit is 1 and the current level is 0, the next level is the opposite of the last nonzero level.

 No DC component.  Why do we need to use MLT-3?

 The minimum signal rate for MLT-3 is N/4.

 This makes MLT-3 a suitable choice when we need to send 100 Mbps on a copper wire that cannot support more than 32 MHz (frequencies above this level create electromagnetic emission).

Wireless System Lab, NCNU 44 Multitransition: MLT-3 Scheme

State: the level of previous signal

The minimum signal rate for MLT-3 is N/4.

Wireless System Lab, NCNU 45 & mBnB codes

1 0 1 0 1 1 1 0 0 Manchester Encoding

 “1” maps into A/2 first T/2, -A/2  mBnB line code last T/2  Maps block of m bits into n  “0” maps into -A/2 first T/2, A/2 bits last T/2  Manchester code is 1B2B  Every interval has transition in code middle  2B1Q code used in DSL  Timing recovery easy  code in FDDI LAN  Uses double the minimum  8B10b code in Gigabit bandwidth Ethernet  Simple to implement  64B66B code in 10G  Used in 10-Mbps Ethernet & Ethernet other LAN standards Wireless System Lab, NCNU 46 1 0 1 0 1 1 1 0 0 NRZ-inverted (differential encoding) Differential Manchester encoding  Errors in some systems cause transposition in polarity, +A become –A and vice versa  All subsequent bits in Polar NRZ coding would be in error  Differential line coding provides robustness to this type of error  “1” mapped into transition in signal level  “0” mapped into no transition in signal level

 Also used with Manchester coding 47 Summary of Line Coding Schemes

 Bandwidth, Self-sync, DC.  4D-PAM5: B=N/8 (in each wire)

No DC

Wireless System Lab, NCNU 48 Block Coding

 Block coding maps a block of m bits into a block of n bits. (Generally, n > m).

 New signal stream contains more signal bits than original bit stream.

 Code redundancy

 To ensure synchronization

 To provide inherent error detecting  Block coding is referred to as an mB/nB encoding technique. (B: binary level)

 For example:

 4B/5B encoding means a 4-bit code for a 5-bit group.

Wireless System Lab, NCNU 49 Note

Block coding is normally referred to as mB/nB coding; it replaces each m-bit group with an n-bit group. (n > m).

Wireless System Lab, NCNU 50 Block Coding Concept

Wireless System Lab, NCNU 51 Example: Using Block Coding 4B/5B with NRZ-I Line Coding Scheme

 NRZ-I has synchronization problem if long string of “0”.  One possible solution: 4B/5B + NRZ-I  4B/5B can change the bit stream, before NRZ-I, without long stream of “0”s.  The 4B/5B block-coded stream does not have more that three consecutive “0”s.

1 0 1 0 1 1 1 0 0 NRZ-inverted

Wireless System Lab, NCNU 52 4B/5B Encoding

 5-bit output replaces the 4-bit input  No more than one leading zero (left bit) and no more than two trailing zeros (right bits).

 00111, 11000.

 Thus, no more than three consecutive 0s.

 Three consecutive “0”s: 10100 + 01011 (two group)  4-bit: 24=16 possible combinations  5-bit: 25=32 possible combinations (Some are used as control sequence; some are not used)  If a 5-bit group arrives which is the unused combination.

 Rx knows an error in the transmission. (error detection)

Wireless System Lab, NCNU 53 4B/5B Mapping Codes

 No more than one leading zero (left bit) and no more than two trailing zeros (right bits).

Wireless System Lab, NCNU 54 Properties of 4B/5B Encoding

 4B/5B encoding solves the synchronization problem of NRZ-1. (no more then three consecutive “0”s)  Note that it increases the signal rate.

 4 bits => 5 signals.

 Redundant bits add 20 percent overhead. (80% efficiency)

 Better than the biphase scheme which has a twice the bandwidth of NRZ-1.  DC component

 If DC component is unacceptable, biphase or bipolar encoding.

Wireless System Lab, NCNU 55 Example

 We need to send data at a 1-Mbps rate.  What is the minimum required bandwidth, using a combination of 4B/5B and NRZ-I or Manchester coding?  Solution  4B/5B increases the signal rate to 1*5/4 = 1.25 Mbps.  Min. bandwidth for NRZ-I is N/2 = 625 kHz. (Nyquist bit rate)  Manchester scheme needs a min. bandwidth of 1 MHz.  4B/5B + NRZ-I: lower bandwidth, but with DC component problem;  Manchester : higher bandwidth, but noDC component.

Wireless System Lab, NCNU 56 8B/10B Block Encoding

 Provides better error detection capability than 4B/5B.  A combination of 5B/6B and 3B/4B encoding.  The first 5 bits of a 8-bit block is fed into the 5B/6B encoder;  The last 3 bits is fed into a 3B/4B encoder.  5+3B/6+4B = 8B/10B  Simplify the mapping table. (210=1024, 26+24=64+16)

Wireless System Lab, NCNU 57 Disparity (非同位)

 Disparity controller : Prevent a long run of consecutive “0”s or “1”s, by tracking the number of “0”s and “1”s.  If more “0”s in the previous block and more “0”s in the current block,  Each bit in the current block is complemented (0 1 and 1  0)

 The coding has 210 - 28 = 768 redundant block codes for disparity checking and error detection.  Better built-in error-checking capability and better synchronization than 4B/5B .

Wireless System Lab, NCNU 58 Scrambling Biphase

 Biphase schemes that are suitable for dedicated links between stations in a LAN (self-sync and no DC), but are not suitable for long-distance communication due to wide bandwidth requirement.

 Block coding (4B/5b) + NRZ-I line coding is not suitable for long- distance encoding, due to DC component problem.  Bipolar AMI encoding has a narrow bandwidth, and does not create a DC component.  However, a long sequence of “0”s destroys synchronization.

 If we can find a way to avoid a long sequence of “0”s in the original bit stream, we can use bipolar AMI for long distances.

 One solution is called scrambling.

Wireless System Lab, NCNU 59 B8ZS

 Bipolar with 8-zero substitution (B8ZS)

 Commonly used in North America

 Eight consecutive zero-level voltages are replaced by the sequence 000VB0VB.

 “V” in the sequence denotes violation; that is a nonzero voltage that breaks the original AMI rule of encoding.

 “B” in the sequence denotes bipolar, which means a nonzero level voltage according to the AMI rule.

NDSL Copyright@2008 60 Violation in B8ZS Scrambling Technique

AMI rule:  “0”: zero voltage.  “1”: alternating positive and negative voltages.

Wireless System Lab, NCNU 61 Bandwidth and DC Component in B8ZS

 Scrambling in this case does not change the signal rate. (# of siganl is the same.)

 DC balance is maintained (two positives and two negatives in 000VB0VB)

Wireless System Lab, NCNU 62 AMI Used with Scrambling

 In the receiver, “violation” indicates that there are eight consecutive zero-level voltages.

Wireless System Lab, NCNU 63 Note

B8ZS substitutes eight consecutive zeros with 000VB0VB.

Wireless System Lab, NCNU 64 HDB3

 High-density bipolar 3-zero (HDB3)

 Used outside of North America

 Four consecutive zero-level voltages are replaced with 000V or B00V.

 1. If # of nonzero pulses after the last substitution is odd, the substitution pattern is 000V.

 2. If # of nonzero pulses after the last substitution is even, the substitution pattern will be B00V.

 By doing so, the total number of nonzero pulses is always even.

Wireless System Lab, NCNU 65 Different Situations in HDB3 Scrambling Technique

Consecutive violations “V” have differing polarity, separated by an odd number of normal B marks

Wireless System Lab, NCNU 66 Note

HDB3 substitutes four consecutive zeros with 000V or B00V depending on the number of nonzero pulses after the last substitution.

Wireless System Lab, NCNU 67 Chapter 4 Digital Transmission

Analog-to-Digital Conversion

Wireless System Lab, NCNU 68 Why Needs Analog-to-Digital Conversion?

 In the last section, we discuss digital-to-digital conversion by coding.  In real life, we may have an analog signal created by a microphone or V8.  We should change the analog signal to digital data. (analog-to-digital conversion)

 Pulse code modulation (PCM)

 Delta modulation (DM)

Wireless System Lab, NCNU 69 Digitization of Analog Signals

1. Sampling: obtain samples of x(t) at fixed-spaced time intervals 2. Quantization: map each sample into an approximation value of finite precision

 Pulse Code Modulation: telephone speech

 CD audio 3. Compression (source coding): to lower bit rate further, apply additional compression method

 Differential coding: cellular telephone speech

 Subband coding: MP3 audio (實驗發現人類聽覺所能聽 到的聲音頻率約為20Hz到20kHz之間)

4. Coding: digital-to-digital conversion.

Wireless System Lab, NCNU 70 Components of PCM Encoder

 1. The analog signal is sampled.  2. The sampled signal is quantized to binary bit stream.  3. The quantized values are encoded as streams of bits.

Wireless System Lab, NCNU 71 Three Different Sampling Methods for PCM

 Ideal sampling needs a very high-speed switch.  In natural sampling, shape of analog signal is retained.  Most common sampling method: sample and hold, flat- top sampling.  Sampling can be referred to as pulse amplitude modulation (PAM).

Note: Sampling results are still analog signal with non-integral values.

Wireless System Lab, NCNU 72 Signal Bandwidth and Sampling Rate

 Signal bandwidth measures how fast a signal varies.

 A signal varying faster needs to be sampled more frequently.

1 0 1 0 1 0 1 0 1 1 1 1 0 0 0 0 x (t) x1(t) 2 ......

t t

1 ms 1 ms  What is the signal bandwidth?  How is bandwidth related to sampling rate?

Wireless System Lab, NCNU 73 Periodic Signals

 A periodic signal with period T can be represented as sum of sinusoids using Fourier Series:

x(t) = a0 + a1cos(2pf0t + f1) + a2cos(2p2f0t + f2) + …

+ akcos(2pkf0t + fk) + …

“DC” fundamental kth harmonic long-term frequency f0=1/T average first harmonic

•|ak| determines amount of power in kth harmonic

•Amplitude specturm |a0|, |a1|, |a2|, …

Wireless System Lab, NCNU 74 Example Fourier Series

1 0 1 0 1 0 1 0 1 1 1 1 0 0 0 0 x1(t) x2(t) ......

t t

T = 1 ms, f =1000 T1 =0.25 ms, f1=4000 2 2

4 4 x (t) = 0 + cos(2p4000t) x (t) = 0 + cos(2p1000t) 1 p 2 p 4 4 3p 3p + cos(2p3(4000)t) + cos(2p3(1000)t) 4 4 5p 5p + cos(2p5(4000)t) + … + cos(2p5(1000)t) + …

Only oddWireless harmonics System Lab,have NCNU power 75 Signal Spectra & Bandwidth

Spectrum of x1(t)  Spectrum of a signal: 1.2 magnitude of amplitudes as 1 0.8 a function of frequency 0.6 0.4

0.2

0  0 3 6 9 x1(t) varies faster in time & 12 15 18 21 24 27 30 33 36 39 42 has more higher frequency frequency (kHz) content than x (t) 2 Spectrum of x2(t)

1.2

1  Signal bandwidth Ws: range 0.8 0.6 of frequencies where the 0.4 signal has non-negligible 0.2 0

0 3 6 9 power, e.g. range of band 12 15 18 21 24 27 30 33 36 39 42 frequency (kHz) that contains 99% of total signal power Wireless System Lab, NCNU 76 Bandwidth of General Signals “speech”

s (noisy ) | p (air stopped) | ee (periodic) | (stopped) | ch (noisy)

 Not all signals are periodic  E.g. voice signals varies according to sound X(f) Spectrum of  Vowels are periodic, “s” is noiselike long-term signal  Spectrum of long-term signal  Averages over many sounds, many speakers  Involves Fourier transform f  Telephone speech: 4 kHz 0 Ws  CD Audio: 22 kHz

Wireless System Lab, NCNU 77 Sampling Theorem According to the Nyquist theorem, the sampling rate must be at least 2 times the highest frequency contained in the signal.

 Nyquist sampling rate: fsampling = 2*BWs

 BWs: bandwidth of signal

 Nyquist bit rate: Rmax = 2*BWc

 BWs: bandwidth of channel

Wireless System Lab, NCNU 78 Sampling and Construction

Nyquist: Perfect reconstruction if sampling rate 1/T  2Ws

(a) x(t) x(nT)

t Sampler t

(b)

x(nT) x(t)

t Interpolation t filter

Wireless System Lab, NCNU 79 Nyquist Sampling Rate for Low-Pass and Bandpass Signals

 Sampling rate must be at least 2 times the

highest frequency (fmax) in the signal. (fs  2 fmax)

 Regardless of the bandwidth of signal (fmax-fmin).

Wireless System Lab, NCNU 80 Recovery of a Sampled Sine Wave for Different Sampling Rates

 Sampling rate fs= 2f, 4f, ¾ f

 fs  2f (2f, 4f) can well recover the signal.

3/4 Wirelessf System Lab, NCNU 81 Example

 Telephone companies digitize voice by assuming a maximum frequency of 4000 Hz. The sampling rate therefore is 8000 samples per second.

 A complex low-pass signal has a bandwidth of 200 kHz. What is the minimum sampling rate for this signal?  Solution  The bandwidth of a low-pass signal is between 0 and f, where f is the maximum frequency in the signal.  Therefore, we can sample this signal at 2 times the highest frequency (200 kHz). The sampling rate is therefore 400k samples per second.

Wireless System Lab, NCNU 82 Example

 A complex bandpass signal has a bandwidth of 200 kHz. What is the minimum sampling rate for this signal?  Solution  We cannot find the minimum sampling rate in this case because we do not know where the bandwidth starts or ends. We do not know the maximum frequency in the signal.

Wireless System Lab, NCNU 83 Quantization

 Sampling results by PAM are still analog signal with arbitrary non-integral values.  Quantization to convert analog signal to digital signal (0101 signal stream).

 Map the infinite possibility of amplitude values onto a finite set of quantized values.

 Uniform and non-uniform quantization.

 Signal recovery.

Wireless System Lab, NCNU 84 Procedure of Uniform Quantization

 1. The original analog signal has instantaneous

amplitudes between Vmin and Vmax

 Vmin = -20 ; Vmax = +20V

 2. Divide the range into L zones, each of height

=(Vmax -Vmin)/L  L=8, =40/8=5 V

 8 zones: -20~-15V, -15~-10V, -10~-5V, -5~0V, 0~5V, 5~10V, 10~15V, 15~20V.

 3. Assign quantized values to the midpoint of each zone.

 8 quantized values: -17.5V, -12.5V, -7.5V, -2.5V, 2.5V, 7.5V, 12.5V, 17.5V.

Wireless System Lab, NCNU 85 Procedure of Uniform Quantization

 4. Assign codewords for 8 zones: “0”~”7”

 8 zones: “0”: -20~-15V, “1”: -15~-10V, “2”: -10~-5V, “3”: -5~0V, “4”: 0~5V, “5”: 5~10V, “6”: 10~15V, “7”: 15~20V.

 5. Approximate the value of the sample amplitude to the quantized values.

 Amplitude sample in (-20V, -15V)  Codeword = “0”  Quantized values = -17.5 V

Wireless System Lab, NCNU 86 Quantization and Encoding • Normalized amplitude value = Actual amplitude / 

• The range Vmin = -20 ~ Vmax = +20V is normalized as -4 ~ 4

Original values

Wireless System Lab, NCNU 87 Quantization Levels

 If L = 23=8 zones, 3 signal bits for each sample (each quantization result).  The more zones, the smaller  which results in smaller errors.  But, the more bits required to encode the samples  higher bit rate.  Usually, L=256 for audio. (Compare the case of L=2, “+”, “-”)

Wireless System Lab, NCNU 88 Quantization Level and Error  Quantizer maps original input into closest of quantized value. output y(nT) 3.5 2.5  Quantization error: 1.5 0.5 -4 -3 -2 - “noise” = y(nT) – x(nT) -0.5 3 4  2  Quantized value 1.5 for the -1.5 input x(nT) -2.5 original value in (, 2] -3.5  -0.5  Quantization error  0.5 

Original signal (black) Sample value 7/2 Quantized value 5/2 Approximation 3/2 signal (orange) /2 -/2 -3/2 3 bits bits sample / 3 -5/2 89 -7/2 Quantization

 With a 3 bit ADC this gives 23 = 8 levels.  With a 5 bit ADC this gives 25 = 32 levels.

 The digital output is more closely to the analogue input.

3 bit ADC 5 bit ADC

Image source: http://www.diracdelta.co.uk

Wireless System Lab, NCNU 90 Approximation Signal

 3 bit ADC v.s. 5 bit ADC.  By increasing the ADC to 5 bit, the digital representation is much closer to the original signal.

3 bit ADC (8 levles) 5 bit ADC (32 levels)

Image source: http://www.diracdelta.co.uk

Wireless System Lab, NCNU 91 Quantization Error

 If the input value is exactly at the middle of the zone, there is no quantization error; otherwise, there is an error.  The contribution of the quantization error to the

SNRdB of the signal depends on  The number of quantization levels L

 or the bits per sample nb=log2L

SNRdB = 6.02nb + 1.76 dB

More levels, more bits per sample, higher resoultion  less error, higher SNR.

Wireless System Lab, NCNU 92 Example

 What is the SNRdB in the example of Figure 4.26?  Solution  We can use the formula to find the quantization. We have eight levels and 3 bits per sample, so

SNRdB = 6.02(3) + 1.76 = 19.82 dB

Increasing the number of levels increases the SNR.

Wireless System Lab, NCNU 93 Example

 A telephone subscriber line must have an SNRdB above 40. What is the minimum number of bits per sample?  Solution  We can calculate the number of bits as

 Telephone companies usually assign 7 or 8 bits per sample.

Wireless System Lab, NCNU 94 Non-uniform Quantization

 Uniform versus nonuniform quantization

 The instantaneous amplitudes of the analog signal is not uniform distributed.

 Ex. Lower amplitudes occur more frequently than the higher ones. (e.g., audio)

 Higher resolution for lower amplitude.

95 Encoding

 # of quantization levels = L

 # of signal bits per sample nb = log2L.  Signal bit rate = sampling rate x number of bits per sample

= fs x nb

Wireless System Lab, NCNU 96 Example

 We want to digitize the human voice. What is the bit rate, assuming 8 bits per sample?  Solution  The human voice normally contains frequencies from 0 to 4000 Hz. So the sampling rate and bit rate are calculated as:

Wireless System Lab, NCNU 97 Components of a PCM Decoder

Smoother

Wireless System Lab, NCNU 98 PCM Bandwidth  Q: Minimum bandwidth to pass a digitized PCM signal.

 Bandwidth of analog signal: Banalog

 Sampling rate: 2*Banalog (by Nyquist sampling rate)

 # of signal bits per sample: nb

 Signal bit rate: 2*Banalog*nb

 # of amplitude levels for a signal: L (one signal carries r = log2L bits)

 Min. bandwidth: Bmin (by Nyquist data rate)

2*Banalog*nb = 2*Bmin*log2L  Bmin = nb*Banalog/log2L

Increasing bandwidth. It is the cost of digitization.

Wireless System Lab, NCNU 99 Example

 We have a low-pass analog signal of 4 kHz. If we send the analog signal, we need a channel with a minimum bandwidth of 4 kHz.  If we digitize the signal and send 8 bits per sample, we need a channel with a minimum bandwidth of 8 × 4 kHz = 32 kHz.

Wireless System Lab, NCNU 100 Digital Transmission of Analog Information

2W samples / sec m bits / sample Analog Sampling Quantization source (A/D)

Original x(t) 2W m bits/sec Bandwidth W Transmission or storage Approximation y(t)

Display Interpolation Pulse or filter generator playout 2W samples / sec

Wireless System Lab, NCNU 101 Delta Modulation

 Bit stream does not present the amplitude, but presents the amplitude fluctuation.  Compare the analog value and staircase value.

 Analog(t)-staircase(t-1)  0 : “1”, increase δ.

 Analog(t)-staircase(t-1) < 0 : “0”, decrease δ.

Wireless System Lab, NCNU 102 Delta Modulation Components

 Comparator: compare analog(t) and staircase(t-1)  Staircase marker.  Delay unit. 

Wireless System Lab, NCNU 103 Delta Demodulation Components

 Low-pass filter: smoother.

Wireless System Lab, NCNU 104 Properties of DM

 DM works well for small changes in signal values between samples.  If changes in amplitude are large, DM will result in large quantization errors.  Decoding error will propagate.

Wireless System Lab, NCNU 105 Adaptive DM

 Adaptive delta modulation

 A better performance can be achieved if the value of δ is not fixed.

 The value of δ changes according to the amplitude (or amplitude fluctuation) of the analog signal.

 Quantization Error

 DM is not perfect.

 Quantization error is always introduced in the process.

 Much less quantization error than that for PCM.

Wireless System Lab, NCNU 106 Chapter 4 Digital Transmission

Transmission Modes

Wireless System Lab, NCNU 107 Chapter 4 Digital Transmission

Transmission Modes

Wireless System Lab, NCNU 108 Transmission Modes

 Sending digital data across a link can be accomplished in either parallel or serial mode.  In parallel mode, multiple bits are sent with each clock tick.  In serial mode, 1 bit is sent with each clock tick.  Parallel transmission can be achieved by only one way.  Three subclasses for serial transmission: asynchronous, synchronous, and isochronous.

Wireless System Lab, NCNU 109 Data Transmission and Modes

非同步 同步 等時

Wireless System Lab, NCNU 110 Parallel Transmission (平行傳輸)

 Send data a group of n bits at a time instead of 1 bit. (n = 8 bits, byte).  Use n wires to send n bits at one time.  Advantage: speed.  Disadvantage: cost. n lines, for short distance comm.

Wireless System Lab, NCNU 111 Serial Transmission (序列傳輸)

 Send data one bit by one bit.  Only one wire; inexpensive.  If communication within devices is parallel, conversion devices are required.  Asynchronous v.s. synchronous transmissions.

Wireless System Lab, NCNU 112 Asynchronous Transmission

 Without synchronization, the receiver cannot predict when the next byte will arrive.  Need 1 start bit (0) at the beginning and 1 or more stop bits (1s) at the end of each byte.  A random-duration gap between each byte.  Cheap and effective, but overhead for start and end bits.  Used in the connection of a keyboard to a computer. Wireless System Lab, NCNU 113 Note

Asynchronous here means “asynchronous at the byte level,” but the bits are still synchronized; their durations are the same.

Wireless System Lab, NCNU 114 Synchronous Transmission

 Bit stream is grouped into "frames“, containing multiple bytes.  The gaps between data frames are filled with special idle sequence of “0”s and “1”s, to maintain synchronization.  Send data as an unbroken string of “1”s and “0”s.  By detecting the idle sequence, receiver can separate the string into the bytes.  Less overhead, higher throughput.

Wireless System Lab, NCNU 115 Note

In synchronous transmission, we send bits one after another without start or stop bits or gaps. It is the responsibility of the receiver to group the bits to bytes (frames).

Wireless System Lab, NCNU 116 Asynchronous, Synchronous, Isochronous

Bit duration Random-duration gap

Asynchronous 0 0 1 1 0 1 0 0 0 1 0 0 1 1 0 1 0 0 0 1

Synchronous

0 0 1 1 0 1 0 0 0 1 Idle sequence 0 0 1 1 0 1 0 0 0 1 Frame Frame

Time

Wireless System Lab, NCNU 117 Isochronous

 In isochronous transmission, we cannot have unequal gaps between frames.  Transmission of data bits is fixed with equal gaps.

Wireless System Lab, NCNU 118 SNR for Uniform Quantization

 The quantization introduce quantization errors to the signal.  Quantization errors can be treated as noise.  If the number of levels L is large, then the quantization error q can be approximately uniformly distributed between (-Δ/2, Δ2) / 2 2 2 1 2  Average error power =    q dq   /12 -/ 2  Uniform distributed

 Uniform quantization: Vmax divided into L levels.

 Each sample is encoded as nb = log2L bits

nb   2Vmax / L  2Vmax / 2 

2 2 2nb  Average error power =  Vmax /32

Wireless System Lab, NCNU 119 SNR for Uniform Quantization

2n  Average error power = 2 2 b  Vmax /32  Signal-to-Noise Ratio = Avg signal power / Avg noise power

2 2nb 2 = P /  32  P /Vmax

Wireless System Lab, NCNU 120 SNR for Uniform Quantization

 For a full amplitude triangle waves and sawtooth

waves (Vmax)

Vmax 1 P  v2 dv V 2 / 3  2V max -Vmax max

2 2nb 2 2nb 2nb SNR  P /  32  P /Vmax  2 10log(2 ) dB  6.02 nb (dB)

V max

- V max

Wireless System Lab, NCNU 121 SNR for Uniform Quantization

 For a full amplitude sinusoid waves (Vmax)

1 T P  V sint 2 dt  V 2 / 2   max  max T 0

2 2nb 2 2nb SNR  P /  32  P /Vmax  3/ 22  1.76 6.02 nb (dB)

Wireless System Lab, NCNU 122