ECE8700 Communications System Engineering Chapter 6 Lecture 4 Conversion of Analog

Yimin D. Zhang, Ph.D. Waveforms into Coded Pulses

Department of Electrical & Computer Engineering Villanova University

Spring 2014

Y. D. Zhang ECE-8700 Spring 2014 2

Outlines Pulse

 Sampling Process … PAM . Sampling Theorem . Nyquist Rate

 Pulse-Amplitude (PAM) Sampling Continuous- Analog Pulse  Quantization Wave Modulation Modulation . Uniform and non-uniform quantization Quantization . Quantization noise … PCM Coding  Pulse-Code Modulation (PCM)

 Delta Modulation . Delta-Sigma Modulation Digital Pulse Modulation  Line Codes Y. D. Zhang ECE-8700 Spring 2014 3 Y. D. Zhang ECE-8700 Spring 2014 4 Sampling Process: Sampling Process: Time-Domain Representations Frequency-Domain Representations G( f )  Ideally sampled signal of a continuous- 1 wave signal g(t) g(t) . Through periodic sampling  W W f . Product of the continuous-wave signal  t P( f )  f s ( f  k f s) and a sequence of impulses 2 fs k  p(t) p(t)   (t  nTs ) n f  2 fS  fS 0 fS 2 fS t g(t) g (t)  Multiplication in the time domain yields convolution in  2T T 0 T 2T s s s s frequency domain.  g() t gtpt () () gt () ( t  nT ) g (t)    s  gt() gt () ( t nT )  n    s Alias due to sampling n  gnT()(s  t nTs )  n  t GfGfPffGfmffGffGfmf () ()*() s  ( ss ) () s (  s )  2Ts  Ts 0 Ts 2Ts mm  Ts : sampling period; fs =1/Ts : sampling rate m0 Y. D. Zhang ECE-8700 Spring 2014 5 Y. D. Zhang ECE-8700 Spring 2014 6

Sampling Process: Sampling Process: Frequency-Domain Representations Frequency-Domain Representations G( f ) 1 G( f ) 1

 W W f   W W f P( f )  f ( f  k f )  2 f s  s s k P( f )  f s ( f  k f s) 2 fs k

 2 f  f 0 f 2 f f S S S S f  2 fS  fS 0 fS 2 fS

 Iffs  2W , the replicas of G( f ) do not overlap.

G ( f ) f s

f  2 fS  fS  W 0 W f S 2 fS f S W Y. D. Zhang ECE-8700 Spring 2014 7 Y. D. Zhang ECE-8700 Spring 2014 8 Sampling Process: Sampling Theorem Sampling Process : Signal Recovery

 [Sampling Theorem] If G( f )=0 for f  W (band limited

signal) and fW s  2 (with sufficient sampling rate). Then, G( f ) can be obtained by properly filtering G( f ).  Otherwise, aliasing phenomenon occurs. (a) Anti-alias filtered  2W: Nyquist rate; 1/(2W): Nyquist interval spectrum of an information-bearing signal.

(b) Spectrum of instantaneously sampled version of the signal, assuming the use of a : Complete recovery of the original signal is possible. fs  2W sampling rate greater than the Nyquist rate.

(c) Magnitude response of reconstruction filter.  2 (Undersampled): original signal cannot be completely recovered. fs W Y. D. Zhang ECE-8700 Spring 2014 9 Y. D. Zhang ECE-8700 Spring 2014 10

Sampling Process : Signal Recovery Sampling Process : Signal Recovery

 Ideal low-pass filter with cut-off frequency W  Recovery of the sampled signal (assume f ss  2; WT 1/(2) W ) g(t)  1  , f  W HLPF ( f ) H LPF ( f )  2W 1/(2W) GfrLPF() GfH () () f  0, f  W  g (t) f   The impulse response is r g( )t  g ( )t*LPFh ( )t W 0 W   T  s T  s  g (  nT)sinc 2 W( t ) d hLPF (t)     s  sin(2Wt) 1  n 2 W  h (t)   sinc(2Wt)  LPF  2Wt s T  gr (t) t  g sinc2 Wt  n n  2 W 

3 1 1 1 1 3    0 2W W 2W 2W W 2W Ts Y. D. Zhang ECE-8700 Spring 2014 11 Y. D. Zhang ECE-8700 Spring 2014 12 Sampling Process : Examples Pulse-Amplitude Modulation (PAM)

g(t)=cos(4000 t)  W =2000 Hz, Nyquist rate 2W=4000 Hz  A train of impulse sequences is good, but not practical.

At sampling freq f = 6000 Hz: At sampling freq f = 1500Hz: s s  PAM uses flat-top samples to substitute impulses. No aliasing: Nyquist sampling Aliasing occurred: Nyquist  Pros: limit the bandwidth; can use higher power theorem is satisfied. sampling theorem not satisfied.  Cons: aperture effect – discussed below PAM waveform s(t) can be considered as convolution of impulse train and rectangular window

Flat-top samples, representing an analog signal

Y. D. Zhang ECE-8700 Spring 2014 13 Y. D. Zhang ECE-8700 Spring 2014 14

PAM : Aperture Effect PAM : Aperture Effect

 Distortion in the magnitude and time  If the duty cycle T/Ts is small ( T / T s  0 . 1 ), then the delay due to the use of flap-top pulse. aperture effect is insignificant.

H()f T sinc()exp(f T jf T )  Otherwise, equalizer has to be applied, with magnitude (linear phase delay causes constant time response delay of T/2 without no waveform 11 f distortion)  | H()f | Tsinc(f T ) sin( f T )

Org signal spectrum

PAM signal spectrum

Y. D. Zhang ECE-8700 Spring 2014 15 Y. D. Zhang ECE-8700 Spring 2014 16 Other Forms of Pulse Modulation PDM & PPM : Observations

 Pulse-Duration Modulation  PDM is energy-inefficient (PDM) or Pulse-Width  PPM Modulation (PWM) . For perfect rectangular pulse (which requires high  Pulse-Position Modulation bandwidth), the effect of noise is negligible. (PPM) . Exhibit a threshold effect as the SNR is low Figures: PDM and PPM for the . Used in Ultra-Wideband (UWB) communications case of a sinusoidal modulating wave. (a) Modulating wave. (b) Pulse carrier. (c) PDM wave. (d) PPM wave.

Y. D. Zhang ECE-8700 Spring 2014 17 Y. D. Zhang ECE-8700 Spring 2014 18

Effective Data Representation Quantization : Example

 24 bits (8-bit in each color)  6 bits (2-bit in each color)

 How many bits you need to represent 8 levels of information (0 ~7)? Amplitude based Code based

Level 6 Binary code 110 . A 75% reduction of file size in raw data format can be expected; It does not necessarily reflect that in a compressed file format. . Quantization is a lossy operation.

Y. D. Zhang ECE-8700 Spring 2014 19 Y. D. Zhang ECE-8700 Spring 2014 20 Quantization Quantization

 Consider memoryless or instantaneous quantization  Quantization: Transform the continuous-amplitude m=m(nTs) process, we remove nTs for notational convenience. to discrete approximate amplitude v=v(nTs).  Such a discrete approximate is adequately good in the  Types of quantization: sense that any human ear or eye can detect only finite Uniform: Quantization step sizes are equal intensity differences. Non-uniform: Quantization step sizes are not equal

Mid-read Mid-rise

Description of a memoryless quantizer. ( (a) midtread (b) midrise

Y. D. Zhang ECE-8700 Spring 2014 21 Y. D. Zhang ECE-8700 Spring 2014 22

Quantization Noise Quantization Noise

 Define the quantization noise to be QMVMgM()  Consider uniform quantization. Assume message M is uniformly distributed in (–mmax, mmax), so M has zero mean.  Assume g(.) is symmetric. Then V=g(M) also has zero mean. Therefore, Q=M–V also has zero mean.

 If we choose [-mmax, mmax] as the quantization range (full-load quantizer), then the step size of the quantizer is given by 2m  max L where L is the total number of representation levels.

Y. D. Zhang ECE-8700 Spring 2014 23 Y. D. Zhang ECE-8700 Spring 2014 24 Quantization Noise Quantization Noise

 Quantization error is bounded by /2 q   /2  If we construct a binary code, and denote R as the bits per samples, then R RL log ( )  If the step size D is sufficiently small, it is reasonable to L  2 2 assume that Q is a uniformly distributed random variable. That is,  Rewrite the mean-square value of the quantization noise as  1   , q 2 2 22  22 2  112mmmmax max max   Q  22 R 12 12LL 3 3 2 fqQ ()    0, otherwise  Then, the output SNR (signal to quantization noise ratio) of  a uniform quantizer is given by

PP3 2 R  Its mean-square value is given by ()SNR O 22 2 2  Q m max /21 /2   22EQ[] q 2 f () qdq  qdq 2  QQ/2  /2  12  The SNR increases exponentially with the R: (SNR)O (dB) = a + 6R (the value of a varies) Y. D. Zhang ECE-8700 Spring 2014 25 Y. D. Zhang ECE-8700 Spring 2014 26

Example: Sinusoidal Modulating Signal Effect of Quantization Loading Level

A 2  Let mt ()  A cos(2  ft ). Then, P  m , mA , mc 2 max m 2 33P 222RRR3/2m max ()SNRO 22 2 2  2 (1.86)dB R mmmax max 2

LR(SNR)O 32 5 31.8 64 6 37.8 128 7 43.8 256 8 49.8  In this example, we assumed full-load quantizer, in which no quantization loss is encountered due to saturation.

 In general, (SNR)O is expressed (a + 6R) dB, with a The output SNR is reduced when full-load is not appropriate. depending on the waveform and the quantization load.

Y. D. Zhang ECE-8700 Spring 2014 27 Y. D. Zhang ECE-8700 Spring 2014 28 Non-Uniform Quantization Non-Uniform Quantization (2) -law Why: To give more protection to weak signals  A | m | 1 , 0 | m | How: Apply compressor before quantization. 1 log A A | v | 1 log( A | m |) 1 Compression laws  , | m |1 (1) -law  1 log A A

log( 1 |m |) Compression: at transmitter |v |  log( 1  ) according to the -law or A-law Expansion: at receiver to When  m 1, v  m restore the signal samples to  their correct relative level log(1  | m |)  | m |

When m 1, v log( m ) [Compressor + Expander = Compander]

Y. D. Zhang ECE-8700 Spring 2014 29 Y. D. Zhang ECE-8700 Spring 2014 30

Non-Uniform Quantization Pulse-Code Modulation (PCM)

 ITU-T G.711: PCM of Voice frequencies (1972)  A-law: Mainly used in Europe 8-bit code represents 13-bit uniformly quantized info.  -law: Mainly used in US and Japan 8-bit code represents 14-bit uniformly quantized info.

G.711 using the -law 14-bit uniform quantization (213=8192)

Y. D. Zhang ECE-8700 Spring 2014 31 Y. D. Zhang ECE-8700 Spring 2014 32 Encoding Gray Code

Decimal Gray code Binary number system for T=4 bits/samples Gray Code: A Gray code (also known 00000 Encoding process: as the reflected binary code) is a way 10001 translate the discrete of encoding binary numbers so that 20011 set of sample values only one digit changes from one 30010 to a more number to the next. That means that 40110 appropriate form of a single 0 can change to a 1, or a 50111 60101 signal. single 1 can change to a zero. 70100 It results in lower errors in the signal 81100 Symbol: one level when bit errors occur. 91101 discrete event in a 10 1111 code. 11 1110 Frank Gray (1887-1969) was a physicist 12 1010 and researcher at Bell Labs who made 13 1011 numerous innovations in television and is 14 1001 remembered for the Gray code. 15 1000 Y. D. Zhang ECE-8700 Spring 2014 33 Y. D. Zhang ECE-8700 Spring 2014 34

Differential Encoding Regenerative Repeater

Regenerative Repeater: Ideally, except for a delay, the Differential Encoding: Bit streams going regenerated signal is exactly the same as the signal originally through many channels can be un- transmitted. intentionally inverted. Most circuits can not tell if the entire stream is inverted. Modula 2 addition In practice, the regenerated signal departs from the original Differential encoding is commonly used 0+0=1+1=0, 0+1=1 signal because:

to protect against this possibility. eout =din +en-1 + 1 1. Channel noise and interference Need reference bit in the beginning. 2.

Y. D. Zhang ECE-8700 Spring 2014 36 Pulse-Code Modulation (PCM) Delta Modulation

. Delta Modulation: - Oversampling at a rate much higher than the Nyquist rate. - Use staircase approximation; The output only takes two values:  and –.

Y. D. Zhang ECE-8700 Spring 2014 37 Y. D. Zhang ECE-8700 Spring 2014 38

Delta Modulation System Delta Modulation

Two types of quantization error: - Slope-overload distortion: Occurs when  is too small. To avoid this problem,  must satisfy e[n]  m[n]  mq [n 1]  dm() t  max qe   sgn(e[n]) Tdts m [n] m [n 1] e [n] z -1: time q q q - Granular noise: Occurs when  is large relative to the local delay operator Transmitter slope. Adaptive step size may be used. n

mq [n]  sgn(e[i]) i1 n

  eq [i] i1 Receiver Y. D. Zhang ECE-8700 Spring 2014 39 Y. D. Zhang ECE-8700 Spring 2014 40 Delta-Sigma () Modulation Delta-Sigma () Modulation

 Delta modulation may be viewed as an approximation to  modulation is used Twoin A/D equivalent converter. versions of the derivative of the message signal.  modulation system.  A period of disturbances such as noise may result in accumulative error.  Integrating the message signal prior to the delta modulation can overcome this problem.  Delta-Sigma () modulation can be considered as a Combining two integrators into one results in a simpler structure. smoothed version of delta modulation:  Low-frequency component is pre-emphasized;  Correlation between adjacent samples is increased;  Design of the receiver is simplified.

Y. D. Zhang ECE-8700 Spring 2014 41 Y. D. Zhang ECE-8700 Spring 2014 42

Line Codes : Unipolar NRZ

How to design the waveform to Unipolar NRZ: [Also referred to as representFive important binary line data? codes for the on-off signaling] (a)electrical Unipolar representations nonreturn-to-zero of binary(NRZ) data signaling 01101001. Disadvantages: All figures assume (b)(a Polar) Unipolar NRZ non-return-to-zero signaling - Waste of power due symbols 0 and 1 are (NRZ) signaling. to the transmission of equiprobable. The (c) Unipolar return-to-zero (RZ) DC level (that does frequency is normalized (bsignaling) Polar NRZ signaling. with respect to the bit not carry information). rate 1/T , and the (c) Unipolar return-to-zero (RZ) b (d) Bipolar RZ signaling average power is signaling. - Power spectrum normalized to unity. (e)(d Manchester) Bipolar RZ signaling.code (split-phase near zero frequency is code) (e) Split-phase or Manchester high. DC (direct current): zero- code. frequency component.

Y. D. Zhang ECE-8700 Spring 2014 43 Y. D. Zhang ECE-8700 Spring 2014 44 Line Code: Polar NRZ Line Code: Unipolar RZ

Unipolar RZ:

Polar NRZ: Disadvantages:

Disadvantage: - Waste of power due to the - Power spectrum transmission of DC near zero frequency level; is high. - Wider signal spectrum.

Y. D. Zhang ECE-8700 Spring 2014 45 Y. D. Zhang ECE-8700 Spring 2014 46

Line Code: Bipolar RZ Line Code: Manchester Code

Bipolar RZ: [Also referred to as Manchester Code: Alternative Mark Inversion (AMI)] Advantages: - No DC Advantages: component; - No DC component; - Insignificant low- - Insignificant low- frequency frequency components. components.

Disadvantages: Disadvantage: Long strings of zeros - Wide spectrum. may cause the receivers to lose lock. Y. D. Zhang ECE-8700 Spring 2014 47 Y. D. Zhang ECE-8700 Spring 2014 48 Outlines Homework

 Sampling Process  Review Reading . Sampling Theorem . Nyquist rate . Chapter 6

 Pulse-Amplitude Modulation (PAM)  Preview Reading . Chapter 7  Quantization . Uniform and non-uniform quantization  Homework (due 2/26 at 6:15 pm) . Quantization noise . From textbook 6.2, 6.4, 6.9, 6.35, 6.36  Pulse-Code Modulation (PCM) Note: sinc function is defined as (Table 2.2, page 24)  Delta Modulation . Delta-Sigma Modulation Notice “flat-top” pulses in Problem 6.4.  Line Codes Y. D. Zhang ECE-8700 Spring 2014 49 Y. D. Zhang ECE-8700 Spring 2014 50