Lecture Digital signal processing - Lecture 4 present sampling and reconstruction. The main contents of this chapter include all of the following: Periodic sampling, frequency domain representation, reconstruction, changing the sampling rate using discretetime processing.
Digital Signal Processing, Fall 2006 Lecture 4: Sampling and reconstruction Zheng-Hua Tan Department of Electronic Systems Aalborg University, Denmark zt@kom.aau.dk Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Course at a glance MM1 Discrete-time signals and systems MM2 Fourier-domain representation Sampling and reconstruction System System structures System analysis MM6 MM5 Filter MM4 z-transform MM3 DFT/FFT Filter structures MM9,MM10 MM7 Filter design MM8 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Part I: Periodic sampling Periodic sampling Frequency domain representation Reconstruction Changing the sampling rate using discretetime processing Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Periodic sampling From continuous-time xc (t ) to discrete-time x[n] x[n] = xc (nT ), −∞ < n < ∞ T Sampling period Sampling frequency f s = / T Ω s = 2π / T Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Two stages In practice? Mathematically Impulse train modulator Conversion of the impulse train to a sequence ∞ ∑ δ (t − nT ) s(t ) = n = −∞ x s (t ) = xc (t ) s (t ) ∞ = xc (t ) ∑ δ (t − nT ) n = −∞ ∞ = ∑ xc (nT )δ (t − nT ) n = −∞ x[n] = xc (nT ), −∞ < n < ∞ ∞ xc (t ) = ∫− ∞ xc (τ )δ (t −τ )dτ Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Periodic sampling Tow-stage representation Strictly a mathematical representation that is convenient for gaining insight into sampling in both the time and frequency domains Physical implementation is different x s (t ) a continuous-time signal, an impulse train, zero except at nT x[n] a discrete-time sequence, time normalization, no explicit information about sampling rate Many-to-many Ỉ in general not invertible Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Part II: Frequency domain represent Periodic sampling Frequency domain representation Reconstruction Changing the sampling rate using discretetime processing Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Frequency-domain representation From xc(t) to xs(t) s(t ) = ∞ ∑ δ (t − nT ) n = −∞ x s (t ) = xc (t ) s (t ) ∞ = xc (t ) ∑ δ (t − nT ) n = −∞ = The Fourier transform of a periodic impulse train is a periodic impulse train 2π ∞ ↔ S ( jΩ) = ∑ δ (Ω − kΩ s ) T k = −∞ ? ↔ X s ( jΩ ) = X c ( jΩ) * S ( jΩ) 2π ∞ = ∑ X c ( j (Ω − kΩ s )) T k = −∞ ∞ ∑ xc (nT )δ (t − nT ) n = −∞ The Fourier transform of xs(t) consists of periodic repetition of the Fourier transform of xc(t) Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Frequency-domain S ( jΩ ) = X s ( jΩ ) = 2π T T ∞ ∑ δ (Ω − kΩ s ) k = −∞ ∞ ∑ X c ( j (Ω − kΩ s )) k = −∞ Ω s − Ω N > Ω N or Ω s > 2Ω N Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Recovery X r ( jΩ ) = H r ( jΩ ) X s ( jΩ ) Ideal lowpass filter with gain T and cutoff frequency Ω c Ω N < Ω c < (Ω s − Ω N ) X r ( jΩ ) = X c ( jΩ ) 10 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Aliasing distortion 11 Due to the overlap among the copies of X c ( jΩ) , due to Ω s ≤ 2Ω N X c ( jΩ) not recoverable by lowpass filtering Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Aliasing – an example xc (t ) = cos Ω t a.1 X s ( jΩ ) = T ∞ ∑ X c ( j (Ω − kΩ s )) k = −∞ b.1 xr (t ) = cos Ω t a.2 xr (t ) = cos(Ω s − Ω )t b.2 12 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Nyquist sampling theorem Given bandlimited signal X c ( jΩ) = 0, Then for | Ω |≥ Ω N is uniquely determined by its samples xc (t ) x[n] = xc (nT ), If with xc (t ) −∞ < n < ∞ 2π ≥ 2Ω N T Ωs = ΩN is called Nyquist frequency 2Ω N is called Nyquist rate 13 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Fourier transform of x[n] From xs (t ) to x[n] x s (t ) = ∞ ∑ xc (nT )δ (t − nT ) n = −∞ x[n] = xc (nT ), −∞ < n < ∞ From X s ( jΩ) to X (e jω ) By taking continuous-time Fourier transform of xs(t) X s ( jΩ ) = ∞ ∑ xc (nT )e − jΩTn ( n = −∞ ∞ X ( jΩ) = ∫− ∞ x(t )e − jΩt dt ) By taking discrete-time Fourier transform of x[n] X ( e jω ) = ∞ ∑ x(n)e − jωn n = −∞ 14 X s ( jΩ) = X (e jω ) |ω = ΩT = X (e jΩT ) Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Fourier transform of x[n] X s ( jΩ) = X (e jω ) |ω = ΩT = X (e jΩT ) X s ( jΩ ) = T X ( e jω ) = ∞ ∑ X c ( j (Ω − kΩ s )) k = −∞ T ∞ ∑ k = −∞ X c ( j( ω T − 2πk )) = T T ∞ ∑ k = −∞ Xc( j ω − 2πk T ) X ( e jω ) is simply a frequency-scaled version of X with ω = ΩT x s (t ) retains a spacing between samples equal to the sampling period T while x[n] always has unity space 15 s ( jΩ ) Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Sampling and reconstruction of Sin Signal xc (t ) = cos(4000πt ) → Ω = 4000π T = / 6000 → Ω s = 2π / T = 12000π ∴ no aliasing x[n] = xc (nT ) = cos(4000πnT ) = cos((2π / 3)n) = cos(ω0 n) xc (t ) ↔ X c ( jΩ) = πδ (Ω − 4000π ) + πδ (Ω + 4000π ) X s ( jΩ) = T ∞ ∑ X c ( j (Ω − kΩ s )) k = −∞ X (e jω ) = X s ( jΩ) |Ω =ω / T = X s ( jω / T ) with normalized frequency ω = ΩT How about xc (t ) = cos(16000πt ) 16 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Part III: Reconstruction Periodic sampling Frequency domain representation Reconstruction Changing the sampling rate using discretetime processing 17 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Requirement for reconstruction On the basis of the sampling theorem, samples represent the signal exactly when: 18 Bandlimited signal Enough sampling frequency + knowledge of the sampling period Ỉ recover the signal Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Reconstruction steps (1) Given x[n] and T, the impulse train is x s (t ) = (2) ∞ ∞ n = −∞ n = −∞ ∑ xc (nT )δ (t − nT ) = ∑ x[n]δ (t − nT ) i.e the nth sample is associated with the impulse at t=nT The impulse train is filtered by an ideal lowpass CT filter with impulse response hr (t ) ↔ H r ( jΩ) xr (t ) = ∞ ∑ x(n)hr (t − nT ) n = −∞ X r ( j Ω ) = H r ( jΩ ) X ( e j Ω T ) 19 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Ideal lowpass filter Commonly choose cutoff frequncy as Ωc = Ω s / = π / T hr (t ) = 20 sin(πt / T ) πt / T Digital Signal Processing, IV, Zheng-Hua Tan, 2006 10 Ideal lowpass filter interpolation CT signal Modulated impulse train xr (t ) = 21 ∞ ∑ n = −∞ x[n] sin(π (t − nT ) / T ) π (t − nT ) / T Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Ideal discrete-to-continuous-time converter 22 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 11 discrete-to-continuous-time converter “Practical DACs not output a sequence of dirac impulses (that, if ideally low-pass filtered, result in the original signal before sampling) but instead output a sequence of piecewise constant values or rectangular pulses” Ideally sampled signal Piecewise constant signal typical of a practical DAC output From http://en.wikipedia.org/wiki/Digital-to-analog_converter 23 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Applications 24 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 12 Part IV: Changing the sampling rate 25 Periodic sampling Frequency domain representation Reconstruction Changing the sampling rate using discretetime processing Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Downsampling x[n] = xc (nT ) x'[n] = xc (nT ' ) By reconstruction & re-sampling though not desirable Using DT processing only: Sampling rate reduction by an integer factor – downsampling by “sampling” it xd [n] = x[nM ] = xc (nMT ) 26 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 13 Frequency domain xd [n] = x[nM ] = xc (nMT ) DT Fourier transform 2πk )) T T k = −∞ ∞ ω 2πr X d (e jω ) = ∑ X c ( j ( T ' − T ' )) T ' r = −∞ ∞ 2πr ω = ∑ X c ( j ( MT − MT )) MT r = −∞ X ( e jω ) = T ∞ ∑ X c ( j( ω − r = i + kM , − ∞ < k < ∞, ≤ i ≤ M − 1, − ∞ < r < ∞ X d ( e jω ) = 27 M M −1 ∞ ∑[T ∑ X i =0 k = −∞ j ( ω − 2π i ) / M Since X (e → X d ( e jω ) = M )= c ( j( ω MT − 2π k 2π i − ))] T MT ∞ ω 2π i 2π k ∑ X c ( j ( MT − MT − T )) T k = −∞ M −1 ∑ X (e j ( ω − 2π i ) / M ) i =0 Similar to the Eq above! Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Frequency domain - an example This example Sampling results in copies at nΩ s = 2nπ / T Same, downsampling generates M copies of (e jω ) with frequency X scaled by M and shifted Aliasing can be avoided if X (e jω ) is bandlimited Ω s = 4Ω N X (e jω ) = 0, ω N ≤| ω |≤ 2π and 2π / M ≥ 2ω N 28 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 14 Frequency domain - an example Downsampling factor is too large, causing aliasing, resulting in the need for DT ideal lowpass filter with cutoff frequency pi/M To avoid aliasing in downsampling by a factor of M requires that ωN M < π 29 ωN = Ω NT ' Digital Signal Processing, IV, Zheng-Hua Tan, 2006 A general downsampling system 30 The system is also called decimator The process is called decimation Digital Signal Processing, IV, Zheng-Hua Tan, 2006 15 Increasing sampling rate – upsampling Downsampling Ỉ analogous to sampling a CT signal Upsampling Ỉ analogous to D/C conversion x[n] = xc (nT ) xi [n] = xc (nT ' ), T '= T L x i [ n ] = x[ n / L ] = x c ( nT / L ), n = , ± L , ± L , Expander ⎧ x[n / L], n = 0, ± L, ± L, xe [ n] = ⎨ otherwise ⎩ 0, xe [ n] = 31 ∞ ∑ x[k ]δ [n − kL] k = −∞ Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Fourier domain Fourier transform of the output of expander xe [ n] = ∞ ∑ x[k ]δ [n − kL] k = −∞ X e ( e jω ) = = ∞ ∞ ∑ ( ∑ x[k ]δ [n − kL])e − jωn n = −∞ k = −∞ ∞ ∑ x[k ]e − jωLk = X (e jωL ) k = −∞ Which is s frequency scaled version, w is replaced by wL so ω = ΩT ' 32 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 16 An example DTFT of x[n] = xc (nT ) X e (e jω ) = X (e jωL ) System: interpolator Process: interpolation 33 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Summary 34 Periodic sampling Frequency domain representation Reconstruction Changing the sampling rate using discretetime processing Digital Signal Processing, IV, Zheng-Hua Tan, 2006 17 Course at a glance MM1 Discrete-time signals and systems MM2 Fourier-domain representation Sampling and reconstruction System System structures System analysis MM6 MM5 Filter MM4 z-transform MM3 35 DFT/FFT Filter structures MM9,MM10 MM7 Filter design MM8 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 18 ... http://en.wikipedia.org/wiki /Digital- to-analog_converter 23 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 Applications 24 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 12 Part IV: Changing... Signal Processing, IV, Zheng-Hua Tan, 2006 Ideal discrete-to-continuous-time converter 22 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 11 discrete-to-continuous-time converter “Practical... if X (e jω ) is bandlimited Ω s = 4 N X (e jω ) = 0, ω N ≤| ω |≤ 2π and 2π / M ≥ 2ω N 28 Digital Signal Processing, IV, Zheng-Hua Tan, 2006 14 Frequency domain - an example Downsampling factor