Sistemas de Aquisição de Dados Mestrado Integrado em Eng. Física Tecnológica 2016/17 Aula 3, 3rd September
The Data Converter Interface Analog Media and Transducers Signal Conditioning Signal Conditioning A/D D/A Digital Processing Sensors, Actuators, 2
Ideal Data Converters A/D Conversion D/A Conversion
ADC Uniform Sampling and Quantization Most common way of performing A/D conversion: Sample signal uniformly in time Quantize signal uniformly in amplitude Key questions 1 How much "noise" is added due to amplitude Quantization? 2 How can we reconstruct the signal back into analog form? 3 How fast do we need to sample? Must avoid "aliasing"
How to describe time sampling using Math? -> Dirac Pulses X = Signal f(t) T = Dirac Comb n= X = n= Sampled Signal (t n T ) f a (t) By definition of Delta function f(t 0 ) = f(t) (t t 0 )dt Sampled signal (continuous time) f a (t) = T f(t)
Fourier Transform F (w) = f(t)e iwt dt f(t) = 1 2 F (w)e iwt dw FT Properties: 1) If f(t) is Real 2) Convolution FT g(t) = f 1 (t) f 2 (t) F ( w) = F (w) (Symmetry of FT) f 1 (t) f 2 (t) T F F 1 (w) F 2 (w) (Inverse) f 1 (t) f 2 (t) T F 1 2 F 1(w) F 2 (w) f 1 ( )f 1 (t )d
The FT of the Dirac Comb T (t) T (t) = n= n= n= n= (t n T ) C n e iw nt, com W n = 2 T, e C n = 1 T T (t) = n= n= It is a periodic Function, so: it can be written as a Fourier Series 1 T eiw nt T 2 T 2 T (t)dt = 1 T Inverse FT of Dirac Comb: 1 2 2 T W T (w)eiwt dw = 1 T 1 T n= n= n= n= e inw T t = T (t) T (t) T F (w n W T ) = 2 T W T (w)
Fourier Transform of the Sampled Signal F a (w) = n= n= f a (t) = T f(t) T F (w n W T ) F (w) = F a (w) = 1 2 T F { T }(w) F (w) n= n= n= n= ( n W T ) F (w )d F (w n W T ) F (w) F a (W ) W T W T w * =... W T 2W T w W T... Convolution
The Reconstruction Problem: The sampled signal f a (t) information about the original? carries ALL the f(t) f a (t) (i.e. Is it possible to recover from the sampled version?) Rephrasing the question in the Frequency Domain: Is it possible to recover the Spectrum of the original signal?
Can we recover the original F(w) Spectrum from Fa(w)? F (w) Low Pass Filter F a (W ) W T W T w =... W T 2W T w W T... YES! Sampling Freq F (w) W T W T w =... F a (W ) W T 2W T w W T... NO! In the second case it is impossible to recover the original spectrum
Frequency Aliasing The frequencies fsig and N fs ± fsig (N integer), are indistinguishable in the discrete time domain
Nyquist Shannon sampling theorem The frequency spectrum is periodized by the timed sampling process, and it can overlap: (period WT=2π/Tsampling) - ALIASING A real signal with a frequency range DC(0Hz) -> Fmax must be sampled at a minimum frequency Fsamp 2 Fmax 12 x 16 (192) LEDs To avoid ALIASING for signals with an unknown frequency spectrum we need to eliminate frequency components Fsamp / 2 by Analog Filters before sampling In a more general way, for real signals with frequency spectrum limited to an bandwidth F= Fmax - Fmin, the minimum sampling frequency, is n: Fa 2 F Jim CampbelL Portrait of a Portrait of Harry Nyquist (2000)
Sampling Limited Bandwidth Signals When fmax M Δf, M integer Example: 3 Δ f = fmax F a (W ) f sam =2 Δf = 2 f max /M W T When fmax = M Δf Example M= 4 F a (W ) 3 W T f 4 Δf = f max samp = 2 Δf = f max /2 f sam =2 Δ f = 2/3 f max 3 Δf ext = f max w -f samp f samp = 2 Δf ext = 2 f max /3 w 3 W T
Sampling Baseband bandwidth signals. (Bandwidth equals the upper frequency) In order to prevent aliasing, we need f sig,max < f samp /2 The half of sampling rate f Nyq = f s 2 is called the Nyquist rate. Two possibilities: Sample fast enough to cover all spectral components,including "parasitic" ones outside band of interest. (eg. harmonics) Limit f sig,max through filtering, e.g. Anti-Alias
Data Converters A/D Conversion D/A Conversion
Ideal Brick Wall Anti-Alias Filter There is no Ideal Filters
Practical Anti-Alias Filters
Anti-Aliasing Analog Filters Ideal Filter A=1 Signal with unknown Spectrum Bandwidth LP Filter fs/2 fs/2 A=0 ADC F (w) Correctly Sampled signal PRATICAL ANALOG! Filter 18
Sampling A/D Conversion D/A Conversion
Sampling & Hold Finite Time window limitation A/D Converter takes always some time to do the conversion process Δt t ADC Aperture Window
S&H Uses: ADC and DAC
S&H and Track & Hold
S&H Circuit Voltage Follower Sampling Clock
S&H Artefacts Pedestal Step Cross talk from the switching pulse Droop Charge leak from the hold capacitor Hold-mode feedthrough Transfer from source to the output Aperture time
ADC Quantiser A/D Conversion D/A Conversion
The Transfer Function of an Ideal Analog-to-Digital Converter Digital Output 111 110 101 T 100 011 11 ALSB 010 001 1/2 ALSB Resolution 000 0 1/8 1/4 3/8 1/2 5/8 3/4 7/8 FS ANALOG INPUT LSB = full scale 2 N, A LSB = V ref 2 N 26
Quantization Noise (error) 2-bit ADC
Quantization Noise of an ideal ADC Converter 111 emáx= 1 LSB / = q/2= FS/2 N 110 101 T 100 011 1 LSB 010 1/2 LSB 001 000 0 1/8 1/4 3/8 1/2 5/8 3/4 7/8 FS As a dynamical system, the ADC sums a varying error (noise) to the input AC signal ANALOG INPUT e(t) v(t) ADC va(t) + e(t)
Quantization Noise Power Spectrum for stochastic noise Generally, Noise Power is equally distributed in the bandwidth DC fnyq E(w) q/ 12 f a /2 +fs/2 +fs/2 f White Noise, frequencies normally NOT correlated with the input signal Exception: When harmonics of the input signal are equal to fsamp
Quantization Noise for a harmonic signal
Quantization Noise Estimation for a periodic triangular signal AC Signal DIGITAL OUTPUT Difference: e(t) = Noise! ANALOG INPUT t ERROR (INPUT OUTPUT) q = 1 LSB e(t) = st, q 2s < t < q 2s
e(t) = st, e 2 (t) = s q e 2 (t) = q2 12 q 2s < t < q 2s + q 2s q 2s RMS of Quantization Noise (triangular signal) (st) 2 dt = s3 q + q 2s q 2s t 2 dt = s3 q SNR = 10 10 log t 3 3 + q 2s q 2s ( ) Signal power = 20 10 log noise power ( Vsignal,rms V noise,rms ) Noise power (RMS) = e 2 (t) = q 12
SNR for Full Range Sine wave A=q 2 N-1 e(t) 5-4 -3-2 -1 0 1 2 3 4 5 v(t) =q 2 N-1. sin (wt) RMS = A 2 = q 2N 2 2 ADC RMS = q 12 SNR? SNR = 20 log 10 InputSignal RMS Noise RMS = 20(log 10 2 N + log 10 r 3 2 ) SNR for an Ideal N-bit ADC SNRid = 6.02 N +1.76 db For a real ADC the SNR is lower! (SINAD) ( ) SINAD = 10 10 Power of first harmonic log Power of all unwanted components Effective Number of Bits: ENOB = SINAD 6.02 1.76 db
Bibliography Data Conversion Handbook, Chapter 2 Analog Devices Inc., 2004 http://www.analog.com/library/analogdialogue/archives/39-06/ data_conversion_handbook.html Analog-to-Digital Conversion, Second Edition, Marcel J.M. Pelgrom, Springer 2013 Data Acquisition and Control Handbook, A Guide to Hardware and Software for Computer-Based Measurement and Control, Keithley http://tinyurl.com/q6okgxs