270 likes | 440 Views
ISAT 300. Computer-Based Instrumentation (part 2) Sampling and A/D Converters 11/14/01. Ð. Ð. Ð. Ð. Ð. Ð. Sampling (In the context of polling). Filter input first. Ð. Ð. Ð. Ð. Ð. Ð. Sampling (In the context of polling). Then sample.
E N D
ISAT 300 Computer-Based Instrumentation (part 2)Sampling and A/D Converters 11/14/01
Ð Ð Ð Ð Ð Ð Sampling (In the context of polling) • Filter input first
Ð Ð Ð Ð Ð Ð Sampling (In the context of polling) • Then sample
Sampling of Time-Varying Signals (Measurands) • When using a computerized data acquisition system, measurements are only made at a discrete set of times, not continuously. • For example, a temperature or voltage reading (called a sample) may be taken every 0.1 s or every 2 min, and no information is taken for the time periods in between the samples.
Sampling of Time-Varying Signals (Measurands) a) time-varying signal (e.g., voltage) b) signal being sampled c) the sampled points (dots) d) signal can be reconstructed by connecting the dots
Sampling of Time-Varying Signals (Measurands) • The rate at which measurements are made is known as the sampling rate, expressed in samples/sec or Hz. • Incorrect selection of the sampling rate can lead to misleading results.
The problem of aliasing 10 Hz input sampled at 11 Hz Output looks like 1 Hz !
The problem of aliasing (continued) 10 Hz input sampled at 9 Hz Output looks like 1 Hz
The problem of aliasing (continued) 10 Hz input sampled at 8 Hz Output looks like 2 Hz
The problem of aliasing (continued) 10 Hz input sampled at 12 Hz Output looks like 2 Hz
The alias frequency 10 Hz input sampled at 11 Hz Output looks like 1 Hz
When does aliasing happen? 10 Hz input sampled at 11 Hz Output looks like 1 Hz
Another pathology 10 Hz input sampled at 5 Hz Beware if Output looks like 0 Hz (dc)
Avoiding aliasing To avoid aliasing, sample your signal at greater thantwice the maximum frequency of interest. This is a minimum -- 10 X the maximum frequency of interest would be better. Another way to state this rule is the Nyquist criterion:
A one-bit A/D converter Input Output Vin Vin > 5 V Þ output = on “1” Vin < 5 V Þ output = off “0”
10.0 V 3d 7.5 V 2d 5.0 V 1d 2.5 V 0d 0 V N = 2 A two-bit (unipolar) A/D converter • Output has 2N possible values (error on page 78?) Input Output • Range? • Span?
10.0 V 3d 7.5 V 2d (Vru - Vrl) / 2N 5.0 V 1d 2.5 V 0d 0 V N = 2 A two-bit (unipolar) A/D converter • How big is each input bin? Input Output
Input resolution error = Quantization error 10.0 V 3d 7.5 V ±0.5 (Vru - Vrl) / 2N 2d 5.0 V 1d 2.5 V 0d 0 V N = 2
Sampling and A/D Conversion a) An analog signal has been sampled and then converted to digital (2’s complement). b) This quantization results in error.
Vin = 12 V 10.0 V 3d 7.5 V 2d 5.0 V 1d 2.5 V 0d 0 V N = 2 Saturation Input Output
A two-bit (bipolar) A/D converter Input Output (2’s complement) 5.0 V 1d 2.5 V 0.5 (Vru - Vrl) / 2N 0d 0.0 V -1d - 2.5 V -2d - 5.0 V N = 2
Choosing an A/D converter--resolution National Instruments model 16E-4 12 bits National Instruments model 16XE-50 16 bits
Choosing an A/D converter--speed National Instruments model 16E-4 (kiloSamples/second) 500 kS/s National Instruments model 16XE-50 20 kS/s
Choosing an A/D converter--input range National Instruments model 16E-4 10 V National Instruments model 16XE-50 10 V
Calculating the digital output • To estimate the digital output of an A/D converter, see page 81. • E.g., for a simple binary A/D converter: Vin = analog input voltage Vru = upper value of input range Vrl = lower value of input range N = number of bits Do = digital output (as a decimal number!)
Calculating the digital output Example: 8-bit, simple binary A/D converter Range is 0 to 5V. Input is 3.15V. Find output.