Analog-to-digital Conversion Digital-to

advertisement
Analog-to-digital Conversion
and
Digital-to-analog Conversion
(with DSP)
ES-3
A very simple (…too simple!)
Digital-to-analog converter
8R
V1
V2
V4
V8
VOUT
4R
KCL gives :
v1  vout v2  vout v4  vout v8  vout vout




8R
4R
2R
R
8R
2R
R
v1  vout  2(v2  vout )  4(v4  vout )  8(v8  vout )  vout
v1  2v2  4v4  8v8  vout  15vout
8R
8v8  4v4  2v2  v1
 vout
16
A simple
Analog-to-digital converter
Analog Input
+
-
scitec.uwichill.edu.bb
A simple
Analog-to-digital converter
Analog Input
3.5v
+
-
high
low
0v
1v
2v
4v
3v
00000100
000000
11
01
0
Improve accuracy: scale the DAC
scitec.uwichill.edu.bb
Nyquist Sampling Rate
The 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 Rate
The sampling of data must be at least twice the rate as the maximum
frequency of the analog signal : fs>2fmax
V(t)
Aliasing
Time, t
Digital Signal Processing
1
0.8
0.6
signal
0.4
0.2
1
0
0.8
-0.2
0.6
-0.4
0.4
-0.6
0.2
-0.8
0
-1
-0.2
5
-0.4
5.5
-0.6
1
0.8
0.6
0.4
1
6.5 0.2 7
time (sec)
0
6
-0.8
-1
5
7.5
8
8.5
0.8
-3
0.6
-0.2
0.4
-0.4
0.2
5.5-0.6
9
6
6.5
7
-0.8
x 10
7.50
8
8.5
9
-3
x 10
-0.2
-1
-0.4
5
5.5
6 -0.6 6.5
7
7.5
8
8.5
9
-3
x 10
-0.8
-1
Running average of 10 pts
5
5.5
6
6.5
7
7.5
8
8.5
9
Digital Filtering
Removing Noise and Interference from a Digital Signal
Find the
average of
N points
FFT of a noisy sine wave and its digitally filtered signal
5
10
sine + noise
4
signal power (arb.)
10
3
10
filtered noise
2
10
1
10
0
10
-1
10
0
0.2
0.4
0.6
0.8
1
1.2
frequency (Hz)
1.4
1.6
1.8
2
4
x 10
DSP Example
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
-3
x 10
Simple Notch Filter
to remove 60 Hz interference
Vin(n)
fS = 1440 samples per second
60 Hz sine
t (s)
1/60 s
Vin(n-12)
Vin(n)
Vout(n) = Vin(n) + Vin(n - fs / 2fnotch) = Vin(n)+Vin(n-12)
This adds the sample that is 1800 out of phase at 60 Hz
Matlab demo
es3_60Hz.m
Download