Lec1 Introduction
Lec1 Introduction
<
+
+
+
=
1 ) t ( s
A
1
,
A ln 1
) ) t ( s A ln( 1
A
1
) t ( s 0 ,
A ln 1
) t ( s A
) t ( s
1
1
1
1
2
1.0
s
2
(t)
- 1.0
- 1.0
1.0 0
A=87.6
A=1
A=5
s
1
(t)
ITU G.711 standard ITU G.711 standard
Input range Step size Part 1 Part 2 No. code
word
Decoding output
0-1
...
30-31
2 000 0000
...
1111
0
...
15
1
...
31
32-33
...
62-63
2 001 0000
...
1111
16
...
31
33
...
63
64-67
...
124-127
4 010 0000
...
1111
32
...
47
66
...
126
128-135 8 011 0000 48 132 128-135
...
248-255
8 011 0000
...
1111
48
...
63
132
...
252
256-271
...
496-511
16 100 0000
...
1111
64
...
7
264
...
504
512-543
...
992-1023
32 101 0000
...
1111
80
...
5
528
...
1008
1024-1087
...
1984-2047
64 110 0000
...
1111
6
...
111
1056
...
2016
2048-2175
...
3968-4095
128 111 0000
...
1111
112
...
127
2112
...
4032
ITU G.711 A ITU G.711 A--law curve law curve
2
1
7/8
6/8
1.0
Code-word format:
Sign bit
0/1
Part 1 (3bits)
000 111
Part 2 (16bits)
0000 1111
1.0 1/2 1/4 1/8 1/16
1/8
8
6
7
5
4
3
5/8
4/8
3/8
2/8
0
Example of G.711 code word Example of G.711 code word
A quantized-samples value is +121
Sign bit: 0
Part 1: 010
Part 2: 1110 Part 2: 1110
Code word: 00101110
Decoding value: +122
A quantized-samples value is -121
Code word: 10101110
Lecture #2: Lecture #2: Analog Analog--to to--Digital and Digital and
Digital Digital--to to--Analog conversion Analog conversion
Duration: 2 hr
Outline: Outline:
1. A/D conversion
2. D/A conversion
D
A
C
D
A
C
Anti Anti--imaging filter imaging filter
Images
Anti-imaging
filter
m
a
g
n
i
t
u
d
e
0 W 2W =f
s
4W = 2f
s
frequency
Original two-sided
analog signal spectrum
Prob.1. An analog signal is converted to digital and then
back to analog signal again, without intermediate DSP.
HW HW
In what ways will the analog signal at the output differ
from the one at the input?
Prob.2. An analog signal is sampled at its Nyquist rate
1/T
s
, and quantized using L quantization levels. The
derived signal is then transmitted on some channels.
HW HW
(a) Show that the time duration, T, of one bit of the
transmitted binary encoded signal must satisfy
(b) When is the equality sign valid?
) L /(log T T
2 s
Prob.3. A set of
analog samples,
listed in table 1,
is digitized using
HW HW
Digital code
000
Quantization
Level (V)
0.0
Range of analog
inputs (V)
0.0 0.3125
n 0 1 2 3 4 5 6 7 8
Sample(V) 0.5715 4.9575 0.6250 3.6125 4.0500 0.9555 2.8755 1.5625 2.7500
is digitized using
the quantization
table 2.
Determine the
digital codes, the
quantized level,
and the
quantization
error for each
sample.
000
001
010
011
100
101
110
111
0.0
0.625
1.250
1.875
2.500
3.125
3.750
4.375
0.0 0.3125
0.31250.9375
0.93751.5625
1.56252.1875
2.18752.8125
2.81253.4375
3.43754.0625
4.06255.0
Prob.4. Consider that you desire an A/D conversion system, such
that the quantization distortion does not exceed 2% of the full
scale range of analog signal.
(a) If the analog signals maximum frequency is 4000 Hz, and
HW HW
(a) If the analog signals maximum frequency is 4000 Hz, and
sampling takes place at the Nyquist rate, what value of sampling
frequency is required?
(b) How many quantization levels of the analog signal are needed?
(c) How many bits per sample are needed for the number of levels
found in part (b)?
(d) What is the data rate in bits/s?
Prob.5. An analog voice signal with voltage between
-5V and 5V must be quantized using ITU G.711
standard. Encode each of the following samples; and
HW HW
standard. Encode each of the following samples; and
record the quantization error for each:
(a) -3.45198 V
(b) 1.01119 V
Prob.6. A 3-bit D/A converter produces a 0 V output for
the code 000 and a 5 V output for the code 111, with
other codes distributed evenly between 0 and 5 V.
HW HW
other codes distributed evenly between 0 and 5 V.
Draw the zero order hold output from the converter for
the input below:
111 101 011 101 000 001 011 010 100 110
Lecture #2 Lecture #2
The concept of frequency in The concept of frequency in
CT & DT signals CT & DT signals
Duration: 2 hrs
Outline: Outline:
1. CT sinusoidal signals
2. DT sinusoidal signals
3. Relations among frequency variables
Functions:
+ < < + =
+ < < + =
t ), t f 2 cos( A
t ), t cos( A ) t ( x
a
Mathematical description of CT Mathematical description of CT
sinusoidal signals sinusoidal signals
Plot:
+ < < + = t ), t f 2 cos( A
t
x
a
(t)
Acos
T
p
= 1/f
Properties of CT sinusoidal signals Properties of CT sinusoidal signals
1. For every fixed value of the frequency f, x
a
(t) is
periodic: x
a
(t+T
p
) = x
a
(t)
T
p
= 1/f: fundamental period T
p
= 1/f: fundamental period
2. CT sinusoidal signals with different frequencies are
themselves different
3. Increasing the frequency f results in an increase in the
rate of oscillation of the signal (more periods in a
given time interval)
Properties of CT sinusoidal Properties of CT sinusoidal
signals (cont) signals (cont)
For f = 0 T
p
=
For f = T
p
= 0
Physical frequency: positive Physical frequency: positive
Mathematical frequency: positive and negative
The frequency range for CT signal:
- < f < +
) ( ) (
2 2
) cos( ) (
+ +
+ = + =
t j t j
a
e
A
e
A
t A t x
Functions:
+ < < + =
+ < < + =
n ), n F 2 cos( A
n ), n cos( A ) n ( x
Mathematical description of DT Mathematical description of DT
sinusoidal signals sinusoidal signals
Plot:
0 5 1 0 1 5 2 0 2 5 3 0 3 5 4 0
-2
-1 . 5
-1
-0 . 5
0
0 . 5
1
1 . 5
2
Ti m e i n d e x n
A
m
p
l
i
t
u
d
e
x(n N) x(n) n + =
Properties of DT sinusoidal signals Properties of DT sinusoidal signals
1. A DT sinusoidal signal x(n) is periodic only if its
frequency F is a rational number
x(n N) x(n) n + =
n ) n F 2 cos( A )] ) N n ( F 2 cos[ A
0 0
+ = + +
k 2 N F 2
0
=
N
k
F
0
=
2. DT sinusoidal signals whose frequencies are separated by
an integer multiple of are identical
2
) n cos( ) n 2 n cos( ] n ) 2 cos[( ) n ( x + = + + = + + =
Properties of DT sinusoidal signals Properties of DT sinusoidal signals
All
are identical
) n cos( ) n 2 n cos( ] n ) 2 cos[( ) n ( x
0 0 0
+ = + + = + + =
+ + =
= + =
0 0
, 2
... , 2 , 1 , 0 ), cos( ) (
k
k n A n x
k
k k
3. The highest rate of oscillation in a DT sinusoidal signal is
obtained when:
Properties of DT sinusoidal signals Properties of DT sinusoidal signals
or, equivalently,
) or ( = =
)
2
1
F or (
2
1
F = =
0 5 10 15 20 25 30
-1
-0.5
0
0.5
1
F = 3/24
0 5 10 15 20 25 30
-1
-0.5
0
0.5
1
F = 3/12
F
0
= 1/8 F
0
= 1/4
) 2 cos( ) (
0
n F n x =
Illustration for Illustration for
property 3 property 3
0 5 10 15 20 25 30 0 5 10 15 20 25 30
0 5 10 15 20 25 30
-1
-0.5
0
0.5
1
F = 3/6
0 5 10 15 20 25 30
-1
-0.5
0
0.5
1
F = 3/4
F
0
= 1/2 F
0
= 3/4
- or -1/2 F 1/2: fundamental range
CT signal Sampling DT signal
x
a
(t) x
a
(nT)
+ ) nT f 2 cos( A
Sampling of CT sinusoidal signals Sampling of CT sinusoidal signals
s
f
f
F =
) t f 2 cos( A +
|
|
\
|
+
=
+
S
f
n f 2
cos A
) nT f 2 cos( A
Normalized
frequency
CT signals DT signals
2 F =
2 f =
Relations among frequency variables Relations among frequency variables
+ < <
+ < <
f
2 / 1 F 2 / 1 +
+
2 / f f 2 / f
T / T /
s s
+
+
s
f
f
F =
s
f
T
1
=
Exercise Exercise
Consider the analog signal
a) Determine the minimum sampling rate required to avoid aliasing
] [ , 100 cos 3 ) ( s t t t x =
b) Suppose that the signal is sampled at the rate f
s
= 200 Hz. What is
the DT signal obtained after sampling?
c) Suppose that the signal is sampled at the rate f
s
= 75 Hz. What is
the DT signal obtained after sampling?
d) What is the frequency 0 < f < f
s
/2 of a sinusoidal signal that yields
samples identical to those obtained in part (c)?
Prob.7. Consider the analog signal
a
x (t) 3cos2000 t+5sin6000 t+10cos12000 t =
HW HW
a) Determine the minimum sampling rate required to avoid aliasing
b) Suppose that the signal is sampled at the rate f
s
= 5000
samples/sec. What is the DT signal obtained after sampling?
c) What is the analog signal we can reconstruct from the samples if
we use ideal interpolation?
Prob.8. Consider the analog signal
a) Sketch the signal for t from 0 to 30 ms
HW HW
] [ , 100 sin 3 ) ( s t t t x =
a) Sketch the signal for t from 0 to 30 ms
b) The signal is sampled at the rate f
s
= 300 samples/s. Determine
the frequency of the DT signal x(n) and show that it is periodic.
c) Compute the sample values in one period of x(n). Sketch x(n) on
the same diagram with x(t). What is the periodic of x(n) in ms?
d) Can you find a sampling rate so that x(n) reaches its peak value?