You are on page 1of 47

Chapter 2

Signal Sampling and Quantization

Sampling of Continuous Signals


The ADC unit samples an analog signal,
quantizes the sampled signal, and
encodes the quantized signal level to a
digital signal

Signal samples

x (t )

Analog signal/continuous-time signal

Sampling interval T

nT
0

x (t )

2T

4T

6T

8T

10T

12T

Voltage for ADC (sample and hold)

Analog signal

nT
0

2T

4T

6T

8T

10T

12T
3

Sampling theorem:
An analog signal can be in theory perfectly recovered as
long as the sampling rate is at least twice larger than the
highest frequency of the analog signal to be sampled.

Examples:
To sample a speech signal containing frequencies up to
4 kHz, the minimum sampling rate is chosen to be at
least 8 kHz, or 8,000 samples per second.
For an audio signal with frequencies up to 20 kHz,
sample the audio signal at the sampling rate of at least
40,000 samples per second, or 40 kHz.
4

Sampling condition is satisfied


1
Voltage

Sampling condition is
satisfied.
fmax=40Hz, fs=100 Hz

40 Hz

-1
0

0.01

0.02

0.03

0.04 0.05 0.06 0.07


Time (sec.)
Sampling condition is not satisfied

0.08

0.09

0.1

0.08

0.09

0.1
5

10 Hz

90 Hz

1
Voltage

Undersampling:
Signal aliasing would
occur when the
sampling condition is
not satisfied.
fmax=90 Hz, fs=100 Hz

-1
0

0.01

0.02

0.03

0.04 0.05 0.06


Time (sec.)

0.07

View of sampling in frequency domain


p( t )
1
t

T
x (t )

ADC
encoding

x s ( t ) x ( t ) p( t )

x (t )

x s (0)

x s (T )

x s ( 2T )
t

Xs( f )

1
1
1
X ( f fs ) X ( f ) X ( f fs )
T
T
T

X( f )
1.0
a.

B f max
f
B

B
Lowpass Filter

1
T

b.

Over sampling
fs B

0
Xs( f )

Replica
(shifted version)

fs
2

fs

fs B

0
1
T

c.

Perfect sampling

fs B

fs

fs B

Folding frequency/Nyquist
limit

Xs( f )

f
fs B

fs

0
1
T

d.

Under sampling

fs

fs B

Xs( f )

f
fs B

f s B

fs B

fs B

Sampled signal spectrum

fs

fs B

1. Sampling theorem establishes a minimum


sampling rate for sampling a given band-limited
analog signal with the highest frequency
component of fmax : f s 2 f max

If the sampling condition is satisfied, then the


analog signal can be recovered via its sampled
values.
2. The half of the sampling frequency = Nyquist
frequency (Nyquist limit) = folding frequency.

10

Signal Reconstruction
y s (t )

Digital signal
DAC

y ( n)
y ( n)
y(0)

y (t )

Lowpass
reconstruction
filter

y (t )

y s (t )
y s (0) y s (T )

y(1)
y(2)

y s ( 2T )
n

Digital signal

Analog signal recovered


Ideal impulse train
(sampled signal recovered) Y ( f )
1.0

f s 2 f max

f max B
11 f

Recovered signal spectrum

Signal Reconstruction

Signal Reconstruction

Signal Reconstruction

Anti-aliasing Lowpass Filter


Anti-aliasing
LP filter
Analog signal spectrum
(worst case)

Sample and
hold

Digital value

ADC
coding

Xs( f )

X( f )

Xa
f

fc

fa fc fs
2

fs
fs fa

aliasing noise level X a


at f a (image from f s f a )
15

Anti-aliasing filter (Butterworth type)


C2
Vin

R1

Choose

14142
.
C2 2f c

b g

Vo

C2

R1 R2
C1

R2

C1

b g

R1 R2 C2 2f c

H( f ) ff f
Xa
s
a
% aliasing noise level

X( f ) ff
H( f ) ff
a

f
1 a
fc

2n

f fa
1 s

f
c

2n

16

Distortion due to the hold circuit and anti-image filter


1 e sT
H h ( s)
s
Digital Signal

Hold
Circuit

DAC

y ( n)

y s (t )

y ( n)

Equalizer

y H (t )
y H (t )

y s (t )

Antiimage
filter

y (t )

y (t )

sin( fT )
% distortion 1
fT

100%

Note: Equalizer -> channel correction


to obtain impulse response 17

ADC, DAC, and Quantization


ADC
x (t )

ADC
Antialiasing
filter

Sample
and hold

Quantization
binary
encoder

Digital
signal
processor

DAC

Zerothorder
hold

Antiimage
filter

y (t )

Quantization: conversion of continuous amplitude to digital data


18

3-bit unipolar quantizer


Binary code

111

110

101

100
011

010

001

000
/2
/ 2

xq

eq

x
x
19

Quantization table for the 3 bit unipolar quantizer


( Step size = xmax xmin / 23 , xmax =maximum voltage, and xmin 0 )
Binary code
000
001
010
011
100
101
110
111

Quantization level xq (V)


0

2
3
4
5
6
7

Input signal sub-range (V)


0 x 0.5
0.5 x 1.5
1.5 x 2.5
2.5 x 3.5
3.5 x 4.5
4.5 x 5.5
5.5 x 6.5
6.5 x 7.5
20

3-bit bipolar quantizer


xq

Binary code

111

110

101

100
011
010
001
000
/2
/ 2
Quantization error:

3
4

eq
x

21

Quantization table for the 3 bit bipolar quantizer


(Step size = xmax xmin / 23 , xmax =maximum voltage, and xmin xmax )
Binary code
000
001
010
011
100
101
110
111

Quantization level xq (V)


4
3
2

2
3

Input signal sub-range (V)


4 x 3.5
3.5 x 2.5
2.5 x 1.5
1.5 x 0.5
0.5 x 0.5
0.5 x 1.5
1.5 x 2.5
2.5 x 3.5
22

ADC

23

DAC
DAC conversion
Digital signal
Quantization
and coding

zeroth-order
hold

Antiimage
filter

Analog signal

Binary code

00001001
01001011

11010010
00001101

24

Quantization error:

eq xq x

Quantization bound:
Signal to noise power ratio:
SNR

eq
2
2

E x2
E eq2

1 N 1 2
x ( n)

N
SNR nN01

1
2
e

q ( n)
N n 0

N 1

2
x
( n)
n 0
N 1

2
e
q ( n)
n 0

xrms
25
SNRdB 10.79 20 log10

Example 1: a 4-bit bipolar quantizer


5
4
3

Quantized x(n)

2
1
0
-1
-2
-3
-4
-5

0.002

0.004

0.006

0.008
0.01 0.012
Time (sec.)

0.014

0.016

0.018

0.02

26

Example 2: Speech, a 4-bit bipolar quantizer

Quantized error

Quantized speech

Original speech

we.dat: we
5

-5

0.05

0.1

0.15

0.2

0.25

0.05

0.1

0.15

0.2

0.25

0.05

0.1

0.15
Time (sec.)

0.2

0.25

-5
1

-1

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

You might also like