Вы находитесь на странице: 1из 45

ECE 465

Digital Signals Processing


Faculty of Advanced Science and Technology
Assoc.Prof. Pham Van Tuan
ECE 465
Digital Signals Processing
Review on Analog to Digital Conversion

Faculty of Advanced Science and Technology


Analog-to-Digital and Digital-to-Analog
Conversion

n Outline:
1. A/D conversion
2. D/A conversion

3/20/20 3
Analog-to-Digital Conversion

3/20/20 4
Sampling

n Continuous-time signal à discrete-time signal

Analog Digital
Sampling
world world

3/20/20 5
Sampling Case Study
n Taking samples at intervals and don’t know what happens in
between à can’t distinguish higher and lower frequencies:
aliasing
n How to avoid aliasing?

3/20/20 6
Nyquist Sampling Theory
n To guarantee that an analog signal can be perfectly
recovered from its sample value
n Theory: a signal with maximum of frequency of W Hz must be
sampled at least 2W times per second to make it possible to
reconstruct the original signal from the samples
n Nyquist sampling rate: minimum sampling frequency
n Nyquist frequency: half the sampling rate
n Nyquist range: 0 to Nyquist frequency range
n To remove all signal elements above the Nyquist frequency
à antialiasing filter
3/20/20 7
Anti-Aliasing Filter
magnitude

Anti-aliasing Analog signal


filter response spectrum

frequency

0 W 2W =fs 3W 4W
magnitude

Filtered analog signal


spectrum

frequency

0 W 2W =fs 3W 4W
3/20/20 8
Some Examples of Sampling Frequency
n Speech coding/compression ITU G.711, G.729, G.723.1:
fs = 8 kHz à T = 1/8000 s = 125μs
n Broadband system ITU-T G.722:
fs = 16 kHz à T = 1/16 000 s = 62.5μs
n Audio CDs:
fs = 44.1 kHz à T = 1/44100 s = 22.676μs
n Audio hi-fi, e.g., MPEG-2 (moving picture experts group),
AAC (advanced audio coding), MP3 (MPEG layer 3):
fs = 48 kHz àT = 1/48 000 s = 20.833μs

3/20/20 9
Sampling and Hold
n Sampling interval Ts (sampling period): time between samples
n Sampling frequency fs (sampling rate): # samples per second

0 1 2 3 4
Analog signal Sample-and-hold signal
3/20/20 10
Quantization Errors & Coding
n Quantized sample à N-bit code word

1.5V
1.1V
1.25V
1.0V

0.82V
0.5V

0.0V

3/20/20 11
Quantization Parameters
n Number of bits: N
n Full scale analog range: R
n Resolution: the gap between levels Q = R/2N
n Quantization error = quantized value – actual value
n Dynamic range: number of levels, in decibel
Dynamic range = 20log(R/Q) = 20log(2N) = 6.02N dB
n Signal-to-noise ratio SNR = 10log(signal power/noise power)
Or SNR = 10log(signal amplitude/noise amplitude)
n Bit rate: the rate at which bits are generated
Bit rate = N.fs

3/20/20 12
Noise Removal by Quantization

Error
Noise

Q/2
Q

Quantized signal + noise After re-quantization

3/20/20 13
Example of Quantization & Coding
Analog pressures Range of
Quantization
are recorded, analog
using a pressure Digital code Level (V) inputs (V)

transducer, as
voltages between
0 and 3V. The
signal must be
quantized using a
3-bit digital code.
Indicate how the
analog voltages
will be converted
to digital values.
3/20/20 14
Example of Quantization & Coding
Analog pressures Range of
Quantization
are recorded, analog
using a pressure Digital code Level (V) inputs (V)

transducer, as 000 0.0 0.0-0.1875


voltages between
001 0.375 0.1875-0.5625
0 and 3V. The
signal must be 010 0.75 0.5625-0.9375
quantized using a 011 1.125 0.9375-1.3125
3-bit digital code.
100 1.5 1.3125-1.6875
Indicate how the
analog voltages 101 1.875 1.6875-2.0625
will be converted 110 2.25 2.0625-2.4375
to digital values.
111 2.625 2.4375-3.0
3/20/20 15
Example of Quantization & Coding
An analog voltage Quantization
Range of analog
between -5V and 5V Digital code Level (V) inputs (V)

must be quantized
using 3 bits. Quantize
each of the following
samples, and record
the quantization error
for each:
-3.4V; 0V; .625V

3/20/20 16
Example of Quantization & Coding
An analog voltage Quantization
Range of analog
between -5V and 5V Digital code Level (V) inputs (V)

must be quantized 100 -5.0 -5.0 à-4.375

using 3 bits. Quantize 101 -3.75 -4.375à-3.125

each of the following 110 -2.5 -3.125à-1.875

samples, and record 111 -1.25 -1.875à-0.625

the quantization error 000 0.0 -0.625à0.625

for each: 001 1.25 0.625à1.875

-3.4V; 0V; .625V 010 2.5 1.875à3.125

011 3.75 3.125à5.0


3/20/20 17
Minimum Quantization Error

3/20/20 18
Non-Uniform Quantization

n Quantization with variable quantization step ßà Q value is


variable
Output Non-
n Q value is directly uniform
proportional to signal
amplitude à SNR is
constant Uniform

n Most used in speech Input

3/20/20 19
A-law Compression Curve
⎧ A s (t) 1
⎪ 1 , 0 ≤ s1 ( t ) ≤
⎪1 + ln A A
s 2 (t) = ⎨
⎪1 + ln(A s1 ( t ) ) s2(t)
1
⎪ , < s1 ( t ) ≤ 1 1.0
⎩ 1 + ln A A

A=87.6
A=5
- 1.0 A=1
0 1.0 s1(t)

- 1.0
3/20/20 20
ITU G.711 A-law curve
Code-word format: Sign bit Part 1 (3bits) Part 2 (16bits)
0/1 000 à 111 0000 à 1111

1.0
1
7/8
2
6/8
3
5/8
4
4/8
5
3/8
6
2/8 7
1/8
8
0
3/20/20
1/16 1/8 1/4 1/2 1.0 21
Digital-to-Analog and Digital-to-Analog
Conversion

n Outline:
1. A/D conversion
2. D/A conversion

3/20/20 22
DAC

3/20/20 23
Anti-imaging Filter
magnitude

Anti-imaging Images
filter

0 W 2W =fs 4W = 2fs
frequency

Original two-sided
analog signal spectrum

3/20/20 24
Quiz 1

An analog signal is converted to digital and then back to


analog signal again, without intermediate DSP.
In what ways will the analog signal at the output differ
from the one at the input?

3/20/20 25
Quiz 2

An analog signal is sampled at its Nyquist rate 1/Ts, and


quantized using L quantization levels. The derived signal
is then transmitted on some channels.
(a) Show that the time duration, T, of one bit of the
transmitted binary encoded signal must satisfy

T ≤ Ts /(log 2 L)
(b) When is the equality sign valid?

3/20/20 26
Quiz 3
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

A set of analog Quantization


samples, listed in Range of analog
Digital code Level (V) inputs (V)
table 1, is digitized
using the 000 0.0 0.0 à0.3125
quantization table 001 0.625 0.3125à0.9375
2. Determine the 010 1.250 0.9375à1.5625
digital codes, the
011 1.875 1.5625à2.1875
quantized level,
100 2.500 2.1875à2.8125
and the
quantization error 101 3.125 2.8125à3.4375
for each sample. 110 3.750 3.4375à4.0625
3/20/20 111 4.375 4.0625à5.027
Quiz 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 signal’s 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?

3/20/20 28
Quiz 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 record
the quantization error for each:
(a) -3.45198 V
(b) 1.01119 V

3/20/20 29
Quiz 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.
Draw the zero order hold output from the converter for
the input below:
111 101 011 101 000 001 011 010 100 110

3/20/20 30
EE 442
Digital Signals and Filtering
Review on Frequency concepts in CT and DT domains

Faculty of Advanced Science and Technology


Frequency Concepts of CT & DT Signals

n Outline:
1. CT sinusoidal signals
2. DT sinusoidal signals
3. Relations among frequency variables

3/20/20 32
Mathematical Description of CT
Sinusoidal Signals

n Functions:

x a ( t ) = A cos(ω t + θ), − ∞ < t < +∞


= A cos(2πf t + θ), − ∞ < t < +∞
xa(t)
n Plot: Tp = 1/f
Acosθ

3/20/20 33
Properties of CT Sinusoidal Signals

1. For every fixed value of the frequency f, xa(t) is


periodic: xa(t+Tp) = xa(t)
Tp = 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)

3/20/20 34
Properties of CT Sinusoidal Signals

§ For f = 0 à Tp = ∞
§ For f = ∞ à Tp = 0
§ Physical frequency: positive
§ Mathematical frequency: positive and negative

A j ( Ωt +θ ) A − j ( Ωt +θ )
xa (t ) = A cos(Ωt + θ ) = e + e
2 2
§ The frequency range for CT signal:
-∞ < f < +∞

3/20/20 35
Mathematical Description of DT
Sinusoidal Signals

n Functions: x (n ) = A cos(Ω n + θ), − ∞ < n < +∞


= A cos( 2πFn + θ), − ∞ < n < +∞
2

1.5

n Plot: 0.5
Amplitude

-0.5

-1

-1.5

-2
0 5 10 15 20 25 30 35 40
3/20/20 Time index n 36
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
A cos[2πF0 (n + N) + θ)] = A cos(2πF0 n + θ) ∀n

2πF0 N = 2πk

k
F0 =
N

3/20/20 37
Properties of DT Sinusoidal Signals
2. DT sinusoidal signals whose frequencies are separated by
an integer multiple of 2π are identical

x(n) = cos[(Ω0 + 2π)n + θ] = cos(Ω0 n + 2πn + θ) = cos(Ω0 n + θ)

à All xk (n) = A cos(Ω k n + θ ), k = 0, 1, 2, ...


Ω k = Ω 0 + k 2π , − π ≤ Ω0 ≤ +π
are identical

3/20/20 38
Properties of DT Sinusoidal Signals

3. The highest rate of oscillation in a DT sinusoidal signal is


obtained when:

Ω = π (or Ω = −π)

or, equivalently, 1 1
F= (or F = − )
2 2

3/20/20 39
Illustration for
property 3
x(n) = cos( 2π F0 n)
F = 1/8
0
F = 3/24
FF =03/12= 1/4
1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
0 5 10 15 20 25 30 0 5 10 15 20 25 30

F0 = 1/2
F = 3/6
FF 0= 3/4= 3/4
1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
0 5 10 15 20 25 30 0 5 10 15 20 25 30

3/20/20 -π ≤ Ω ≤ π or -1/2 ≤ F ≤ 1/2: fundamental range 40


Sampling of CT Sinusoidal Signals

CT signal Sampling DT signal


xa(t) xa(nT)
A cos( 2πf nT + θ)
A cos( 2πf t + θ) ⎛ 2πf n ⎞
= A cos⎜⎜ + θ ⎟⎟
⎝ fS ⎠
f
F= Normalized
fs frequency

3/20/20 41
Relations among Frequency Variables
CT signals DT signals

ω = 2πf Ω = 2πF
− ∞ < ω < +∞
− ∞ < f < +∞
f − π ≤ Ω ≤ +π
F=
− π / T ≤ ω ≤ +π / T
fs − 1 / 2 ≤ F ≤ +1 / 2

− f s / 2 ≤ f ≤ +f s / 2 1
T=
fs
3/20/20 42
Quiz 7
Consider the analog signal

x(t ) = 3 cos100π t , t[ s]
a) Determine the minimum sampling rate required to avoid aliasing
b) Suppose that the signal is sampled at the rate fs = 200 Hz. What is
the DT signal obtained after sampling?
c) Suppose that the signal is sampled at the rate fs = 75 Hz. What is
the DT signal obtained after sampling?
d) What is the frequency 0 < f < fs/2 of a sinusoidal signal that yields
samples identical to those obtained in part (c)?

3/20/20 43
Quiz 8
Consider the analog signal
x a (t) = 3cos2000πt+5sin6000πt+10cos12000πt
a) Determine the minimum sampling rate required to avoid aliasing
b) Suppose that the signal is sampled at the rate fs = 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?

3/20/20 44
Quiz 9
Consider the analog signal

x(t ) = 3 sin 100π t , t[ s]


a) Sketch the signal for t from 0 to 30 ms
b) The signal is sampled at the rate fs = 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?

3/20/20 45

Вам также может понравиться