Chapter 3 - Signal Conversion and Processing
Chapter 3 - Signal Conversion and Processing
Analog-to-Digital Conversion
Sampling and Filtering
An anti-aliasing filter and a sample-and-hold circuit
are two functions typically found in a digital signal
processing system.
Sampling is the process of taking a sufficient number
of discrete values at points on a waveform that will
define the shape of the waveform. The more samples
you take, the more accurately you can define a
waveform. Sampling converts an analog signal into a
series of impulses, each representing the amplitude
of the signal at a given instant in time.
The sampling theorem states that, in order to represent an analog signal, the sampling frequency,
, must be at least twice the highest frequency component () of the analog signal.
> ()
Analog-to-digital conversion is the process of converting the output of the sample-and-hold circuit to a
series of binary codes that represent the amplitude of the analog input at each of the sample times.
If the resulting 4-bit digital codes are used to reconstruct the original
waveform, you would get the waveform shown in Figure below.
As you can see, the result is much more like the original waveform than
for the case of four quantization levels. This shows that greater accuracy is
achieved with more quantization bits.
Checkup
What does sampling mean?
Sampling is the process of converting an analog signal into a series of impulses, each representing the
amplitude of the analog signal.
If the highest frequency component in an analog signal is 20 kHz, what is the minimum sample
frequency?
The minimum sampling frequency is 40 kHz.
Flash ADC
The flash method utilizes special high-speed comparators that compare reference voltages with the analog input
voltage.
When the input voltage exceeds the reference voltage for a given comparator, a HIGH is generated.
The number of bits used in an ADC is its resolution.
Advantages:
It provides a fast conversion time because of a high throughput, measured in samples per second (sps).
Disadvantages:
The large number of comparators necessary for a reasonable-sized binary number
Flash ADC
This figure shows a 3-bit converter
that uses seven comparator circuits;
a comparator is not needed for the
all-0s condition.
In general, comparators are
required for conversion to an n-bit
binary code.
The reference voltage for each
comparator is set by the resistive
voltage-divider circuit.
The output of each comparator is
connected to an input of the priority
encoder.
The encoder is enabled by a pulse on
the EN input, and a 3-bit code
representing the value of the input
appears on the encoders outputs.
The binary code is determined by
the highest-order input having a
HIGH level.
Flash ADC
Example 1 Determine the binary code output of the 3-bit flash ADC in Figure above for the
input signal in Figure below and the encoder enable pulses shown. For this
example, = + .
Flash ADC
Solution
The resulting digital output sequence is
listed as follows and shown in the
waveform diagram of the figure on the
right in relation to the enable pulses:
100, 110, 111, 110, 100, 010, 000, 001,
011, 101, 110, 111
If the enable pulse frequency in Figure of Example 1 were halved, determine the binary
Home
numbers represented by the resulting digital output sequence for 6 pulses. Is any
Work information lost?
Dual-Slope ADC
A dual-slope ADC is common in digital voltmeters and other types of measurement instruments.
A ramp generator (integrator) is used to produce the dual-slope characteristic.
Dual-Slope ADC
Start by assuming that the counter is reset and the output of the integrator is zero.
Now assume that a positive input voltage is applied to the input through the switch (SW) as selected by the control logic.
Since the inverting input of 1 is at virtual ground, and assuming that Vin is constant for a period of time, there will be constant
current through the input resistor R and therefore through the capacitor C.
Capacitor C will charge linearly because the current is constant, and as a result, there will be a negative-going linear voltage ramp on
the output of 1 .
When the counter reaches a specified count (n), it will be reset (R), and the control logic will switch the negative reference
voltage( ) to the input of 1 .
At this point the capacitor is charged to a negative voltage (-V) proportional to the input analog voltage.
Dual-Slope ADC
Now the capacitor discharges linearly because of the constant current from the .
This linear discharge produces a positive-going ramp on the 1 output, starting at -V and having a constant slope that is independent
of the charge voltage.
As the capacitor discharges, the counter advances from its RESET state.
The time it takes the capacitor to discharge to zero depends on the initial voltage -V (proportional to ) because the discharge rate
(slope) is constant.
When the integrator (1 ) output voltage reaches zero, the comparator (2 ) switches to the LOW state and disables the clock to the
counter. The binary count is latched, thus completing one conversion cycle.
Successive-Approximation ADC
One of the most widely used methods of analog-to-digital
conversion is successive-approximation:
It has a much faster conversion time than the dual-slope
conversion, but it is slower than the flash method.
It also has a fixed conversion time that is the same for any
value of the analog input.
It consists of a DAC, a successive-approximation register
(SAR), and a comparator.
The basic operation is as follows:
o The input bits of the DAC are enabled (made equal to a 1)
one at a time, starting with the most significant bit (MSB).
o As each bit is enabled, the comparator produces an output
that indicates whether the input signal voltage is greater or
less than the output of the DAC.
o If the DAC output is greater than the input signal, the
comparators output is LOW, causing the bit in the register
to reset. If the output is less than the input signal, the 1 bit
is retained in the register.
Successive-Approximation ADC
Example 2
Lets assume that the DAC has the
following output characteristics:
= 8 V for the bit (MSB),
= 4 V for the bit,
= 2 V for the bit,
= 1 V for the bit (LSB).
Successive-Approximation ADC
The first step in the
conversion cycle with
the MSB = 1.
The output of the DAC is
8 V.
Since this is greater than
the input of 5.1 V, the
output of the
comparator is LOW,
causing the MSB in the
SAR to be reset to a 0.
Successive-Approximation ADC
The second step in the
conversion cycle with
the bit equal to a 1.
The output of the DAC is
4 V.
Since this is less than
the input of 5.1 V, the
output of the
comparator switches to
a HIGH, causing this bit
to be retained in the
SAR.
Successive-Approximation ADC
The third step in the
conversion cycle with
the bit equal to a 1.
The output of the DAC is
6 V because there is a 1
on the bit input and
on the bit input;
4 V + 2 V = 6 V.
Since this is greater than
the input of 5.1 V, the
output of the
comparator switches to
a LOW, causing this bit
to be reset to a 0.
Successive-Approximation ADC
The fourth and final step in
the conversion cycle with
the bit equal to a 1.
The output of the DAC is 5
V because there is a 1 on
the bit input and on the
bit input;
4 V + 1 V = 5 V.
The four bits have all been
tried, thus completing the
conversion cycle.
At this point the binary
code in the register is 0101,
which is approximately the
binary value of the input of
5.1 V.
Additional bits will produce
an even more accurate
result.
Segma-Delta ADC
For example, assume that 4096 1s occur during the interval when the input signal is a positive
maximum.
Since zero is the midpoint of the dynamic range of the input signal, 2048 1s occur during the
interval when the input signal is zero.
There are no 1s during the interval when the input signal is a negative maximum.
For signal levels in between, the number of 1s is proportional to the level.
Segma-Delta ADC
The analog input signal and the
analog signal from the converted
quantized bit stream from the DAC
in the feedback loop are applied to
the summation () point.
The difference () signal out of the
is integrated, and the 1-bit ADC
increases or decreases the number
of 1s depending on the difference
signal.
This action attempts to keep the quantized signal that is fed back equal to the incoming analog signal.
The 1-bit quantizer is essentially a comparator followed by a latch.
To complete the sigma-delta conversion process using one particular approach, the single bit data stream is
converted to a series of binary codes.
The counter counts the 1s in the quantized data stream for successive intervals.
The code in the counter then represents the amplitude of the analog input signal for each interval.
These codes are shifted out into the latch for temporary storage. What comes out of the latch is a series of n-bit
codes, which completely represent the analog signal.
Testing Analog-to-Digital Converters
A DAC is used as part of the test setup to convert the ADC output back to analog form for
comparison with the test input.
A test input in the form of a linear ramp is applied to the input of the ADC.
The resulting binary output sequence is then applied to the DAC test unit and converted to a
stair-step ramp.
The input and output ramps are compared for any deviation.
Analog-to-Digital Conversion Errors
Missing Code
Example 3
A 4-bit flash ADC is shown in left-figure. The
resulting reconstructed analog output is
shown in right-figure.
Identify the problem and the most probable
fault.
Solution
The binary code 0011 is missing from the
ADC output, as indicated by the missing
step.
Most likely, the output of comparator 3 is
stuck in its inactive state (LOW).
Analog-to-Digital Conversion Errors
Example 4
Reconstruct the analog output in a test
setup if the ADC in Figure of Example 3 has
comparator 8 stuck in the HIGH output
state.
Solution
Due to the priority counter function, and
because of comp. 8 stuck in the HIGH state,
then the counter will produce a HIGH output
all the way from 0000 to 1000 as it sees the
comp. 8 is HIGH. This will change as soon as
comp. 9 is HIGH because the new high-order
level is coming from comp. 9 which is work
properly.
See the right-figure.
Checkup
Binary-Weighted-Input DAC
One method of digital-to-analog conversion uses a resistor
network with resistance values that represent the binary
weights of the input bits of the digital code.
Each of the input resistors will either have current or have
no current, depending on the input voltage level.
If the input voltage is zero (binary 0), the current is also
zero.
If the input voltage is HIGH (binary 1), the amount of
current depends on the input resistor value and is
different for each input resistor, as indicated in the figure.
Disadvantages of this type of DAC are the number of
different resistor values and the fact that the voltage levels
must be exactly the same for all inputs.
Binary-Weighted-Input DAC
Since there is practically no current into the op-amp inverting (-)
input, all of the input currents sum together and go through .
Since the inverting input is at 0 V (virtual ground), the drop across
is equal to the output voltage, so = .
The values of the input resistors are chosen to be inversely
proportional to the binary weights of the corresponding input bits.
The lowest-value resistor (R) corresponds to the highest binary-
weighted input (23 ).
The other resistors are multiples of R (that is, 2R, 4R, and 8R) and
correspond to the binary weights 22 , 21 , and 20 , respectively.
= = + + +
In General = = + + + +
Binary-Weighted-Input DAC
Example 5
Determine the output of the DAC in Figure(a) if the waveforms representing a sequence of 4-bit numbers in Figure(b)
are applied to the inputs. Input is the least significant bit (LSB).
Binary-Weighted-Input DAC
= + + +
=
=
Performance Characteristics of DACs
Resolution: is the amount of variance in output voltage for every change of the LSB in the digital input.
An n-bit resolution can resolve 2 1 distinct analog levels, i.e. The total number of discrete steps
equals 2 1, where n is the number of bits.
= %
Performance Characteristics of DACs
Accuracy is derived from a comparison of the actual output of a DAC with the
expected output.
It is expressed as a percentage of a full-scale, or maximum, output voltage. For
example, if a converter has a full-scale output of 10 V and the accuracy is 0.1%,
then the maximum error for any output voltage is (10 V)(0.001) = 10 mV.
Ideally, the accuracy should be no worse than 1/2 of a least significant bit.
.
= %
Performance Characteristics of DACs
Linearity: is the difference between the desired analog output and the actual output over the full
range of expected values.
Ideally, a DAC should produce a linear relationship between a digital input and the analog output, this
is not always the case.
A special case is an offset error, which is the amount of output voltage when the input bits are all
zeros.
Example 6
The DAC output in figure is observed when a straight 4-bit
binary sequence is applied to the inputs. Identify the type of
error, and suggest an approach to isolate the fault.
Solution
The DAC in this case is nonmonotonic. Analysis of the output reveals
that the device is converting the following sequence, rather than the
actual binary sequence applied to the inputs.
0010, 0011, 0010, 0011, 0110, 0111, 0110, 0111, 1010, 1011, 1010,
1011, 1110, 1111,1110, 1111
1
Apparently, the 2 bit is stuck in the HIGH (1) state. To find the problem,
first monitor the bit input pin to the device. If it is changing states, the
fault is internal to the DAC and it should be replaced. If the external pin
is not changing states and is always HIGH, check for an external short to
+V that may be caused by a solder bridge somewhere on the circuit
board.
Binary-Weighted-Input DAC
Example 7
Determine the output of a DAC when a straight 4-bit
binary sequence is applied to the inputs and the 20 bit
is stuck HIGH.
Solution
The Reconstruction Filter
The output of the DAC is a stair-step approximation of the original analog signal after
it has been processed by the digital signal processor (DSP), which is a special type of
microprocessor that processes data in real time.
The purpose of the low-pass reconstruction filter (sometimes called a postfilter) is to
smooth out the DAC output by eliminating the higher frequency content that results
from the fast transitions of the stair-steps, as roughly illustrated in figure below.
Q1
A wheel, rotating at 6 Hz, is seen in a dark room by means of a strobe light flashing at a rate of 8 Hz.
Determine the apparent rotational speed and sense of rotation of the wheel. Repeat the question if the
flashes occur at 12 Hz, 16 Hz, or 24 Hz.
Q2
Hard disk recording systems for digital audio are becoming widely available. It is often quoted that to record
1 minute of CD quality digital audio in 2-Channels stereo, one needs about 10 Megabytes of hard disk
space. Please, derive this result, explaining your reasoning.
Assume each sample is quantized with 16 bits.
Q3