Principles of Communications

Meixia Tao PhD Tao,
Associate Professor Dept. of Electronic Engineering Shanghai Jiao Tong University

Chapter 4: Analog-to-Digital Conversion Analog to Digital Textbook: 7.1 – 7.4
2010/2011 Meixia Tao @ SJTU 1

Outline
Analog signal

Sampling
Discrete-time continuous-valued Discrete time continuous valued signal

Quantization
Discrete-time discrete-valued signal

Encoding
Bit mapping Digital transmission

Pulse Code Modulation

2010/2011 Meixia Tao @ SJTU

2

. Ts ≤ interval to yield the sequence 2W Then is Th it i possible t reconstruct th original ibl to t t the i i l signal x(t ) from the sampled values. let l t X ( f ) ≡ 0.e.Sampling Sampling Theorem: Let the signal x(t ) have a bandwidth W. 2010/2011 Meixia Tao @ SJTU 3 . i. for f ≥ W . L t x(t ) b sampled at ti Let be l d t time ∞ 1 { x(nTs )}n=−∞ .

Sampling Process x (t ) x s (t ) x (t ) 0 ( ) (a) t s (t ) x s (t ) 0 (c) t s (t ) 0 Ts 1 2 3 4 5 6 t The sampling process can be regarded a modulation process with carrier gi en by periodic imp lses It’s also ith given b impulses. called pulse modulation 2010/2011 Meixia Tao @ SJTU 4 (b) .

known as aliasing error -W W f Xδ ( f ) -1/Ts 1/Ts f The minimum sampling rate f s = 2W is known as Nyquist sampling rate 2010/2011 Meixia Tao @ SJTU 5 .The result of sampling can be written as xδ (t ) = n =−∞ ∑ x(nT )δ (t − nT ) = x(t ) ∑ δ (t − nT ) s s n =−∞ s ∞ ∞ Taking Fourier transform 1 ∞ ⎛ n⎞ 1 Xδ ( f ) = X ( f ) ∗ ∑ δ ⎜ f − ⎟ = Ts n =−∞ ⎝ Ts ⎠ Ts 1 1 If Ts > or f s = < 2W 2W Ts ⎛ n⎞ ∑ X ⎜ f −T ⎟ n =−∞ s ⎠ ⎝ X(f ) ∞ then the replicated spectrum of x(t) overlaps and () p reconstruction is not possible.

it is sufficient to filter the sampled signal through a LPF with frequency response The reconstruction is ⎧1 ⎪ H( f ) = ⎨ ⎪0 ⎩ ∞ f <W 1 f ≥ −W Ts x(t ) = n =−∞ ∑ 2W 'T x(nT )sinc [ 2W '(t − nT )] s s s 1 for W ≤ W ' ≤ − W Ts 2010/2011 Meixia Tao @ SJTU 6 .Reconstruction To get the original signal back.

signal point is rounded to the “nearest” value from a finite set of possible quantization levels levels. Scalar quantization Each sample is quantized individually Vector quantization Blocks of samples are quantized at a time 2010/2011 Meixia Tao @ SJTU 7 .Quantization Quantization is a rounding process each sampled process.

denoted as Rk. each called quantization region For each region Rk.Scalar Quantization The set of real numbers R is partitioned into N disjoint subsets.. k = 1. f all x ∈ R k . i. Q( x) = xk . Q( x)) = x − Q( x) 2010/2011 Meixia Tao @ SJTU 8 . a representation point called Rk point.... quantization level xk is chosen If the sampled signal belongs to region Rk then it is Rk. represented by xk .e. N for ll 1 Quantization error e( x.

Performance Measure of Quantization Signal to quantization Signal-to-quantization noise ratio (SQNR) is defined by SQNR = E [ X − Q( x)] ( E( X 2 ) 2 ) For F random variable X d i bl SQNR = 1 T /2 2 lim ∫ x (t )dt T →∞ T −T /2 → 1 T /2 2 lim ( x(t ) − Q( x(t )) ) dt T →∞ T ∫−T /2 For signal x(t) 2010/2011 Meixia Tao @ SJTU 9 .

Example The source X(t) is stationary Gaussian source with mean zero and power spectral density ⎧2 Sx ( f ) = ⎨ ⎩0 f < 100 Hz otherwise It i sampled at th N is l d t the Nyquist rate and each sample i i t t d h l is quantized using the 8-level quantizer with a0 = −∞. x8 = 70 What is the resulting distortion and rate? What is the SQNR? 2010/2011 Meixia Tao @ SJTU 10 . a7 = 60 x1 = −70. x5 = 10. a3 = −20. a2 = −40. a4 = 0. a1 = −60. x7 = 50. x3 = −30. x6 = 30. a5 = 20. x2 = −50. a6 = 40. x4 = −10.

of quantization levels is N = 2^v.Uniform Quantizer Let the range of the input samples is [-a.8 E[e 2 ] a2 a2 One extra bit increases the SQNR by 6 dB! 11 2010/2011 Meixia Tao @ SJTU . Then the length of each quantization region is given by 2a a Δ= = v −1 N 2 Quantized values are the midpoints of quantization regions regions. Then 2 2 1 2 Δ2 a2 a2 2 E[e ] = ∫ x dx = = = 2 Δ 12 2 N 3 ⋅ 4v −Δ /2 Δ Δ /2 PX 3 ⋅ 4v PX dB P SQNR = = = 10 log10 X + 6v + 4. Assuming that the quantization error is uniformly distributed on (− Δ . a] and the number [ a. Δ ) .

higher probability for smaller amplitude and lower probability for larger amplitude μ law compander A-law compander 2010/2011 Meixia Tao @ SJTU 12 . then we can minimize the distortion with less constraints. the resulting quantizer will perform better than a uniform quantizer The usual method of nonuniform quantization is to first pass the samples through a nonlinear filter and then perform a uniform quantization => Companding For speech coding.Nonuniform Quantizer If we relax the condition that the quantization regions be of equal length. therefore.

Compander μ law compander log (1 + μ | x |) g ( x) = sgn( x). | x |≤ 1 g ( log(1 l (1 + μ ) μ = 255 2010/2011 Meixia Tao @ SJTU 13 .

Compander A law compander g ( x) = 1 + log A | x | sgn( x). 6 1 8 1 4 1 2 1 x 2010/2011 Meixia Tao @ SJTU 14 . | x |≤ 1 1 + log A g y 1 6 8 4 8 1 8 A = 87 .

Optimal Quantizer Lloyd Max Lloyd-Max Conditions The boundaries of the quantization regions are the midpoints of the corresponding quantized values The quantized values are the centroids of the quantization regions. ti ti i 2010/2011 Meixia Tao @ SJTU 15 .

e. rather than doing the quantization based on single samples in a one-dim space Optimal vector quantizer to minimize distortion Region Ri is the set of all points in the n-dim space that are closer to xi than any other xj. for all j\= I.e. ∀j ≠ i xi is the centroid of the region Ri i e Ri. and design the quantizer in the n-dim Euclidean space. i. i. { } 1 xi = ∫ xf x (x)dx P(x ∈ Ri ) Ri 2010/2011 Meixia Tao @ SJTU 16 .Vector Quantization The idea of vector quantization is to take blocks of source outputs of length n. Ri = x ∈ R n : x − xi < x − x j .

Gray coding Adjacent levels differ only in one bit 2010/2011 Meixia Tao @ SJTU 17 .3 Encoding The encoding process is to assign v bits to N=2^v N 2 v quantization levels. we have a bit rate of R = vf s bits/second Natural binary coding Assign the l A i th values of 0 t N 1 t diff f to N-1 to different quantization l t ti ti levels l in order of increasing level value.4. Since there are v bits for each sample and fs samples/second.

Examples Natural binary code (NBC).5 0.5 1.5 -0. 1-complement code (1-C). 22 complement code (2-C).5 -1.5 35 18 2010/2011 Meixia Tao @ SJTU . and Gray code Level no 7 6 5 4 3 2 1 0 NBC 111 110 101 100 011 010 001 000 FBC 011 010 001 000 100 101 110 111 2-C 011 010 001 000 100 111 110 101 Gray code 100 101 111 110 010 011 001 000 Amplitude level 3.5 -3.5 -2.5 35 2. folded binary code (FBC).

then p g BWreq R = = vW Hz 2 2010/2011 Meixia Tao @ SJTU 19 .Pulse Code Modulation (PCM) Systems Block diagram of a PCM system x(t ) {xn } ˆ {xn } Sampler Quantizer Encoder {K 0110 K} Bandwidth requirement: If a signal has a bandwidth of W and v bits are used for each sampled signal.

fewer bits are required 2010/2011 Meixia Tao @ SJTU 20 . level of performance. the sampled values are usually correlated random variables This correlation can be employed to improve the performance Differential PCM: quantize the difference between two adjacent samples. As the difference has small variation to achieve a certain variation.Differential PCM (DPCM) For a bandlimited random process.

DPCM Quantizer encoder delay decoder delay 2010/2011 Meixia Tao @ SJTU 21 .

where the quantizer is a two-level quantizer with magnitude ±Δ In DM only 1-bit per symbol is employed So adjacent DM. 1 bit employed. m (t ) m′(t ) m (t i ) ′(ti −1 )× ×m′(ti ) × m The step size Δ is critical in designing a DM system. 2010/2011 Meixia Tao @ SJTU 22 .Delta Modulation (DM) DM is a simplified version of DPCM. samples must have high correlation.