Analog-to-digital Conversionand
Digital-to-analog Conversion(with DSP)
ES-3
A very simple (…too simple!)
Digital-to-analog converter8R
4R
2R
R
8R
V1
V2
V4
V8
VOUT
out
outout
outoutoutoutout
outoutoutoutout
vvvvv
vvvvvv
vvvvvvvvv
R
v
R
vv
R
vv
R
vv
R
vv
givesKCL
16
248
15842
)(8)(4)(2
8248
:
1248
8421
8421
8421
scitec.uwichill.edu.bb
Analog Input
A simple
Analog-to-digital converter
+-
scitec.uwichill.edu.bb
Analog Input
A simple
Analog-to-digital converter
+-
3.5v
0v
0 0 0 0 0 0 0 0
high
0 0 0 0 0 0 0 1
1v
0 0 0 0 0 0 1 0
2v
0 0 0 0 0 0 1 1
3v
0 0 0 0 0 1 0 0
4v
low
0 0 0 0 0 0 1 1
3v
0 0 0 0 0 1 0 0
Improve accuracy: scale the DAC
Nyquist Sampling RateThe sampling of data must be at least twice the rate as the maximum
frequency of the analog signal: fs>2fmax
V(t)
Time, t
Use a low pass filter with fc = fmax to remove harmonics sine
Nyquist Sampling RateThe sampling of data must be at least twice the rate as the maximum
frequency of the analog signal : fs>2fmax
V(t)
Time, t
Aliasing
Digital Signal Processing
5 5.5 6 6.5 7 7.5 8 8.5 9
x 10-3
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
time (sec)
sign
al
5 5.5 6 6.5 7 7.5 8 8.5 9
x 10-3
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
5 5.5 6 6.5 7 7.5 8 8.5 9
x 10-3
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
5 5.5 6 6.5 7 7.5 8 8.5 9
x 10-3
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Running average of 10 pts
Digital FilteringRemoving Noise and Interference from a Digital Signal
Find the average of N points
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x 104
10-1
100
101
102
103
104
105
frequency (Hz)
sign
al p
ower
(ar
b.)
sine + noise
filtered noise
FFT of a noisy sine wave and its digitally filtered signal
DSP Example
5 5.5 6 6.5 7 7.5 8 8.5 9
x 10-3
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Simple Notch Filterto remove 60 Hz interference
t (s)
Vin(n)
fS = 1440 samples per second
1/60 s
60 Hz sine
Vout(n) = Vin(n) + Vin(n - fs / 2fnotch) = Vin(n)+Vin(n-12)
Vin(n)Vin(n-12)
This adds the sample that is 1800 out of phase at 60 Hz
Matlab demo
es3_60Hz.m