Download presentation
Presentation is loading. Please wait.
Published byGerald Hines Modified over 9 years ago
1
EKT430/4 DIGITAL SIGNAL PROCESSING 2007/2008 CHAPTER 4 SAMPLING
2
2 OBJECTIVE: After studying this lecture, you should learn to explore: Relationship between Word length and Quantization error, Meaning of specifications for various terms of ADC and DAC, Sampling frequencies and its consequences. Concept of digital frequency.
3
3 DISCRETE SIGNALS: Why ADC… Most real world signals are Analog. but Digital processing of signals need them in digital format. This requires Interfacing of analog input signal and Discrete to Digital conversion.
4
4 Sample and Hold A time-signal, when passes through a sec wide time window, it is sampled. If the window appears periodically after every T seconds, the signal is a train of discrete-time pulses of sec width & appears after every T sec. Its duty cycle is thus /T. The peak level of the sampled signal is retained by a sample and hold (S/H) circuit. The hold time should be greater than the conversion time of ADC.
5
5 Aperture time The minimum time for which the sampling switch should remain open is T ap = 1/[2 B max ] For 16bit conversion of 20 kHz signal, the required aperture time is: T ap =1/[2 16 x 2 x20x20 3 ] seconds. = 0.121 nsec.
6
6 Hold The information is saved in a temporary register; the register is a capacitor of a sample and hold (S/H) circuit. Such hold circuit is named a zero order hold (ZOH). One can choose a first order hold (FOH) also. The ZOH selects peak level, while the FOH uses trapezoid integration mode.
7
7 Discrete to Digital The output of the hold circuit, has to take a value among a predefined set of levels, termed as a digitalization of the signal. This process is called quantization. The number of levels in the set are 2 n where n is the word length. The common range of N lies between 8 to 14.
8
8 N-bit Uniform Quantization Continuous input signal digitized into 2 N levels. Quantisation step Quantisation step A =D/ L where L = 2 N Ex: D = 1V, N = 12 A = 244.1 V LSB Voltag%e ( = A) Scale factor (= 1/L=1 / 2 N ) Percentage (= 100 / 2 N ) Quantisation error -0.5 0 0.5 1 -4-3-201234 - A / 2 A/ 2
9
9 Quantization of a Ramp with eight quantization levels Step=0.7 5V
10
10 Quantization of Sinusoidal with eight quantization levels
11
11 Quantization Error is caused when a signal is discretized to a finite word length. L et D be the dynamic range; L, the number of levels; Then the resolution or, step size is A=D/L. Since there is equal opportunity for any level to occur, we take uniform probability distribution [ , ] represented by a pulse having height = 1/A and width lies in the step size range [-A/2,A/2]. Note that the area under the probability curve is unity.
12
12 Quantization Error… The variance 2 = noise power P N and Thus Noise power ; P N = A 2 /12 = D 2 /12 L 2 Or, 10 log (P N ) = 20 log D – 20 log L – 10.8 dB *For Tone frequency, it comes to 6.02dB+1.76 dB P = 1/A
13
13 (S/N) dB Letting P s be the signal power. If B=word length; L = 2 B. (S/N) dB = 10 Log (P s ) -20 log D + 20 log (2 B ) + 10.8 dB = 10 Log (P s ) + 6.02B + 10.8 - 20 log D dB. Thus For a given dynamic range and input signal power, ( S/N) dB increases @ 6.02 dB per bit increase in word length.
14
14 Example: A sampled signal that varies between - 2V to +2V is quantized using B bits. What value of B will ensure an rms quantization error of less than 5mV? Solution: The noise power fed into 1 ohm resistance is given by the square of the variance, 2 =(D/L) 2 /12. Here D is the dynamic range of the signal and L is the number of steps in quantization given by 2 B where B is the bit length. Problem specifies D = 4 V, = 0.005 V. Use the formulae to calculate B: = (D/L)/√12 = (D/2 B )/ √12; B is calculated to be 7.85 8.
15
15 A typical ADC Configuration control i/p Configuration circuitry ADC Circuit Output Interface Control circuitry Multichannel analog i/p Control inputs power Digital output Output status
16
16 ADC Configuration Circuitry permits to configure output in either Unipolar, Bipolar or 2’s complement format, to suit applications. Control circuitry permits control of input channel, leveling of the analog input, control of sample and hold circuit, buffering the output, and to transfer it in serial or, parallel format etc. Output controls flag of conversion, transfer of data.
17
17 Mathematical model of DAC b’s represent presence or, absence of different binary numbers. X u = [b 1 2 -1 + b 2 2 -2 +………+ b b 2 -b ]; b’s are either 0 or 1. Maximum value being [1 – 2 -b ], for four bits, output ranges between: 0 – 0.9375 X b = [b 1 2 -1 + b 2 2 -2 +………+ b b 2 -b - 5]; Note: the first bit is sign bit, 1 being positive. for four bits, output ranges between -0.5 : + 0.4375 X c = [b c 1 2 -1 + b 2 2 -2 +……+ b b 2 -b – 0.5]. Note: in 2’s complement expression of X c,, the code for the first number is complemented and 1 is added. It is equivalent to binary polar with off-set coding and sign bit complemented]
18
18 Table of different coding Table : Converter codes for B = 4 bits, and input 10 volts. b1b2b3b4b1b2b3b4 natural binaryoffset binary2's C mX Q =Qmm'X Q =Qm'b1b2b3b4b1b2b3b4 --1610.00085.000-- 1111159.37574.3750111 1110148.75063.7500110 1101138.12553.1250101 1100127.50042.5000100 1011116.87531.8750011 1010106.25021.2500010 100195.62510.6250001 100085.00000.0000000 011174.375-0.6251111 011063.750-2-1.2501110 010153.125-3-1.8751101 010042.500-4-2.5001100 001131.875-5-3.1251011 001021.250-6-3.7501010 000110.625-7-4.3751001 000000.000-8-5.0001000
19
19 Different types of ADCs random Generally: Suitable for any signal i) Flash: Instant: susceptible to errors ii) Single slope Method: noise prone iii) Dual slope Method: slow, accurate iv) Successive Approximation: Fastest, best. For continuous signals with time-slope in known limits. i) Delta Modulation ADC ii) Adaptive Delta Modulation ADC iii) Sigma Delta Modulation ADC etc.
20
20 DAC A word-length of pulses are passed through a weighted resistance network. The output waveform looks like a staircase. This waveform is passed through a low pass filter for smoothening. The low pass filter (LPF) should have linear phase characteristic. An ideal zero order hold (ZOH) is a suitable LPF.
21
21 Zero-Hold Circuit: a low pass filter The transfer function h(t) of a hold circuit is: Note linear phase-frequency characteristic.
22
22 Effect of Change of duty cycle of a pulse on frequency response: Note: product of height and first zero crossing of frequency is unity
23
23 Schematic of DAC Configuration Circuitry D/A Conversion Circuitry Input Interface Control Circuitry Analogue Output Power Supply Control Inputs Digital Inputs Configuration Inputs
24
24 Mathematical Models of DAC An DAC can be: Unipolar Natural Binary Bipolar off-set binary Two’s complement. The word length: b-bits, MSB to LSB. DAC Analog output R (reference) LSB MSB B input bits b1b1 b2b2 b3b3 bBbB XQXQ
25
25 ALIASING Dictionary meaning: False presentation. For faithful recovery of the modulating signal, carrier frequency 2.bandwidth of interest. It is called Nyquist Criteria-1. It is also applicable to sampling. Sampling is SC-AM. Here we multiply a train of pulses with signal. The train of pulses here is carrier-wave.
26
26 What is Aliasing? According to the Fourier Transform, a time domain impulse train having time period of T s seconds, results into a frequency train at frequency difference of f s = 1/T s. When a signal having a frequency f a is sampled by an impulse train spaced at T s = 1/f s, translates the spectra in frequency domain around every integer multiple of f s represented by [(nf s -f a ) – (nf s +f a )].
27
27 What is Aliasing? If f s /2 < f a, the spread of spectra alias that is interlace with each other. It prohibits signal’s reconstruction. To illustrate, we take a band of frequencies between 0 to f a. In the Nyquist range, aliases can be at (f Nf s ). Take values of N Such that these frequencies lie in the range fs/2.
28
28 Sampling Base-band signals (a) Base band signal: (f MAX = B). (a) (b) Time sampling frequency repetition. f S > 2 B no aliasing. (b) (c) aliasing ! (c) f S 2 B aliasing ! Aliasing: signal ambiguity in frequency domain
29
29 Antialiasing filter Filter it before! (a),(b) Out-of-band spectra can aliase into band of interest. Filter it before! (a) (b) (c) Passband : depends on bandwidth of interest. Attenuation A MIN : depends on ADC resolution ( number of bits N). A MIN, dB ~ 6.02 N + 1.76 Out-of-band noise magnitude. Other parameters: ripple, stop-band frequency... Antialiasing filter (c) Antialiasing filter
30
30 Under-sampling ?? m is selected so that f S > 2B Advantages Slower ADCs / electronics needed. Simpler antialiasing filters. f C = 20 MHz, B = 5MHz a. Without under-sampling f S > 40 MHz. b. With under-sampling ?? f S = 22.5 MHz (m=1); = 17.5 MHz (m=2); = 11.66 MHz (m=3). c.Example Nyquist theorem: Maximum frequency of interest? Maximum Bandwidth of interest? Or, in the spirit of Nyquist For base-band, both are same. Shift band pass signal to base-band signal
31
31 Over-sampling: improves quantisation signal to noise ratio One bit equivalent quantisation SNR is improved on each quadruple over-sampling. This trade off is efficiently used in noise-shaping. The unutilized signal power dispersed due to quantization, is absorbed and thus utilized by the frequency spectra created due to over-sampling. for details refer (a) Orfanidis, ‘Introductin to signal processing’ PHI, pp.67-71’ (b) Ambarder,’Analog & Digital signal processing’ 2/e, pp463-465.
32
32 Let us take a problem on aliasing.. A 100 Hz sinusoidal is sampled at rates of (a) 240Hz, (b) 140 Hz, (c) 90 Hz and (d) 35 Hz. Workout each case for aliasing signals? Solution The signal is: x a (t) = cos(2 f t ) ; f=100 is the signal frequency, f s is the sampling frequency and N is an integer. New spectra of frequencies in the Nyquist range decided by the sampling frequency is calculated using the formulae (f Nf s ). Hence: (a) f = 240 Hz > 200 Hz, calls for absence of aliasing. (b) For f =140 Hz, aliased frequency component is: f a =(100 –140) = -40 Hz. The aliased Signal is: x a (t) = cos(-80 t ) = cos(80 t - ).
33
33 (c) When fs = 90 Hz, f a = (100-90) Hz = 10 Hz. The aliased Signal is: x a (t)=cos(20 t ), (d) When f s = 35 Hz, f ad = (100 – thrice 35) Hz = -5 Hz. Thrice is taken so that the alias is in principal frequency range. The aliased signal is : x a (t) = cos(-10 t ) = cos(10 t - ). Note the phase change in (b) and (d) above.
34
34 Yet another example on aliasing.... Given x(t) = 4 + 3cos( t)+2cos (2 t)+cos (3 t),t is in msec. Determine the recovered signal x a (t) if the signal is sampled at half its Nyquist rate. Maximum signal frequency is 1.5 kHz. Hence the Nyquist rate is 2x1.5 = 3 kHz. The signal x(t) is sampled at half the Nyquist rate i.e. at 1.5 kHz. The range of output frequencies lie within-0.75 kHz ≤ f ≤ 0.75kHz. Result: x a (t) = 5 + 5cos ( t) and the waveforms:
35
35 Waveform :
36
36 Yet another problem… The above signal can be rewritten as: x(t) = 3sin ( t) + 2sin (5 t) = x 1 (t) + x 2 (t). X 1 (t), since lies in the Nyquist range -0.5f s ≤ f ≤ 0.5f s,, will not alias. However x 2 (t), since lie out side the Nyquist range, alias. The resulting frequency will be [5 t- 6 t= - t]. The output is x a (t)=3sin ( t)+2sin (- t)= sin ( t). Resulting waveforms in next slide
37
37 The waveform of DSP02_04_G
38
38 summary: 1.DSP involves time and amplitude quantization. 2.Time quantization: To avoid aliasing, the sampling frequency f s should be twice the maximum signal Bandwidth of interest. 3. We can as well increase f s. Higher f s implies more sampled data more processing time more storage space. Value of f s is decided by the maximum signal bandwidth of interest. This highest filterable frequency is decided from the spectra of the signal. 4.It is a source of error.
39
39 summary: 5.Anti-aliasing (pre) filtering truncates the signal by removing the rejectable frequency component of the signal. 6.ADC is used for level quantization (digitalization). Higher word-length, n, too will require more processing time and more storage space. 7.“Time sampled and amplitude quantized” data is processed in DSP. 8.Output of DSP may be converted back in analog form using DAC followed by post-filtering. It uses analog electronics.
40
40 Anti-aliasing Filter It is also called a pre-filter, a post-filter is employed after DAC, if used. It is an analog filter. It can be a low-pass or, band pass one with linear phase characteristics. Error is caused due to spectra truncation of the signal. The brick-wall characteristic is ideal, but not practically realizable. The low-pass filters can be complex.
41
41 Defining digital frequency Digital frequency, F D, is a concept. It is normalization of frequencies. Use of it reduces calculations. It is a ratio of signal frequency to sampling frequency: F D = f/f s. Units are cycles/sample. f s is samples per second.
42
42 Defining digital frequency |F D | ≤ 0.5 is the newly defined Nyquist range, here the signal is completely recoverable. An input signal can be sampled at some frequency f s1 and reconstructed at other frequency say f s2. The frequency of the recovered signal will be multiplied by the factor: (f s2 /f s1 ) provided that Nyquist range is maintained...
43
43 Example illustrate frequency scaling due to different sampling rate at recovery.... A 100 Hz sinusoidal (f x ) is sampled at S Hz. The sampled signal is then reconstructed at 540 Hz. What is the frequency of the reconstructed signal f r, if (i) S = 270 Hz (ii) 70 Hz. (a) For S1 = 270 Hz, the digital frequency of the sampled signal is F D = 100/270. It lies in the principal period. The frequency of reconstruction f r is: f r = (S2/S1) x f x = (540/270)x100 = 200Hz.
44
44 (b) If S = 70 Hz, the F D = 100/70. It lies outside the principal range. It is a case of alias. The alias freq. : f a = (100-70) = 30 Hz and (100-2X70)= -40 Hz. The second case is outside the principal period of 35 Hz, hence not considered. The reconstructed aliased frequency is 30x 540/70.
45
45 Simplification of anti-alias filters To avoid the aliasing while the sample frequency is low, requires a high order low pass filter. Examples are Butterworth and Tchebyshev filters type 1,2 and 3. Some of these Tchebyshev filters have pass band ripple and can be a source of error. Such filters use low drift operational amplifiers and precise R, C elements. These filters are bulky, costly and difficult to tune. Linear phase together with high magnitude attenuation characteristic is impossible to implement. Hence we use alternative technique….
46
46 Continued…alternatively… Use of a simple Low Pass analog filter, sample @ many times, say X4, the Nyquist rate. A high attenuation linear phase digital filter is used. Decimation process is now applied. Here three samples are skipped and one sample out of every 4 is taken. Compensation, if needed, is also digitally provided. At the output, fill in the three skips using interpolation and use a DAC followed by a simple low pass analog filter. Isn’t technically excellent and robust scheme ?
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.