3008 Lecture6 A-D
3008 Lecture6 A-D
Digital Communications
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
2
Analog signal
t (continuous amplitude)
111010101100001 1 110 1
Digital signal
t (discrete amplitude)
Why digital?
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
3
Digital Communications
Analog Signal
Bit sequence
t 0001101110……
t t
Baseband Bandpass
Channel Channel
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
4
• Sampling
• Quantization
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
5
A-D Conversion
Sampling Quantization
000010011010000…
t t
• Sampling
• A continuous-time analog signal is transformed into a discrete-time
signal.
• Quantization
• A discrete-time signal is transformed into a series of binary bits.
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
6
Sampling
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
7
Sampling
Time Domain
xS (t ) x(t ) (t nTS )
n
x(t)
Sampling
t t
Ts
(t nT )
n
S
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
8
Sampling
Frequency Domain X S ( f ) X ( f ) ( fS ( f nf
n
S )) f S X ( f nf
n
S )
Harmonic components
X(f)
XS(f)
Sampling
…... …...
fS ( f nf
n
S )
• How to recover the original signal x(t)?
Lowpass filtering
fS f
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
9
Aliasing
XS(f)
…... …...
fS-B B
XS(f)
Aliasing
f S 2B
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
10
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
11
…... …...
0 B f 0 B f
XS(f)
• Use a sampling rate fS>2B
…... …...
• Pre-filtering 0 B fS>2B f
X(f)
XS(f)
…... …...
0 B f -2B 0 B fS=2B f
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
12
Quantization
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
13
Quantization
xS(t)
1
0
t
-1 Quantization
11 11 11 11 11 10 10 10 11 10 10 10 00 00 00 10 10…
Uniform Quantization
xS(t)
xmax
Dynamic range
t of xs(t)
xmin
Uniform Quantization
x0 x1 x2 x3 xL-1 xL
xmin
s0 ŝ0 …… xmax x
xmax xmin
Step size
L Quantization threshold
Let ŝ0 represent the quantized value of the input value s0.
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
16
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
17
Example 1: Midriser
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
18
Solution
1. y 2. Quantized values of
0.15V and -3.1V are
3.5
2.5
0.5V and -3.5V,
1.5 respectively.
0.5 1 2 3 4
x x
-4 -3 -2 -1 -0.5 x
-1.5
-2.5
-3.5
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
19
Quantization Error
x0 x1 x2 x3 xL-1 xL
xmin
s0 ŝ0
…… xmax x
xmax xmin
Step size
L Quantization threshold
• What is the maximal difference between the input s0 and its quantized
value ŝ0 ? /2
Let e sˆ0 s0 . / 2 e / 2
1/ / 2 x / 2
e 0, e2 2 /12
f e ( x)
0 otherwise
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
20
Signal-to-Quantization-Noise-Ratio (SQNR)
• SQNR:
SQNR Px / e2
Px and e2 are the power of the signal and the quantization error, respectively.
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
21
Example 2: SQNR
x x 2 Am
2 2
We have max min
Px Am2 / 2 and e2 2 /12
12 22b 12 22b
Px
Therefore, SQNR 1.5 22b
2
e
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
22
Non-Uniform Quantization
Human speech:
volts • Small samples have a
larger percentage;
• Small samples are more
0 susceptive to noise.
t (msec)
…… ……
xmin 0
xmax x
Step size increases with the signal magnitude.
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
23
Non-Uniform Quantization
Compress the original
How to perform non-uniform quantization? signal such that its
amplitude roughly
• non-linear compression on the analog signal;
follows a uniform
• uniform quantization. distribution!
-law :
ln 1 (| x | / xmax )
y ymax sgn( x)
ln(1 )
sgn( x) 1 if x 0
sgn( x) 1 if x 0
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
24
x(t) x(t)
1< 2 < 3 < 4
• For weak signals (with low power), -law has better SQNR as law uniform
• For strong signals (with large power), -law has lower SQNR as law uniform
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
25
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
26
Solution
ln 1 (| x | / xmax )
According to y ymax sgn( x)
ln(1 )
x xmax / 1 1 sgn( y)
| y|/ ymax
We have
Code Assignment
output
Gray Code
100
7
Generation: for an N-bit binary code,
5
101
111 bN bN-1 …… b3 b2 b1
3
1110
-8 -6 -4 -2010 2 4 6
8 input
-1
011 -3 gN gN-1 gN-2 …… g2 g1
001
-5
modulo-2 addition
000 -7
Properties:
1. The first bit is the sign bit;
2. Adjacent words differ only by one bit;
000000 001001 3. Except for the sign bit, the codewords are
010011 011010 …… mirror symmetrical about the horizontal axis.
Lin Dai (City University of Hong Kong) EE3008 Principles of Communications Lecture 6
28
• Sampling
• Quantization
0001101110……
User Analog
D-A Conversion Baseband Signal