EE445S Real-Time Digital Signal Processing Lab Spring 2016 Interpolation and Pulse Shaping Prof. Brian L. Evans Dept. of Electrical and Computer Engineering The University of Texas at Austin Lecture 7 http://www.ece.utexas.edu/~bevans/courses/realtime Outline • Discrete-to-continuous conversion • Interpolation • Pulse shapes Rectangular Triangular Sinc Raised cosine • Sampling and interpolation demonstration • Conclusion 7-2 Data Conversion Data Conversion • Analog-to-Digital Conversion Lowpass filter has stopband frequency less than ½ fs to reduce aliasing at sampler output (enforce sampling theorem) Lecture 4 Analog Lowpass Filter • Digital-to-Analog Conversion Discrete-to-continuous conversion could be as simple as sample and hold Lowpass filter has stopband frequency less than ½ fs to reduce artificial high frequencies Lecture 8 Quantizer Sampler at sampling rate of fs Lecture 7 Discrete to Continuous Conversion Analog Lowpass Filter fs 7-3 Discrete-to-Continuous Conversion • Input: sequence of samples y[n] • Output: smooth continuous-time function obtained through interpolation (by “connecting the dots”) If f0 < ½ fs , then y[n] y[n] A cos2 f 0 Ts n 3 4 5 6 7 n would be converted to 1 2 ~ y (t ) ~ y (t ) A cos2 f 0 t Otherwise, aliasing has occurred, and the converter would reconstruct a cosine wave whose frequency is equal to the aliased positive frequency that is less than ½ fs 7-4 Discrete-to-Continuous Conversion • General form of interpolation is sum of weighted pulses ~ y (t ) y[n] p(t T n s n) Sequence y[n] converted into continuous-time signal that is an approximation of y(t) Pulse function p(t) could be rectangular, triangular, parabolic, sinc, truncated sinc, raised cosine, etc. Pulses overlap in time domain when pulse duration is greater than or equal to sampling period Ts Pulses generally have unit amplitude and/or unit area Above formula is related to discrete-time convolution 7-5 Interpolation From Tables • Using mathematical tables of numeric values of functions to compute a value of the function • Estimate f(1.5) from table Zero-order hold: take value to be f(1) to make f(1.5) = 1.0 (“stairsteps”) Linear interpolation: average values of nearest two neighbors to get f(1.5) = 2.5 Curve fitting: fit four points in table to polynomal a0 + a1 x + a2 x2 + a3 x3 which gives f(1.5) = x2 = 2.25 x f(x) 0 1 2 3 0.0 1.0 4.0 9.0 ~ f ( x) 9 4 1 x 0 1 2 3 7-6 Rectangular Pulse • Zero-order hold Easy to implement in hardware or software t 1 if 1 Ts t 1 Ts p(t ) rect 2 2 T s 0 otherwise The Fourier transform is P( f ) Ts sinc f Ts Ts p(t) 1 -½ Ts ½ Ts t sin( f Ts ) sin x where sinc ( x) f Ts x In time domain, no overlap between p(t) and adjacent pulses p(t - Ts) and p(t + Ts) In frequency domain, sinc has infinite two-sided extent; hence, the spectrum is not bandlimited 7-7 Sinc Function sinc(x) 1 x 3 2 0 2 3 sin x sinc x x How to compute sinc(0)? As x 0, numerator and denominato r are both going to 0. How to handle it? Even function (symmetric at origin) Zero crossings at x , 2 , 3 , ... Amplitude decreases proportionally to 1/x 7-8 Triangular Pulse • Linear interpolation It is relatively easy to implement in hardware or software, p(t) although not as easy as zero-order hold |t | t 1 if Ts t Ts p(t ) Ts Ts otherwise 0 1 -Ts Ts t Overlap between p(t) and its adjacent pulses p(t - Ts) and p(t + Ts) but with no others • Fourier transform is P( f ) Ts sinc 2 f Ts How to compute this? Hint: Triangular pulse is equal to 1 / Ts times the convolution of rectangular pulse with itself In frequency domain, sinc2(f Ts) has infinite two-sided extent; hence, the spectrum is not bandlimited 7-9 Sinc Pulse • Ideal bandlimited interpolation sin T p (t ) sinc t s Ts t Ts t f 1 P( f ) rect Ts Ts W 1 2 Ts In time domain, infinite overlap between other pulses Fourier transform has extent f [-W, W], where P(f) is ideal lowpass frequency response with bandwidth W In frequency domain, sinc pulse is bandlimited • Interpolate with infinite extent pulse in time? Truncate sinc pulse by multiplying it by rectangular pulse Causes smearing in frequency domain (multiplication in time domain is convolution in frequency domain) 7 - 10 Raised Cosine Pulse: Time Domain • Pulse shaping used in communication systems t cos2 W t p(t ) sinc T 1 16 2 W 2 t 2 s ideal lowpass filter Attenuation by 1/t2 for impulse response large t to reduce tail W is bandwidth of an ideal lowpass response [0, 1] rolloff factor Zero crossings at t = Ts , 2 Ts , … Simon Haykin, Communication Systems, 3rd ed. • See handout G in reader on raised cosine pulse 7 - 11 Raised Cosine Pulse Spectra • Pulse shaping used in communication systems Bandwidth increased by factor of (1 + ): (1 + ) W = 2 W – f1 f1 marks transition from passband to stopband Simon Haykin, Communication Systems, 3rd ed. 1 1 if 0 | f | f1 2W | f | W 1 if f1 | f | 2W f1 P( f ) 1 sin 2 W 2 f1 4W 0 otherwise W 2 Ts 1 Bandwidth generally scarce in communication systems f1 W 7 - 12 Sampling and Interpolation Demo • DSP First, Ch. 4, Sampling and interpolation http://www.ece.gatech.edu/research/DSP/DSPFirstCD/ Sample sinusoid y(t) to form y[n] Reconstruct sinusoid using rectangular, triangular, or truncated sinc pulse p(t) ~ y (t ) y[n] p(t T n s n) • Which pulse gives the best reconstruction? • Sinc pulse is truncated to be four sampling periods long. Why is the sinc pulse truncated? • What happens as the sampling rate is increased? 7 - 13 Conclusion • Discrete-to-continuous time conversion involves interpolating between known discrete-time samples y[n] y[n] using pulse shape p(t) ~ y (t ) y[n] p(t T n s n) • Common pulse shapes 3 4 5 6 7 n 1 2 ~ y (t ) Rectangular for same-and-hold interpolation Triangular for linear interpolation Sinc for optimal bandlimited linear interpolation but impractical Truncated raised cosine for practical bandlimited interpolation • Truncation in time domain causes smearing in 7 - 14 frequency domain