Академический Документы
Профессиональный Документы
Культура Документы
Processing
5 – A/D and D/A conversion
• Ideal continuous-time/discrete-time (C/D) conversion
• Nyquist sampling theorem
• Real A/D conversion and design issues
• Examples of ADC architectures
• Ideal discrete-time/continuous-time (D/C) conversion
• Real D/A conversion and design issues
• Examples of DAC architectures
• Down-sampling and up-sampling
1
Ideal C/D conversion
xc(t) C/D x(n)
Continuous-time signal Discrete-time sequence
T Sampling period
x n xc nT xc t
n
t nT «Digital» frequency
«Analog» frequency T
Continuous-time F
2k 1 2k 1 2k
X c
1
X e j X c Xc
k
T T T k T T k T T
The spectrum (or PSD) of a sampled signal consists of infinite (scaled) replicas
centered at 2πk/T in the continuous frequency domain Ω or at 2π in the discrete
frequency domain ω
2
Frequency-domain representation
X c
1
N N
Infinite spectral replicas
X s
1
Multiply times 1/T T
… …
4T 2T N N 2 4
T T
1
T
X e j In the digital frequency
domain the frequency axis
is «stretched» or
«compressed»
…
…
4 2 N T N T 2 4
3
Nyquist sampling theorem
• Let xc(t) be a bandlimited signal with
X c 0 for N
• Then xc(t) is uniquely determined by its samples x(n)= xc(nT) if
2
s 2f s 2 N
T
where N is generally known as the Nyquist frequency
• The sampling frequency cannot be smaller than 2 N not to incur in
aliasing of the spectral replicas. Aliasing would lead to an
unrecoverable distortion of the frequency content
Xs j s>2 N
3 s -2 s s - N N s 2 s 3 s
Xs j s<2 N
3 s -2 s s - N N s 2 s 3 s
4
Analog-to-digital conversion
Anti-aliasing Sample & Hold Analog-to-digital
(analog) filter Amplifier (SHA) x(n) converter (ADC)
xc(t) Zero-order Quantizer Coder
xB(n)
Ha(Ω) C/D Hold (ZOH) Q(∙) C(∙)
T
• The anti-aliasing filter ideally has a constant (e.g. unit) gain and a cutoff
frequency equal to π/T to make the signal bandlimited and to meet the Nyquist
theorem requirements. In practice, it should be as simple as possible (i.e. not
very selective)
• The SHA samples the input signal and it keeps it constant for a time long enough
to assure proper A/D conversion. The hold time TH≤T
• The ADC at first maps the input signal (e.g. a staircase voltage) into one of the
levels of the quantizer, and then it returns a binary code associated to this level.
5
Basic sample & hold architecture
• In order to perform a correct A/D conversion correctly, the signal has to be
kept constant approximately for all the duration of the quantization process
Switch can be
modeled as a time
varying resistor
Hold capacitor CH
stores the input value
Ideal behavior
• When vc(·)=1 then vy(·)= vx(·): signal is tracked
• When vc(·)=0 then vy(·)= cost.
• Ton negligible
Real behavior
• Ton could not be negligible compared with sampling period T . In this case
we have spectral distortion
6
General design criteria
Sampling mode
• Output must track quickly input variations without filtering then ON=RONCH small
8
Quantization error: stochastic model
• As quantization is a non-linear operation, a full analytic model is complex.
• However, if the input signal changes randomly and the difference between two
consecutive samples is much larger than the quantization step, the error can be
modeled as a realization of an additive stochastic process eq[·] having the
following characteristics
– White and stationary
– Uncorrelated from the input signal xs
– With a uniform pdf in: x + xq
• [-Q/2,Q/2] (if rounding is used)
• [-Q,0] (if a truncation is used) eq
• The model holds exactly if the input signal x(·) is a white noise
• The mean value and the variance of the quantization noise are respectively:
q 0 Q2
q2 (rounding case)
12
Q Q2
q q2 (truncation case)
2 12
9
Signal-to-noise and quantization ratio
• If we consider an ideal bipolar ADC with B bits (i.e. 2B levels)
2 2 12 2 3 2B
SQNR 10 log10 2 10 log10 x 2 10 log10 x
x 2
q Q FS 2
3
SQNR 6.02 B 20 log10 x 20 log10
FS
• Every additional bit of resolution improves SQNR by 6 dB
• If truncation instead of rounding is used in the quantizer, for the same number of
bits the SQNR is 4 times smaller
• In order to maximize the SQNR, the input signal should be properly amplified to
exploit the whole input range of the A/D, i.e. [-FS, FS]. For this reason, most
ADCs include a programmable gain amplifier before the quantizer.
• If we assume that x(n) is uniformly distributed in [-FS, FS], then
FS 2 FS 2 2 2 B 2 2 B 1 x2
x2 q
2
x 2
2
B log2 2
3 12 2 q
10
Effective number of bits (ENOB)
• In real ADCs, actual performances for a given number of bits are lower than in the
ideal case due to:
– Imperfections of ADC circuitry nonuniform quantization harmonics and spurious
tones in the output spectrum
– Additional wideband noise sources due to thermal and semiconductor noises in the
front-end acquisition circuitry (SHA and anti-aliasing filter)
– Additional noise overlapped to the input signals
• All these contributions can be assumed to be uncorrelated.
Additional ADC noise Other noise sources
external to ADC
1 x2
t2 q2 c2 a2 q2 w2 ENOB Be log2 2
2 t
(Total) signal-to-noise ratio (SNR)
Notes
1 x2 1 q2 • ENOB is a function of frequency
Be log2 2 B log2 2
2 t 2 q w2 • ENOB can be computed as a function
of SINAD (i.e. ratio between the signal
1 2 1 2 power and the total noise power
B log2 1 w2 B log2 1 2 2 B (wideband+narrowband terms) when
w
2 q 2 2 the test signal is a FS-large sinewave
x
11
Selection criterion of ADC resolution
Be
w2 q2 Be B 0.5 Corner points
w2 q2 Be B …
16
Bopt
12
w
10 w2 q2 Be log2
8 x
…
*w
log2 * log2 w
x x
• In a given application, if the additional noise power can be estimated, the
optimal ADC resolution is the value of B for which the corner point is
reached, i.e. *w Round-to-the-nearest-
Bopt log2 *
x integer operator
• If B>Bopt the ADC is more accurate (and expensive) than necessary (the
additional bits of resolution cannot be exploited)
• If B<Bopt the performance degrades because of larger quantization noise
12
ADC types
Typical mechatronic
applications
In general, 1 bit of nominal resolution is lost when the sampling frequency doubles
13
Example: flash ADC - 1
Example: B=3
+VR xc
• Simultaneous comparison between xc(∙) and
2B-1 Tx obtained from a resistive network
3R/2 +
T7 -
• Comparators are clocked SHA not required
R +
T6 -
• Comparator outputs are thermometer - R
+
encoded, e.g. all comparators for which T5 -
xc(∙) <Tk returns ‘0’, while the others return ‘1’ Decoding b2
R +
T4 Digital xB
- b1
network
• A digital binary encoder maps the comparator
R + b0
output sequence into a classical integer or T3 -
2’complement representation
R +
T2 -
• Good component matching is required
R +
T1 -
XC(C2) 100 101 110 111 000 001 010 011
VXq -4 -3 -2 - 0 + +2 +3 R/2
VX
Tk -7/2 -5/2 -3/2 -/2 +/2 +3/2 +5/2
-VR
14
Example: flash ADC - 2
• Flash ADC are simple, but the number of comparators and resistors
grows exponentially with B
– High chip area
– High design complexity
– High power consumption
– High risk of component mismatching poor accuracy due to nonuniform Tx
15
Example: multi-step ADCs
• Multi-step ADCs enable a higher output resolution at a slower sampling
frequency by dividing the conversion operations into a sequence of multiple
steps. Three possible solutions exist:
– Ripple-through
– Pipeline
– Successive approximations
Ripple-through
Clock signals N identical stages
0 1 n N • Each stage consists of an
vX VY VR1 VRn-1 VRn VRN-1 ADC, a DAC, a subtractor
SHA stage 1 stage n stage N and an amplifier
XC1 XCn XCN
• The residual (difference)
from 1 stage becomes the
quantity to be converted by
the following stage
VRn-1 ADC DAC VCn VRn
-+ 2bn
bn bit bn bit • Amplification by 2B may be
required to adapt the
n XCn data out residual to the input range
16
When a SHA should be used?
• General rule: variations of the input signals xc(·) must be lower than 1/2 LSB
for all the time required for A/D conversion, i.e.
xc t c TADC
dx Q
dt t 2
• If a sine wave is considered xc t A sin2f 0t the previous condition is
met in the worst case (max. slope of a full scale sine wave, A=FS) if:
2 FS 1
xc t 2f 0 FS TADC f 0max
2 B 1 2 2 B TADC
• This condition is very strict. If B=12 and TADC= 10 s f0=4 kHz <<1/TADC
• A SHA assures that the sampled input signal is constant, thus increasing the
input frequency range. In this case:
1 1
f 0max
2TCmin 2 TACQ TAP Ts T j max TADC
ADC
conversion
S/H acquisition time(tracking) S H transient time Settling time Jitter (max) time
17
Ideal D/C conversion - 1
y(n) D/C yc(n)
Discrete-time sequence Continuous-time (reconstructed) signal
Yc TY e jT for T Ideal low-pass
reconstruction filter
1
T
Y e jT
… T …
4T 2T T N N 2 4
T T T
18
Ideal D/C conversion - 2
• In the time domain, the low-pass filtering leads to the following result:
yc t
1 jT T jT jT
d
T T
Y e d Y e e
2 2
c
T T
y n
j t nT
y n sinc t nT
T
d
T
e
n
2 T
n
T
• This means that the analog signal can be obtained through interpolation,
namely from the linear combination of infinite replicas of sinc functions
centered at times nT. Unfortunately, as known, this implementation is not
feasible.
Hr(Ω)
Continuous-time F-1
T
T
19
Digital-to-Analog conversion
• Real digital-to-analog converters (DAC), typically rely on three sections
– A binary decoder, mapping binary sequences yb(·) into quantized discrete-time
sequences y(·)
– A sample-and-hold, which turns the discrete-time sequence y[·] into a staircase analog
signal yh(·).
– A feasible low-pass reconstruction filter (also called interpolator) to smooth the output
waveform and to compensate the distortion caused by the sample-and-hold (if possible)
• A DAC does not perform exactly the reverse operation of an ADC, because the
role of the sample-and-hold is intrinsically different.
• Unlike the ADC case, just a few DAC architectures exist. However, also in this
case, higher resolution requires lower sampling rates and vice versa.
20
Sample-and-hold distortion
|HH(Ω)|
hH(t) Continuous-time F
1
0 T t Ω
Inpulse response of a Magnitude of the frequency
zero-order hold function response
y H t y n rect t TnT yn t nT * rect Tt
n n
F
2k j2T
2T e 2T Y 2Tk
jT
YH Y e jT 1 1
e sinc 2
sinc
k
T T T k
• The spectrum of the output signal is modulated by a sinc(∙) function. As a consequence,
the spectral replicas for k≠0 are strongly attenuated, while the component for k=0 is
smoothed due to the roll-off mainlobe of the sinc(∙) function.
21
Compensated reconstruction filter
• The reconstruction filter should be designed, so as to compensate for
the distortion caused by the zero-order hold function, i.e.
T
H H T
H r
~
0 otherwise
H r
~
T
T
• Note: The spectral distortion due to the S/H theoretically is also present
in the acquisition stage (i.e. before the ADC). However, in that case it
does not affect the spectrum of the sampled signals, because the ADC
circuitry just operates on the «held» values as if they were numbers,
regardless of pulse duration.
22
Example: binary-weighted voltage DACs
VR
• The current flowing in the n-th
R R/2 … R/2(b-1) resistor when the switch controlled
Rr by the n-th bit is closed is:
b1 b2 bb
VR
- Vo In
LSB MSB
+ R / 2n 1
VR VR n 1
Vo Rr bn n 1
Rr bn 2
n 1 R / 2 R n 1
Problems
• Difficult to build precise resistors with values in the range [R, R/2B-1] Bmax= 6-8
• Sudden large current drains from VR fluctuations due VR internal resistance and
glitches when multiple bits change at the same time low accuracy as b grows
• Voltage drop across closed switches modifies the ideal resistance values
23
Example: binary-weighted current DACs
I 2I … 2b-1I
Rr
b1 b bb
- Vo
LSB MSB
+
• Advantage: voltage drop across switches do not affect the output voltage
• Unresolved problem: it is difficult to build precise current generator with
values in the range [I, 2B-1I]
24
An example of binary weigthed DAC
25
Example: R-2R ladder network DAC
R R 2R
VR
VR 2R 2R 2R 2R
IR Rr
R
b1 b2 bb
0 1 0 1 0 1 0 1 Vo
-
+
V 1 1
Vo Rr I R bn n Rr R bn
n 1 2 R n 1 2n
26
Example of R-2R ladder DAC
Maxim MAX541-MAX542
• Full 16-Bit Performance Without Adjustments
• +5V Single-Supply Operation
• Low Power: 1.5mW
• 1 μs settling time
• Maximum Fs=10 MHz
27
Unit-Element Current Source DACs
• Higher conversion speed by:
1. Encoding the input binary word using a thermometer
encoder: B bits c=2B output values
2. If xb is the input integer value, we have that the xb least
significant lines of c are active (e.g. high)
3. Encoder outputs enable/disable a matrix of equal
current generators IU
4. Unit-element current values sum-up like in the binary-
weighted case so that
2B
Vo Rr IU c
n 1
n
Advantages
• Unit element DACs ensure monotonicity by turning
on equal-weighted current sources in succession
• No glitches when switching times in a D/A are not
synchronized (e.g. when the input changes from 011
to 100 and MSB switch is delayed)
28
Segmented current-switched DACs
Basic idea
• Unit-element current generators for
MSBs and binary-weighted sources
for LSBs
29
Digital processing of analog
signals: summary
• If we consider a complete system for real-time signal processing
xa(t) x(n) xB(n) yB(n) yH(t) yr(t)
xc(t)
r
~
Ha(Ω) S/H ADC H(e jω) S/H H
T T
The total frequency response is: H eff T H a H e
1 jT
H H H r
~
e
jT
w
where H eff e
jT
w
H eff is the wanted
H' e jT effective frequency response of the
H a H H H r
1 ~
T whole system
30
Down-sampling (decimation)
• Down-sampling is used to decrease the sampling rate by an integer
factor M (called decimation factor)
• It can be used when the computing platform or the communication
channel are not able to process or to transfer the samples at the
conversion rate.
x(n)=xc(nT) M xd(n)=x(nM)
Compressor: selects one samples every M
X d e j 1
MT
k
X c
2k 1
MT MT
T '
k
X c
T'
2'k
T
• Note: Aliasing can be avoided if and only if X e j 0 for / M
If this condition is not true, the signal must be bandlimited with a low-
pass filter before compression, i.e.
Low-pass filter
x(n)=xc(nT) Gain=1 M xd(n)=x(nM)
Cutoff=π/M
31
Examples
Downsampling without aliasing (M=2) Downsampling with aliasing (M=2)
The LPF is not strictly
necessary, but it is
better using it!
X e j
X e j
A LPF has to be
used!
1
1
M
M M M
T
In the case on the right, to avoid aliasing the signal has to be preliminarily
filtered. However, some information would be lost in any case.
32
Up-sampling (interpolation) - 1
• Up-sampling is used to increase the sampling rate by an integer factor L
(called interpolation factor)
• It can be used to relax the selectivity requirements of the anti-aliasing filter
simpler filter, since spectral replicas are farther from one another.
• Up-sampling also requires two cascade subsystems
xe(n) Low-pass filter
x(n)=xc(nT) L Gain=L xi(n)
Cutoff=π/L
Expander: adds L-1 zeros Interpolator: replace the
between 2 consecutive zero samples with those
samples resulting from interpolation
x
xe n
nL n 0, L ,2 L ,...
0 otherwise
F
2k
X e e j 1
T
L 2k 1
T T LT c T LT
Xc X ' ' '
k k
33
Up-sampling (interpolation) - 2
X e j
L
L
• An interpolation factor of L leads, in the digital frequency domain,
to a compression of spectrum by a factor of L and to L replicas in
the baseband images which are removed by the final LPF
X i e j L Xc 2k' 1 Xc 2'n
LT ' T '
LT T' T '
T
k n
k 0 , L ,...
34
Up-sampling (interpolation) - 3
• In the time domain ideal interpolation relies on noncausal sinc(∙) function
hi n
sin Ln
n
L
L L n
~x n
i k h
k
lin n kL xi n
• Note: ADCs based on «oversampling» work purposely with a sampling
rate higher than needed, to better remove the wideband noise through a
subsequent digital decimation
35