Chapter 4 Instrument
Chapter 4 Instrument
Chapter 4 Instrument
Conversion
• Sampling of analog signals
1
What is ADC
• An electronic integrated circuit which transforms a signal from analog (continuous)
to digital (discrete) form.
• Analog signals are directly measurable quantities.
• Digital signals only have two states. For digital procesor, we refer to binary states,
0 and 1.
Why ADC is needed
• Microprocessors can only perform complex processing on digitized signals.
• When signals are in digital form they are less susceptible to the deleterious
effects of additive noise.
• ADC Provides a link between the analog world of transducers and the digital
world of signal processing and data handling.
2
Data Convertor Basics
• Real world signals are analog (temp, pressure, position, sound, light, speed, etc):
• Continuous time and continuous amplitude
3
AD Conversion Process
There are two related steps in A-to-D conversion:
Sampling and holding:
The analogue signal is extracted, usually at regularly spaced time
instants. Quantization creates a series of digital values
The samples have real values. to represent the original analog signal
Quantization and Encoding:
The samples are quantized to discrete levels.
Each sample is represented as a digital value.
• Flattop - sample and hold, like natural but with single amplitude value
4.10
Three different sampling methods
If a sinusoidal signal is sampled with a high sampling rate, the original signal can be
recovered exactly by connecting the samples together in a smooth way (called ideal low
pass filtering). In contrast, if a sinusoidal signal is sampled with a low sampling rate, the
samples may be too infrequent to recover the original signal.
The question that arises is: for which values of sampling rate fs can we sample and then
perfectly recover a sinusoidal signal v(t) = cos(2πft)?
The Nyquist-Shannon Sampling Theorem states that the sampling rate for exact recovery of a
signal composed of a sum of sinusoids must be larger than twice the maximum frequency of the
signal. This rate is called the Nyquist sampling rate fNyquist.
Sampling rate less than Nyquist rate results in original signal is not recovered known
as aliasing phenomena 12
For an intuitive example of the Nyquist theorem, let us sample a simple sine
wave at three sampling rates: fs = 4f (2 times the Nyquist rate), fs = 2f (Nyquist
rate),and fs = f (one-half the Nyquist rate).
Figure : shows the sampling and the subsequent recovery of the signal.
From the figure it can be seen that sampling at the Nyquist rate can create
a good approximation of the original sine wave (part a). Oversampling in
part b can also create the same approximation, but it is redundant and
unnecessary. Sampling below the Nyquist rate (part c) does not produce a
signal that looks like the original sine wave.
Ex 1. In this example, v(t)=cos(2πft) is sampled with
sampling interval Ts=T/3 to produce the following v[n].
Ex 2: Given the signal v(t) = 7 + 5cos(2π440t) + 3sin(2π880t) the sampling rate fs > fNyquist= 2(880)=1760 Hz.
Ex 3: Given the signal v(t) = 5 sin(2π50t) is sampled at fs = 40 Hz, what signal can be recovered after sampled?
Solution: v[n] = 5 sin(2πn 50/40) = 5 sin(2πn(1.25)) = 5 sin (2πn(1 + 0.25)) = 5 sin (2πn(0.25)) = 5 sin (0.5πn)
Recovering signal: vr(t) = 5 sin (0.5π 40t) = 5 sin (2π 10t)
15
Quantization & Coding
Quantizing: Partitioning
Quantization error
the reference signal • Use original analog
range into a number of signal
discrete quanta, then • Apply 2 bit coding
matching the input signal
to the correct quantum.
Each sample falling in a zone is then approximated to the value of the midpoint
4.17
Quantization Zones
• Assume we have a voltage signal with amplitutes Vmin=-20V and Vmax=+20V.
We want to use L=8 quantization levels.
Zone width = (20 - -20)/8 = 5
The 8 zones are: -20 to -15, -15 to -10, -10 to -5, -5 to 0, 0 to +5, +5 to +10, +10 to +15,
+15 to +20
The midpoints are: -17.5, -12.5, -7.5, -2.5, 2.5, 7.5, 12.5, 17.5
Quantization Error
• When a signal is quantized, we introduce an error
• The difference between actual and coded value (midpoint) is referred to as the
quantization error.
• The more zones, the smaller which results in smaller errors.
• BUT, the more zones the more bits required to encode the samples -> higher bit rate
Encoding
Encoding is assigning Codes to Zones
• Each zone is then assigned a binary code.
• The number of bits required to encode the zones, or the number of
bits per sample as it is commonly referred to, is obtained as follows:
nb = log2 M
• Given our example, nb = 3
• The 8 zone (or level) codes are therefore: 000, 001, 010, 011, 100, 101,
110, and 111
• Assigning codes to zones:
• 000 will refer to zone -20 to -15
• 001 to zone -15 to -10, etc.
4.19
Quantization and encoding of a sampled signal
A/D Conversion A/D & D/A Conversion
22
ADC : Parameters
Number of bits N: The higher is the number of bits, the more precise is the digital
output.
Quantisation error Eq: The average difference between the analogue input and the
quantized value. The quantization error of an ideal ADC is half of the step size.
Conversion time Tconv: Time taken to convert the voltage on the sampling capacitor to a
digital output.
23
Resolution
Let n = 2 Vmax 3=11
r
M= 2n – 1
3=11
3 steps on the digital scale 2=10
d0 = 0 = 0b00
dVmax = 3 = 0b11 2=10
M = 2n 1=01
1=01