EE 445 S RealTime Digital Signal Processing Lab
EE 445 S Real-Time Digital Signal Processing Lab Spring 2021 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 • Data conversion • Interpolation • Pulse shapes 3 1 5 6 7 n 2 sinc(x) • Sampling and interpolation demo • Increasing sampling rates 4 1 x -3 -2 -1 0 1 2 3 • Conclusion 7 -2
Data Conversion Sampling and Reconstruction How to reconstruct x(t)? Continuous-Time Analysis Sampling x(t) fs 7 -3
Data Conversion • Analog-to-Digital Conversion Lowpass filter has stopband frequency less than ½ fs to reduce aliasing at sampler output (enforce sampling theorem) Analog Lowpass Filter • Digital-to-Analog Conversion Discrete-to-continuous (time) conversion could be as simple as sample and hold Lowpass filter has stopband frequency less than ½ fs to reduce artificial high frequencies Lecture 4 Lecture 8 Quantizer Sampler at sampling rate of fs Lecture 7 Discrete to Continuous Conversion Analog Lowpass Filter fs 7 -4
Interpolation Discrete-to-Continuous Conversion • Input: sequence of samples y[n] • Output: smooth continuous-time function obtained through interpolation (by “connecting the dots”) If f 0 < ½ fs , then 3 would be converted to 1 4 5 6 7 n 2 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 -5
Interpolation Discrete-to-Continuous Conversion • General form of interpolation is sum of weighted pulses Sequence y[n] converted into continuous-time signal Approximation of y(t) over frequencies from -½ fs to ½ fs • Pulse function p(t) Rectangular, triangular, sinc, truncated sinc, raised cosine, etc. Pulses overlap in time when longer than sampling period Ts Pulses generally have unit amplitude and/or unit area • “Mixed-signal” convolution Discrete-time signal y[n] and continuous-time signal p(t) Discrete time aligned with continuous time via Ts n 7 -6
Interpolation Discrete-to-Continuous Conversion • Sample-and-hold reconstruction Uses lowpass averaging filter p(t) Has efficient implementation y[n] p(t) 1 ~ y(t) … 0 Ts t … 4 -1 0 -Ts 0 1 2 3 Ts 2 Ts 3 Ts … 5 6 … n t
Interpolation From Tables • Using mathematical tables to estimate a function value • Estimate f(1. 5) from table Zero-order hold: take value to be f(1) to make f(1. 5) = 1. 0 (“stairsteps”) No multiplications or additions Linear interpolation: average values of nearest two neighbors to get f(1. 5) = 2. 5 2 multiplications and 3 additions per value Curve fitting: fit four points to cubic polynomial to give f(1. 5) = x 2 = 2. 25 43 multiplications to find polynomial coefficients + 1 multiplication per value x 0 1 2 f(x) 0. 0 1. 0 4. 0 3 9. 0 9 4 1 x 0 1 2 3 7 -8
Interpolation Curve Fitting • Interpolate over 1 < x < 2 using cubic polynomial f(x) = a 0 + a 1 x + a 2 x 2 + a 3 x 3 f(0) = 0 = a 0 f(1) = 1 = a 0 + a 1 + a 2 + a 3 f(2) = 4 = a 0 + 2 a 1 + 4 a 2 + 8 a 3 f(3) = 9 = a 0 + 3 a 1 + 9 a 2 + 27 a 3 • Matlab code to solve for A = [ 1 0 1 1 1 2 1 3 b = [ 0; 1; a = A b; 0 0; 1 1; 4 8; 9 27 ]; 4; 9 ]; A (2/3)n 3 operations to solve system of n equations a 2 = 1 and a 0 = a 1 = a 3 = 0 to give f(x) = x 2
Pulse Shapes • Zero-order hold p 1(t) |P 1(f)| Ts where 1 f -½Ts t -3 fs -2 fs -fs • Linear interpolation p 2(t) 1 |P 2(f)| 0 fs 2 fs 3 fs Ts because f -Ts Ts t -3 fs -2 fs -fs • Sinc (ideal) interpolation p 3(t) 0 fs 2 fs 3 fs P 3(f) where Ts 1 f -3 Ts -2 Ts -Ts 0 Ts 2 Ts 3 Ts t -½fs
Pulse Shapes Raised Cosine Pulse: Time Domain • Pulse shaping used in communication systems ideal lowpass filter Attenuation by 1/t 2 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, 3 rd ed. • See handout G in reader on raised cosine pulse 7 - 11
Pulse Shapes Raised Cosine Pulse Spectra • Pulse shaping used in communication systems Bandwidth increased by factor of (1 + ): (1 + ) W = 2 W – f 1 marks transition from passband to stopband Simon Haykin, Communication Systems, 3 rd ed. Bandwidth generally scarce in communication systems 7 - 12
Sampling and Interpolation Demo • DSP First, 2 nd ed. , ch. 4, Sampling/interpolation http: //dspfirst. gatech. edu/chapters/04 samplin/demos/recon/index. html/ Sample sinusoid y(t) to form y[n] Reconstruct sinusoid using rectangular, triangular, or truncated sinc pulse p(t) • Which pulse gives the best reconstruction? • Sinc pulse truncated to 4 sampling periods. Why? • What happens as the sampling rate is increased? • Tradeoff in signal quality vs. complexity? 7 - 13
Increasing Sampling Rates • Consider adding speech clip to an audio track Speech signal s[n] is sampled at 8 k. Hz Audio signal r[m] is sampled at 48 k. Hz • Inefficient approach: Interpolate in continuous time s[n] Digital to Analog Converter Analog to Digital Converter + r[m] 8000 Hz 48000 Hz • Efficient approach: Interpolate in discrete time s[n] 6 Upsampling FIR Filter + Interpolation r[m] 7 - 14
Increasing Sampling Rates • Upsampling by L Copies input sample to output and appends L-1 zeros Output has L times as many samples as input samples • Audio Demonstration x[n] 6 v[m] FIR Filter y[m] Plots/plays x[n] which is a Upsampling Interpolation 600 Hz cosine sampled at 8000 Hz Plots/plays v[m]: spectrum is spectrum of x[n] plus L-1 replicas Interpolation filter fills in inserted zero values in time domain and attenuates replicas in frequency domain due to upsampling Rectangular, triangular and truncated sinc FIR filters used 7 - 15
Conclusion • Discrete-to-continuous time conversion involves interpolating between known discrete-time samples y[n] using pulse shape p(t) 3 • Common pulse shapes 1 4 5 6 7 n 2 Rectangular for same-and-hold interpolation Triangular for linear interpolation Sinc for optimal bandlimited linear interpolation but impractical Truncated sinc or raised cosine for practical interpolation • Truncation in time causes smearing in frequency 7 - 16
- Slides: 16