Analog Digital Sampling & Discrete Time Discrete Values & Noise Digital-to-Analog Conversion Analog-to-Digital Conversion 6.082 Fall 2006 Analog Digital, Slide
Plan: Mixed Signal Architecture volts bits Digital Signal Processing bits volts Analog to Digital store xmit/rcv modify Digital to Analog ANALOG DIGITAL ANALOG Continuous time, Continuous values Discrete time, Discrete values 6.082 Fall 2006 Analog Digital, Slide 2
Discrete Time Let s use an impulse train to sample a continuoustime function at a regular interval T: δ(x) is a narrow impluse at x=0, where f ( t) δ ( t a) dt = f ( a) Time Domain n= p ( t) = δ ( t nt ) x (t) x p (t) x(t) p(t) T time time x p (t) time 6.082 Fall 2006 Analog Digital, Slide 3
Reconstruction Is it possible to reconstruct the original waveform using only the discrete time samples? x p (t) R p x(t) Frequency Domain Looks like modulation by ω s and its harmonics X ( jω) T X p ( jω) 2ω s ωs ω M 2π T ω M P( jω) s 0 ω = 2π T ωs 2ω s ω s ω M ω M ωs ω M So, if ω m < ω s -ω m, we can recover the original waveform with a low-pass filter! T R p ( jω) ω 6.082 Fall 2006 Analog Digital, Slide 4 ω c M ω c < ω < ω ω c s M
Sampling Theorem Let x(t) be a band-limited signal with X(jω)=0 for ω > ω M. Then x(t) is uniquely determined by its samples x(nt), n = 0, ±, ±2,, if ω s > 2ω M 2ω M is called the Nyquist rate and ω s /2 the Nyquist frequency where 2π ω s = T Given these samples, we can reconstruct x(t) by generating a periodic impluse train in which successive impulses have amplitudes that are successive sample values, then passing the train through an ideal LPF with gain T and a cutoff frequency greater than ω M and less than ω s -ω M. 6.082 Fall 2006 Analog Digital, Slide 5
Zero-Order Sample & Hold Impluses are hard to engineer, so a zero-order sample & hold is often used to produce the discrete time waveform. Sample Method x p (t) T time x sh (t) T time R p ( jω) Reconstruction Filter R sh ( jω) T ω ω c M c ω c < ω < ω ω ω = 2π s M s 6.082 Fall 2006 T Analog Digital, Slide 6 ω c ω c See Chapter 7 in Signals and Systems by Oppenheim & Willsky (6.003)
Undersampling Aliasing If ω s 2ω M there s an overlap of frequencies between one image and its neighbors and we discover that those overlaps introduce additional frequency content in the sampled signal, a phenomenon called aliasing. -5 ω M 5, ω = -2 = s X ( jω) P( jω) 6 2 5 There are now tones at (= 6 5) and 4 (= 6 2) in addition to the original tones at 2 and 5. -6 0 6 X p ( jω) -8-6 -5-4 -2-2 4 5 6 8 6.082 Fall 2006 Analog Digital, Slide 7
Antialias Filters If we wish to create samples at some fixed frequency ω s, then to avoid aliasing we need to use a low-pass filter on the original waveform to remove any frequency content ω s /2. This is the symbol for a low-pass filter see the little x marks on the middle and high frequecies? ω = C ωs 2 We need this antialiasing filter it has to have a reasonably sharp cutoff Discrete- Time sampler ω s The frequency response of human ears essentially drops to zero above 20kHz. So the Red Book standard for CD Audio chose a 44.kHz sampling rate, yielding a Nyquist frequency of 22.05kHz. The 2kHz of elbow room is needed because practical antialiasing filters have finite slope Why 44.kHz? See http://www.cs.columbia.edu/~hgs/audio/44..html 6.082 Fall 2006 Analog Digital, Slide 8
Discrete Values If we use N bits to encode the magnitude of one of the discrete-time samples, we can capture 2 N possible values. So we ll divide up the range of possible sample values into 2 N intervals and choose the index of the enclosing interval as the encoding for the sample value. sample voltage V MAX V MIN 0 3 2 0 7 6 5 4 3 2 0 5 4 3 2 0 9 8 7 6 5 4 3 2 0 quantized value -bit 3 2-bit 6 3-bit 3 4-bit 6.082 Fall 2006 Analog Digital, Slide 9
Quantization Error Note that when we quantize the scaled sample values we may be off by up to ±½ step from the true sampled values. 57 The red shaded region shows the error we ve introduced 56 55 54 53 54 55 56 55 55 6.082 Fall 2006 Analog Digital, Slide 0
Quantization Noise ω s N x(t) sample scale & quantize - Quantization Noise scale N 2 Time Domain Max signal Freq. Domain NOISE( jω) Noise Asignal SNR = 20log0 = 20log0(2 A noise = N 6. 02dB.76dB if x(t) is a sine wave N ) 6.082 Fall 2006 Analog Digital, Slide ω s 2 ω s 2 In most cases it s white noise with a uniform frequency distribution
Oversampling To avoid aliasing we know that ω s must be at least 2ω M. Is there any advantage to oversampling, i.e., ω s = K 2ω M? Suppose we look at the frequency spectrum of quantized samples of a sine wave: (sample freq. = ω s ) α ω s / 2 P SNR = ω s 0log0 P SIGNAL NOISE Let s double the sample frequency to 2ω s. Total signalnoise power remains the same, so SNR is unchanged. But noise is spread over twice the freq. range so it s relative level has dropped. Now let s use a low pass filter to eliminate half the noise! Note that we re not affecting the signal at all α / 2 α / 2 2( ωs / 2) OversamplingLPF reduces noise by 3dB/octave 6.082 Fall 2006 Analog Digital, Slide 2 ω s / 2 SNR s P SIGNAL 0log0 = SNR 3dB s PNOISE / 2 2 ω = ω
DAC: digital to analog converter How can we convert a N-bit binary number to a voltage? V i = 0 volts if B i = 0 V i = V volts if B i = R OPAMP will vary V OUT to maintain this node at 0V, i.e., the sum of the currents flowing into this node will be zero. B 3 B 2 B B 0 2R 4R 8R R F V OUT OKAY, this ll work, but the voltages produced by the drivers and various R s must be carefully matched in order to get equal steps. V R V OUT F OUT = B V R B2V 2R 3 = R R F V B 3 BV B0V 4R 8R B2 B B0 2 4 8 6.082 Fall 2006 Analog Digital, Slide 3 0
Successive-Approximation A/D D/A converters are typically compact and easier to design. Why not A/D convert using a D/A converter and a comparator? DAC generates analog voltage which is compared to the input voltage If DAC voltage > input voltage then set that bit; otherwise, reset that bit This type of ADC takes a fixed amount of time proportional to the bit length V in code D/A C Comparator out Example: 3-bit A/D conversion, 2 LSB < V in < 3 LSB 6.082 Fall 2006 Analog Digital, Slide 4
Successive-Approximation A/D Data D/A Converter N Successive Approximation Generator - Done v in Sample/ Hold Control Go Serial conversion takes a time equal to N (t D/A t comp ) 6.082 Fall 2006 Analog Digital, Slide 5
Flash A/D Converter Vref vin R R R R Comparators The rm ometer to binary b 0 b Brute-force A/D conversion Simultaneously compare the analog value with every possible reference value Fastest method of A/D conversion Size scales exponentially with precision (requires 2 N comparators) 6.082 Fall 2006 Analog Digital, Slide 6
Analog input V < V < V REF IN REF Sigma Delta ADC -bit ADC integrator - - Bit stream ±V REF -bit DAC 0: add V REF, : subtract V REF Bit stream Decimator samples Computes average, produces N-bit result Only need to keep enough samples to meet Nyquist rate Average of bit stream (=V REF, 0=-V REF ) gives voltage With V REF =V: V IN =0.5: 0, V IN =-0.25: 00000, V IN =0.6: 0 http://www.analog.com/analog_root/static/techsupport/designtools/interactivetools/sdtutorial/sdtutorial.html 6.082 Fall 2006 Analog Digital, Slide 7
So, what s the big deal? Can be run at high sampling rates, oversampling by, say, 8 or 9 octaves for audio applications; low power implementations Feedback path through the integrator changes how the noise is spread across the sampling spectrum. Power Signal Spectrum of modulator s output Noise ω s 2 kω s 2 Frequencies attenuated by LPF Pushing noise power to higher frequencies means more noise is eliminated by LPF: N th order ΣΔ SNR = (3N*6)dB/octave 6.082 Fall 2006 Analog Digital, Slide 8
Summary If we sample a band-limited signal x(t) to produce discrete-time samples x(nt), then if ω s > 2ω M, then we can reconstruct the original waveform by passing the impulse samples through a LPF. Undersampling (ω s 2ω M ) will result in aliasing. Usually an antialiasing filter is used before sampling to avoid this problem. Quantizing the sampled values into 2 N discrete levels introduces quantization noise (SNR ~ 6dB*N) Oversampling reduces noise by 3dB/octave DAC architectures: summing node ADC architectures: successive approx., flash, sigma delta (combines oversampling noise shaping) 6.082 Fall 2006 Analog Digital, Slide 9