Sistemas de Aquisição de Dados Mestrado Integrado em Eng. Física Tecnológica 2015/16 Aula 6-26 de Outubro
Flash Decoder Thermometer code Wired NOR based decoder 2
Successive Approximation ADC (SAR) CONVERT START ANALOG INPUT SHA COMPARATOR DAC TIMING CONTROL LOGIC: SUCCESSIVE APPROXIMATION REGISTER (SAR) EOC, DRDY, OR BUSY OUTPUT SAMPLE X SAMPLE X+1 SAMPLE X+2 CONVST CONVERSION TIME TRACK/ ACQUIRE CONVERSION TIME TRACK/ ACQUIRE EOC, BUSY OUTPUT DATA DATA X DATA X+1 3
Switched Capacitor ADC type SAR C C/2 C/4 A C/4 + - Vin Vref SAMPLE HOLDSUBTRACT -Vin i VRef C V2=Vin V t (0) = 0,V 1 (0) = V in,v 2 (0) = V in V t (t) =V 1 (t)+v 1 (t), V t = V 1 + V 1 C C// C V1=-Vin + i = C dv 1 = C dv 2 V 1 = V 2, V 1 = V t /2 dt dt V t ( ) =V Ref V 1 = V Ref /2,V 1 ( ) =V Ref /2 V in 4
Sub-ranging ADC e N = N1 + N2. 0 1 2 3 2 N1 2 2 N1 1 (A) IDEAL N1 SADC R = RANGE OF N2 SADC MISSING CODES 0 1 2 X (B) NONLINEAR N1 SADC 3 R Y MISSING CODES 5
Pipe-Line ADC (A) + T/H SADC N1 BITS SDAC N1 BITS + + T/H, Σ SADC G N2 BITS SDAC N2 BITS + Σ TO ERROR CORRECTING LOGIC CLOCK CLOCK V IN T H T H T H T H H INPUT STAGE 1 STAGE 2 STAGE 3 FLASH T/H T/H T/H T/H CLOCK INPUT T/H T H T H T H T H T STAGE 1 H T H T H T H T H STAGE 2 T H T H T H T H T STAGE 3 H T H T H T H T H FLASH T H T H T H T H T DATA OUT DATA OUT DATA OUT DATA OUT PIPELINE DELAY Figure 3.74: Clock Issues in Pipelined ADCs 6
Introduction to Digital Signal Processing (DSP) in Linear and Time-Invariant Systems- LTI Continuos LTI System (e.g. electronic circuit) Discrete LTI System (e.g. computer simulation) x(t) X(w) y(t) = x(t) h(t) 0 LTI H(w) y(t) Y(w) Y (w) = H(w) X(w) x(t x(t )h( )d = )h( )d, para sistemas causais y[n] = x[n] LTI t = n T ( T- Sampling Period) y[n] Y [z] =H[z] Y [z] y[n] = k=0 x[n k= x[n k]h[k] k]h[k] For Casual Filters 7
Fourier & Z Transforms Im Continuous LTI System Laplace Transform (LT) F (s) = 0 f(t)e st dt i Im N=8 e i 2 N 1 Re Discrete LTI System 1X X(z) =Z{x[n]} = x[n]z n n= 1 Re f(t) = 1 2 The FT is the LT when we take s = i w F (w) = 0 f(t)e iwt dt Inverse Fourier Transform (FT) F (w)e iwt dw ATTENTION: TF DFT!!!! The Discrete Fourier Transform (DFT) for a finite Series of x[n] is the z-transform, when we take. X[k] = N 1 n=0 x[n]e i 2 N kn Inverse Discrete Fourier Transform (IDFT) x[n] = 1 N z = e i 2 N k N 1 k=0 X[k]e i 2 N kn 8
0 0.4 0.8 1.2 1.6 2 2.4 2.8 3.2 3.6 Example: RC Filter Continuos LTI System Discrete LTI System x(t) LTI y(t) x[n] LTI y[n] H RC (w) = 1 1 + jw RC h(t) y[n] = k=0 x[n k]h PB [k] y(t) = 0 x(t )h( )d k=0 x[n k] T RC e kt RC h RC (t) = 1 RC e t/rc 9
Z Transform Filters 3.2 Time-Discrete Filtering 185 3.2 Time-Discrete Filtering 185 Examples Signal Integrator H(z)= z 1 1 z 1 H(z)= Comb Filter 1 1 z 1. Fig. 3.18 The comb filter as sampled-data structure and in the z-domain. The frequency response shows in a solid line the sine response (minus sign at the summation), while the dotted line represents the cosine response (plus sign) H(z)= H(z)= z 1 1 z 1 H(z)= Fig. 3.18 The comb filter as sampled-data structure and in the z-domain. The frequency response shows in a solid line the sine response (minus sign at the summation), while the dotted line represents the cosine response (plus sign) z 1 1 z 1 H(z)= The first integrator has a pole at DC: z = 1andazeroatz = 0. The most simple filter in the time-discrete domain is the comb filter. The addition of a time-discrete signal to an m-sample period delayed signal gives a frequency transfer that can be evaluated in the z-domain: H(z)=1 ± z m. H(ω) = 2 cos(ωmt s /2), This function has zeros at all frequencies where z m = ±1, resulting in m zeros distributed over the unity circle. Using the approximation z e st s results in: 1 1 z 1. The first integrator has a pole at DC: z = 1andazeroatz = 0. The most simple filter in the time-discrete domain is the comb filter. The addition of a time-discrete signal to an 1 m-sample 1 z 1. period delayed signal gives a frequency transfer that can be evaluated in the z-domain: H(z)=1 ± z m. This function has zeros at all frequencies where z m = ±1, resulting in m zeros distributed over the unity circle. Using the approximation z e st s results in: H(s) =1 ± e smt s = e smt s/2 (e +smt s/2 ± e smt s/2 ) addition H(ω) = 2 sin(ωmt s /2), subtraction, (3.28) where the sign at the summation point determines whether the cosine response 10(with equal signs) or the sine response (with opposite signs) applies (see Fig. 3.18). In this
Digital Filters (FIR) (no Feedback) FIR filters y[n] = Require no feedback (memory of past output). Are inherently stable NX b i x[n i] i=0 Can be designed linear phase (symmetric coefficients) 11
FIR FILTER V out (nt s )= k=n 1 a k V in ((n k)t s ). k=0 H(z)= k=n 1 a k z k. k=0 12
g. 3.19,thisgives n a description of the transfer of a FIR filter: out(nt s )= k=n 1 k=n 1 Filter Response k=0 Frequency H(z)= a k z k. (3.31) k=0 Response a k V in ((n k)t s ). (3.30) a description of the transfer of a FIR filter: 188 3 Sampling Fig. 3.20 Definition scheme of a filter response is transfer function from the discrete-time domain to the rm z 1 k=n 1 H(z)= is substituted a by e jωt k z k. s,whichresultsin (3.31) k=0 k=n 1 is transfer function from the discrete-time domain to the H(ω)= rm z 1 is substituted by e jωt s,whichresultsin k=0 a k e jkωt s. (3.32) Fig. 3.20 Definition scheme of a filter response Fig. 3.21 Alow-passFIRfilterwith48coefficients;left is the impulse response of the filter and f this filter is related to the choice of the weighting its analog factors. realization (dashed). Right is the frequency response of both H(ω)= k=n 1 a k e jkωt s. (3.32) e coefficients k=0are chosen symmetrical with respect to the symmetrical pair will add delayed components with an this filter is related to the choice of the weighting factors. e coefficients middle position. are chosen Thesymmetrical delay of each withpair respect and to consequently the s/2. symmetrical The same pair arguments will add delayed hold ifcomponents the coefficients with an are not of e an opposite sign ( antisymmetrical ). This linear phase e middle position. The delay of each pair and consequently /2. The same arguments hold if the coefficients are not of Low-pass FIR filter with 48 coefficients an opposite sign ( antisymmetrical ). This linear phase al delay for all (amplified or attenuated) signal components Fig. 3.21 Alow-passFIRfilterwith48coefficients;left is the impulse response of the filter and Fig. 3.22 Aband-passFIRfilterwith48coefficients;left is the impulse response of the filter and al delay its analogfor realization all (dashed). (amplified Right is the frequency oresponse attenuated) of both signal components its analog realization. Right is the frequency response of both Band-pass FIR filter with 48 coefficients can be defined with FIR filters is clearly illustrated here. However, in practical realizations the price for an accurately defined filter is the large hardware cost of the delay elements and the coefficientsandtheassociatedpowerconsumption. 13
Half Band Filters H(ω)+H(ω s /2 ω)=1 ads to such a com H(ω s /4) =0.5, ound ω 4forces (-3dB) a m = 0.5 a m+i = a m i = C i, i = 1,3,5,... a m+i = a m i = 0, i = 2,4,6,... Half of the filter coefficients are zero and need no hardware to implement 14
Digital Filtering: Reconstruction by Oversampling 15
Digital Filters II IIR filters y[n] = 1 a 0 0 PX @ b i x[n i] i=0 1 QX a j y[n j] A j=1 Require feedback (memory of past output). Stable only if all poles must be located within a inside unit circle in the z-plane P ( z <1). P i=0 b iz i H[z] = 1+ P Q j=1 a jz j Specifications can be accomplished with a lower order (Less Hardware) 16
Discrete Fourier Transform Signal DFT symmetric x(t) =2sin(2 0.5 t) + 3 cos(2 3.0 t) t = n T ; T =0.1s N=32; n=[0..31] k =[0..31]; N = 32 O Since x(t) is real, the DFT is periodic and symmetric: X[N-k] = X[-k] = X*[k] We need only to calculate values from k=0 to N/2 17
Fast Fourier Transform (FFT) Cooley-Tukey algorithm If N is a power of 2, then we split x[n], n=0..(n-1) in two series: xeven[m] = x[2m] and xodd[m] = x[2m+1], m =0..(M-1); M=N/2: N 1 N/2 1 X m=0 N/2 1 X m=0 M 1 X m=0 X[k] = X n=0 x[n] e i 2 N kn =(N 2 /2 multiplications) x[2m] e i 2 N k2m + x[2m] e i 2 N k2m +( x even [m] e i 2 M km +( X even [k]+x odd [k] e i 2 N k N/2 1 X m=0 N/2 1 X m=0 M 1 X m=0 And recursively, until DFTs of TWO valued series: x[2m + 1] e i 2 N k(2m+1) = x[2m + 1] e i 2 N k2m ) e i 2 N k = x odd [m] e i 2 M km ) e i 2 N k = X 2 [k] = 1X m=0 x 2 [m] e i km = 1X m=0 x 2 [m] ( X 2 [0] = x 2 [0] + x 2 [1],X 2 [1] = x 2 [0] x 2 [1] 1) km 18
Fast Fourier Transform (FFT) How to get the two-value x[m] series? Example M=8 Binary Bit-reverse Index b000 b000 0 b001 b100 4 b010 b010 2 (x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]) (x[0], x[2], x[4], x[6] ) ; (x[1], x[3], x[5], x[7] ) (x[0], x[4]) ; (x[2], x[6]) ; (x[1], x[5]) ; (x[3], x[7] ) b011 b110 6 b100 b001 1 b101 b101 5 b110 b011 3 b011 b011 7 bit reversal operation on microprocessor 19
After calculating all two valued DFTs, to recover X[k], we need Log2(N) * N/2 multiplications! 1 10 6 7.5 10 5 N^2 5 10 5 2.5 10 5 Log2(N)*N 500 1000 1500 2000 2500 3000 3500 4000 20
Bibliografia 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, Chapters 3,8 21