ESE 531: Digital Signal Processing Lecture Outline Downsampling
Total Page:16
File Type:pdf, Size:1020Kb
Lecture Outline ESE 531: Digital Signal Processing ! Downsampling/Upsampling ! Practical Interpolation ! Non-integer Resampling Lec 10: February 14th, 2017 ! Multi-Rate Processing Practical and Non-integer Sampling, Multi- rate Sampling " Interchanging Operations ! Polyphase Decomposition ! Multi-Rate Filter Banks Penn ESE 531 Spring 2017 - Khanna Penn ESE 531 Spring 2017 - Khanna 2 Downsampling Downsampling ! Definition: Reducing the sampling rate by an integer number Penn ESE 531 Spring 2017 - Khanna 3 Penn ESE 531 Spring 2017 - Khanna 4 Example Example 2π 4π 2π 4π 6π Penn ESE 531 Spring 2017 - Khanna 5 Penn ESE 531 Spring 2017 - Khanna 6 1 Example Example Penn ESE 531 Spring 2017 - Khanna 7 Penn ESE 531 Spring 2017 - Khanna 8 Upsampling Upsampling ! Definition: Increasing the sampling rate by an integer number x[n] = xc (nT ) xi[n] = xc (nT ') xi[n] Penn ESE 531 Spring 2017 - Khanna 9 Penn ESE 531 Spring 2017 - Khanna 10 Frequency Domain Interpretation Frequency Domain Interpretation Penn ESE 531 Spring 2017 - Khanna 11 Penn ESE 531 Spring 2017 - Khanna 12 2 Example Example Penn ESE 531 Spring 2017 - Khanna 13 Penn ESE 531 Spring 2017 - Khanna 14 Example Example Penn ESE 531 Spring 2017 - Khanna 15 Penn ESE 531 Spring 2017 - Khanna 16 Example Example Penn ESE 531 Spring 2017 - Khanna 17 Penn ESE 531 Spring 2017 - Khanna 18 3 Practical Interpolation Practical Interpolation ! Interpolate with simple, practical filters ! Interpolate with simple, practical filters " Linear interpolation – samples between original samples " Linear interpolation – samples between original samples fall on a straight line connecting the samples fall on a straight line connecting the samples " Convolve with triangle instead of sinc " Convolve with triangle instead of sinc Penn ESE 531 Spring 2017 - Khanna 19 Penn ESE 531 Spring 2017 - Khanna 20 Frequency Domain Interpretation Linear Interpolation -- Frequency Domain xi[n] = xe[n]∗hlin[n] LPF approx Penn ESE 531 Spring 2017 - Khanna 21 Penn ESE 531 Spring 2017 - Khanna 22 Linear Interpolation -- Frequency Domain Linear Interpolation -- Frequency Domain xi[n] = xe[n]∗hlin[n] xi[n] = xe[n]∗hlin[n] LPF LPF approx approx Penn ESE 531 Spring 2017 - Khanna 23 Penn ESE 531 Spring 2017 - Khanna 24 4 Non-integer Sampling Non-integer Sampling ! T’=TM/L ! T’=TM/L " Upsample by L, then downsample by M " Upsample by L, then downsample by M interpolator decimator interpolator decimator Penn ESE 531 Spring 2017 - Khanna 25 Penn ESE 531 Spring 2017 - Khanna 26 Example Example ! T’=3/2T # L=2, M=3 ! T’=3/2T # L=2, M=3 Penn ESE 531 Spring 2017 - Khanna 27 Penn ESE 531 Spring 2017 - Khanna 28 Non-integer Sampling Multi-Rate Signal Processing ! T’=TM/L ! What if we want to resample by 1.01T? " Downsample by M, then upsample by L? " Expand by L=100 interpolator decimator " Filter π/101 ($$$$$) " Downsample by M=101 ! Fortunately there are ways around it! " Called multi-rate " Uses compressors, expanders and filtering Penn ESE 531 Spring 2017 - Khanna 29 Penn ESE 531 Spring 2017 - Khanna 30 5 Interchanging Operations Interchanging Operations - Expander Upsampling Downsampling Upsampling -expanding in time -compressing in time -expanding in time -compressing in frequency -expanding in frequency -compressing in frequency ? Penn ESE 531 Spring 2017 - Khanna 31 Penn ESE 531 Spring 2017 - Khanna 32 Interchanging Operations - Expander Interchanging Operations - Expander Upsampling Upsampling -expanding in time -expanding in time -compressing in frequency -compressing in frequency ? ≠ Penn ESE 531 Spring 2017 - Khanna 33 Penn ESE 531 Spring 2017 - Khanna 34 Interchanging Operations - Expander Interchanging Operations - Compressor Upsampling Downsampling -expanding in time -compressing in time -compressing in frequency -expanding in frequency = = Penn ESE 531 Spring 2017 - Khanna 35 Penn ESE 531 Spring 2017 - Khanna 36 6 Interchanging Operations - Compressor Interchanging Operations - Compressor = = = Penn ESE 531 Spring 2017 - Khanna 37 Penn ESE 531 Spring 2017 - Khanna 38 Interchanging Operations - Compressor Interchanging Operations - Compressor = = = = After compressing Penn ESE 531 Spring 2017 - Khanna 39 Penn ESE 531 Spring 2017 - Khanna 40 Interchanging Operations - Summary Multi-Rate Signal Processing ! What if we want to resample by 1.01T? " Expand by L=100 Filter and expander Expander and expanded filter* " Filter π/101 ($$$$$) " Downsample by M=101 ! Fortunately there are ways around it! " Called multi-rate " Uses compressors, expanders and filtering Compressor and filter Expanded filter* and compressor *Expanded filter = expanded impulse response, compressed freq response Penn ESE 531 Spring 2017 - Khanna 41 Penn ESE 531 Spring 2017 - Khanna 42 7 Polyphase Decomposition Polyphase Decomposition ! We can decompose an impulse response (of our ! We can decompose an impulse response (of our filter) to: filter) to: Penn ESE 531 Spring 2017 - Khanna 43 Penn ESE 531 Spring 2017 - Khanna 44 Polyphase Decomposition Polyphase Decomposition Penn ESE 531 Spring 2017 - Khanna 45 Penn ESE 531 Spring 2017 - Khanna 46 Polyphase Decomposition Polyphase Decomposition Penn ESE 531 Spring 2017 - Khanna 47 Penn ESE 531 Spring 2017 - Khanna 48 8 Polyphase Decomposition Polyphase Implementation of Decimation ! Problem: " Compute all y[n] and then throw away -- wasted computation! " For FIR length N # N mults/unit time Penn ESE 531 Spring 2017 - Khanna 49 Penn ESE 531 Spring 2017 - Khanna 50 Polyphase Implementation of Decimation Polyphase Implementation of Decimation Penn ESE 531 Spring 2017 - Khanna 51 Penn ESE 531 Spring 2017 - Khanna 52 Interchanging Operations - Summary Polyphase Implementation of Decimation Filter and expander Expander and expanded filter Compressor and filter Expanded filter and compressor Penn ESE 531 Spring 2017 - Khanna 53 Penn ESE 531 Spring 2017 - Khanna 54 9 Polyphase Implementation of Decimation Multi-Rate Signal Processing ! What if we want to resample by 1.01T? " Expand by L=100 " Filter π/101 ($$$$$) Each filter computation: -N/M multiplications " Downsample by M=101 -1/M rate per sample #N/M*(1/M) mults/unit time ! Fortunately there are ways around it! " Called multi-rate " Uses compressors, expanders and filtering Total computation: -M filters #N/M mults/unit time Penn ESE 531 Spring 2017 - Khanna 55 Penn ESE 531 Spring 2017 - Khanna 56 Polyphase Implementation of Decimator Polyphase Implementation of Interpolation interpolator decimator interpolator decimator E0(z) E0(z) E0(z) Penn ESE 531 Spring 2017 - Khanna 57 Penn ESE 531 Spring 2017 - Khanna 58 Multi-Rate Filter Banks Multi-Rate Filter Banks ! Use filter banks to operate on a signal differently in ! Use filter banks to operate on a signal differently in different frequency bands different frequency bands " To save computation, reduce the rate after filtering " To save computation, reduce the rate after filtering ! h0[n] is low-pass, h1[n] is high-pass jπn " Often h1[n]=e h0[n] $ shift freq resp by π Penn ESE 531 Spring 2017 - Khanna 59 Penn ESE 531 Spring 2017 - Khanna 60 10 Multi-Rate Filter Banks Multi-Rate Filter Banks ! Assume h0, h1 are ideal low/high pass ! Assume h0, h1 are ideal low/high pass Penn ESE 531 Spring 2017 - Khanna 61 Penn ESE 531 Spring 2017 - Khanna 62 Multi-Rate Filter Banks Multi-Rate Filter Banks ! Assume h0, h1 are ideal low/high pass ! Assume h0, h1 are ideal low/high pass Have to be careful with order! Penn ESE 531 Spring 2017 - Khanna 63 Penn ESE 531 Spring 2017 - Khanna 64 Multi-Rate Filter Banks Multi-Rate Filter Banks ! Assume h0, h1 are ideal low/high pass ! Assume h0, h1 are ideal low/high pass Penn ESE 531 Spring 2017 - Khanna 65 Penn ESE 531 Spring 2017 - Khanna 66 11 Multi-Rate Filter Banks Non Ideal Filters ! h0, h1 are NOT ideal low/high pass ! h0, h1 are NOT ideal low/high pass Penn ESE 531 Spring 2017 - Khanna 67 Penn ESE 531 Spring 2017 - Khanna 68 Non Ideal Filters Perfect Reconstruction non-Ideal Filters Penn ESE 531 Spring 2017 - Khanna 69 Penn ESE 531 Spring 2017 - Khanna 70 Quadrature Mirror Filters Big Ideas ! Downsampling/Upsampling ! Practical Interpolation ! Non-integer Resampling ! Multi-Rate Processing Quadrature mirror filters " Interchanging Operations ! Polyphase Decomposition ! Multi-Rate Filter Banks Penn ESE 531 Spring 2017 - Khanna 71 Penn ESE 531 Spring 2017 - Khanna 72 12 Admin ! HW 4 due Friday " Typo in code in MATLAB problem, corrected handout " See Piazza for more information Penn ESE 531 Spring 2017 - Khanna 73 13 .