DFT-Based FIR Filtering. See Porat s Book: 4.7, 5.6

Similar documents
EEO 401 Digital Signal Processing Prof. Mark Fowler

! Circular Convolution. " Linear convolution with circular convolution. ! Discrete Fourier Transform. " Linear convolution through circular

Module 3. Convolution. Aim

ENT 315 Medical Signal Processing CHAPTER 2 DISCRETE FOURIER TRANSFORM. Dr. Lim Chee Chin

ESE 531: Digital Signal Processing

! Review: Discrete Fourier Transform (DFT) ! DFT Properties. " Duality. " Circular Shift. ! Circular Convolution. ! Fast Convolution Methods

LTI H. the system H when xn [ ] is the input.

LAB 2: DTFT, DFT, and DFT Spectral Analysis Summer 2011

Digital Signal Processing Lecture 4

Contents. Digital Signal Processing, Part II: Power Spectrum Estimation

Lecture 11 FIR Filters

Chirp Transform for FFT

Digital Signal Processing. Midterm 2 Solutions

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Positioning Sytems: Trilateration and Correlation

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Positioning Sytems: Trilateration and Correlation

MAHALAKSHMI ENGINEERING COLLEGE-TRICHY

EE-210. Signals and Systems Homework 7 Solutions

Ch.11 The Discrete-Time Fourier Transform (DTFT)

VII. Discrete Fourier Transform (DFT) Chapter-8. A. Modulo Arithmetic. (n) N is n modulo N, n is an integer variable.

CS 179: GPU Programming. Lecture 9 / Homework 3

E : Lecture 1 Introduction

Convolution. Define a mathematical operation on discrete-time signals called convolution, represented by *. Given two discrete-time signals x 1, x 2,

Lecture 20: Discrete Fourier Transform and FFT

Digital Signal Processing I Final Exam Fall 2008 ECE Dec Cover Sheet

Introduction to DFT. Deployment of Telecommunication Infrastructures. Azadeh Faridi DTIC UPF, Spring 2009

UNIVERSITY OF OSLO. Please make sure that your copy of the problem set is complete before you attempt to answer anything.

CS 179: GPU Programming. Lecture 9 / Homework 3

Linear Convolution Using FFT

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EC2314- DIGITAL SIGNAL PROCESSING UNIT I INTRODUCTION PART A

HST.582J / 6.555J / J Biomedical Signal and Image Processing Spring 2007

Lecture 19 IIR Filters

1 1.27z z 2. 1 z H 2

LAB 6: FIR Filter Design Summer 2011

8 The Discrete Fourier Transform (DFT)

Discrete Fourier transform (DFT)

Digital Signal Processing Chapter 10. Fourier Analysis of Discrete- Time Signals and Systems CHI. CES Engineering. Prof. Yasser Mostafa Kadah

INTRODUCTION TO THE DFS AND THE DFT

Chapter 8 The Discrete Fourier Transform

Lecture 10. Digital Signal Processing. Chapter 7. Discrete Fourier transform DFT. Mikael Swartling Nedelko Grbic Bengt Mandersson. rev.

EE482: Digital Signal Processing Applications

Discrete Fourier Transform

VU Signal and Image Processing. Torsten Möller + Hrvoje Bogunović + Raphael Sahann

ECS455: Chapter 5 OFDM. ECS455: Chapter 5 OFDM. OFDM: Overview. OFDM Applications. Dr.Prapun Suksompong prapun.com/ecs455

Fall 2011, EE123 Digital Signal Processing

ELEG 305: Digital Signal Processing

N-Point. DFTs of Two Length-N Real Sequences

In this Lecture. Frequency domain analysis

ECS455: Chapter 5 OFDM

Analog vs. discrete signals

Roll No. :... Invigilator s Signature :.. CS/B.Tech (EE-N)/SEM-6/EC-611/ DIGITAL SIGNAL PROCESSING. Time Allotted : 3 Hours Full Marks : 70

1. Calculation of the DFT

IT DIGITAL SIGNAL PROCESSING (2013 regulation) UNIT-1 SIGNALS AND SYSTEMS PART-A

Topic 7. Convolution, Filters, Correlation, Representation. Bryan Pardo, 2008, Northwestern University EECS 352: Machine Perception of Music and Audio

EEL3135: Homework #4

ECSE 512 Digital Signal Processing I Fall 2010 FINAL EXAMINATION

Definition. A signal is a sequence of numbers. sequence is also referred to as being in l 1 (Z), or just in l 1. A sequence {x(n)} satisfying

APPLIED SIGNAL PROCESSING

VU Signal and Image Processing

EE123 Digital Signal Processing

Discrete-time signals and systems

Designing Information Devices and Systems II Fall 2018 Elad Alon and Miki Lustig Homework 12

Test 2 Electrical Engineering Bachelor Module 8 Signal Processing and Communications

DSP Algorithm Original PowerPoint slides prepared by S. K. Mitra

Digital Signal Processing Lab 3: Discrete Fourier Transform

Lecture 14: Windowing

Fourier Transform 4: z-transform (part 2) & Introduction to 2D Fourier Analysis

Digital Signal Processing

ECE538 Final Exam Fall 2017 Digital Signal Processing I 14 December Cover Sheet

! Spectral Analysis with DFT. ! Windowing. ! Effect of zero-padding. ! Time-dependent Fourier transform. " Aka short-time Fourier transform

/ (2π) X(e jω ) dω. 4. An 8 point sequence is given by x(n) = {2,2,2,2,1,1,1,1}. Compute 8 point DFT of x(n) by

ELEG 305: Digital Signal Processing

Chap 2. Discrete-Time Signals and Systems

Discrete-Time Systems

EE123 Digital Signal Processing. M. Lustig, EECS UC Berkeley

How to manipulate Frequencies in Discrete-time Domain? Two Main Approaches

Convolution and Linear Systems

EE123 Digital Signal Processing

ECE 308 Discrete-Time Signals and Systems

DISCRETE FOURIER TRANSFORM

OLA and FBS Duality Review

Chapter 1 Review of Equations and Inequalities

Exercises in Digital Signal Processing

NAME: 11 December 2013 Digital Signal Processing I Final Exam Fall Cover Sheet

R13 SET - 1

Final Exam ECE301 Signals and Systems Friday, May 3, Cover Sheet

Transforms and Orthogonal Bases

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF INFORMATION TECHNOLOGY. Academic Year

Aspects of Continuous- and Discrete-Time Signals and Systems

z-transforms Definition of the z-transform Chapter

George Mason University ECE 201: Introduction to Signal Analysis Spring 2017

EE538 Final Exam Fall 2007 Mon, Dec 10, 8-10 am RHPH 127 Dec. 10, Cover Sheet

DFT & Fast Fourier Transform PART-A. 7. Calculate the number of multiplications needed in the calculation of DFT and FFT with 64 point sequence.

Lecture 3 January 23

Z-Transform. The Z-transform is the Discrete-Time counterpart of the Laplace Transform. Laplace : G(s) = g(t)e st dt. Z : G(z) =

DEPARTMENT OF EI DIGITAL SIGNAL PROCESSING ASSIGNMENT 1

Some Review Problems for Exam 2: Solutions

# FIR. [ ] = b k. # [ ]x[ n " k] [ ] = h k. x[ n] = Ae j" e j# ˆ n Complex exponential input. [ ]Ae j" e j ˆ. ˆ )Ae j# e j ˆ. y n. y n.

Computer Engineering 4TL4: Digital Signal Processing

Filter Banks II. Prof. Dr.-Ing. G. Schuller. Fraunhofer IDMT & Ilmenau University of Technology Ilmenau, Germany

EECE 301 Signals & Systems Prof. Mark Fowler

Transcription:

DFT-Based FIR Filtering See Porat s Book: 4.7, 5.6 1

Motivation: DTFT View of Filtering There are two views of filtering: * Time Domain * Frequency Domain x[ X f ( θ ) h[ H f ( θ ) Y y[ = h[ * x[ f ( θ ) = H f ( θ ) X f ( θ ) The FD viewpoint is indispensable for analysis and design of filters: * Passband, Stopband, etc. of H f (θ) * Linearity of Phase H f (θ), etc. Q: What about using DTFT for implementation? * Compute DTFT of input signal and filter * Multiply the two and take inverse DTFT A: NO!!! Can t compute DTFT must compute at infinite many frequency values 2

Desired Intention: But Does It Work? But wait. If input signal is finite length, the DFT computes samples of the DTFT Likewise, if filter impulse response is finite length Q: So can we use this? x(0) x(1) : x(n-1) N-pt DFT X f [k] H f [k]x f [k] N-pt IDFT Do we get. y(n) = h[*x[?? N-pt DFT h(0) h(1) h(n-1) 3

DFT Theory and Cyclic Convolution A: Not Necessarily!!!! DFT Theory (Theorem. 4.3 in Porat) tells us: IDFT{ H f [ k] X f [ k]} = h[ * x[ Circular (Cyclic) Convolution Thus this block diagram gives something called cyclic convolution, not the ordinary convolution we want!!! Q: When does it work??? A: Only when we trick the DFT Theory into making circular = linear convolution!!!!!! Q: So when does Cyclic = Linear Convolution??? Easiest to see from an example!!!!! 4

Linear Convolution for the Example What does linear convolution give for 2 finite duration signals: Original Signals: x[ Length N 1 = 9 n h[ Length N 2 = 5 n First Non-Zero Output is at n=0: x[ h[- (flip, no shift since n=0, multiply and add up) n n 5

Linear Convolution for the Example (cont.) Last Non-Zero Output is at n = N 1 + N 2 2 = 12: x[ (flip, shift by N 1 + N 2 2 = 12, multiply and add up) h[12 - n n The non-zero outputs are for n = 0, 1,, 12! 13 of them In General: Length of Output of Linear Convolution = N 1 + N 2 1 6

Cyclic Convolution for the Example Now What does cyclic convolution give for these 2 signals: Original Signals: 1. Zero-Pad Shorter Signal to Length of Longer One 2. Then Periodize Each First Output Sample: 1. Flip periodized version around this point 2. No shift needed to get n = 0 Output Value 3. Sum over one cycle Same as in Linear Conv!!!! Not Present in Linear Conv!!!! 7

Linear Convolution for the Example (cont.) Last Output Sample (i.e., n = 8): 1. Flip periodized version around this point 2. Shift by 8 to get n = 8 Output Value 3. Sum over one cycle Same as in Linear Conv!!!! Note: If I try to compute the output for n = 9! Exactly the same case as for n = 0!! Thus, the output is cyclic (i.e., periodic) with unique values for n = 0, 1,. 8 In General: Length of Output of Cyclic Convolution = max{n 1, N 2 } 8

Making Cyclic = Linear Convolution So. Some of the output values of cyclic conv are different from linear conv!!! Some of the output values of cyclic conv are same as linear conv And. The length of cyclic conv differs from the length of linear conv!!! From the example above we can verify: If we choose K N 1 + N 2 1 And Zero-Pad Each Signal to Length L Then Cyclic = Linear Convolution N 1 = Length of x[ N 2 = Length of h[ Exercise: Verify this for the above example!!!! 9

Simple Frequency-Domain Implementation of FIR Filtering x(0) x(1) : x(n 1-1) 0 : 0 K-pt FFT Zero-Pad Both Both to to Length LengthK N 1 +N 1 +N 2 1 2 1 X(0)H(0) X(1)H(1) : X(K-1)H(K-1) K-pt FFT K-pt IFFT h(0) h(1) h(n 2-1) 0 0 If K is Strictly > N 1 +N 2 1 Then there will be extra zeros here that can be ignored y(0) y(1) : : y(k-1) The The DFT DFT of of h(n) h(n) is is usually usually Pre-Computed Why Why Do Do This This The The FFT s FFT s Efficiency Makes Makes This This Faster Faster Than Than Time-Domain Implementation (In (In Many Many Cases) Cases) 10

Problems with the Simple FD Implementation Q: What if N 1 >> N 2? A: Then, need Really Big FFT! Not Good!!! (Input signal much longer than filter length) Also can t get any output samples until after whole signal is available and FFT processing is done. Long Delay. Example: Filter 0.2 sec of a radar signal sampled at Fs = 50 MHz N 1 = (0.2 sec) (50 10 6 samples/sec) = 10 7 samples FFT Size > 10 7! Really Big FFT!!!! Q: What if N 1 is unknown in advance? Example: Filtering a stream of audio A: FFT size can t be set ahead of time difficult programming Simple FD Implementation Has Serious Limitations!!! 11

Better FD-Based FIR Filter Implementations Two Very Similar Methods Exist Overlap Add (OLA) Overlap Save (OLS) Covered Here Both methods exploit linearity of filter: Break input signal into a sum of blocks! Output = sum of response to each block " z[ = = = ( x * h)[ ( xi * h)[ 14243 i i z i = z i [ [ x [ = x i [ i Use the Simple FD-Based Method to Compute Each Output Block The difference between OLA & OSA lies in how the x i [ blocks are formed 12

OLA Method for FD-Based FIR For OLA: Choose x i [ to be non-overlapped blocks of length N B (blocks are contiguous) x i x[, in B n < ( i + 1) N [ = 0, otherwise B N B is a Design Choice <See Fig. 5.8 (a) in Porat> Q: Now what happens when each of these length-n B blocks gets convolved with the length-n 2 filter? A: The output block has length N 2 + N B 1> N B * Output Blocks are Bigger than Input Blocks * But are separated by N B points * Thus Output Blocks Overlap * Total Output = Sum of Overlapped Blocks Overlap-Add <See Fig. 5.8 (b) (d) in Porat> 13

OLA Method Steps Assume: Filter h[ length N 2 is specified Choose: Block Size N B & FFT Size N FFT = 2 p N B + N 2 1 Choose N B such that: N B + N 2 1 = 2 p It gives minimal complexity for method (see below) Run: Zero-Pad h[ & Compute N FFT -pt FFT (can be pre-computed) For each i value ( For Each Block ) Compute z i [ using Simple FD-Based Method! Zero-Pad x i [ & Compute N FFT -pt FFT! Multiply by FFT of h[! Compute IFFT to get z i [ Overlap the z i [ with previously computed output blocks Add it to the output buffer <See Fig. 5.8 (e) in Porat> 14

OLA Method Complexity The FFT of filter h[ can be pre-computed! Don t Count it! We ll measure complexity using # Multiplies/Input Sample Use 2N FFT log 2 N FFT Multiplies as measure for FFT Assume input samples are Real Valued Can do 2 real-signal FFT s for price of 2N FFT log 2 N FFT (See Porat 5.5) For Each Pair of Input Blocks! One FFT: 2N FFT log 2 N FFT Multiplies! Multiply DFT DFT: 4N FFT Multiplies! One IFFT: 2N FFT log 2 N FFT Multiplies! Total: 4N FFT [1 + log 2 N FFT ] Multiplies = 4(N B + N 2 1) [1 + log 2 (N B + N 2 1)] The Number of Input Samples = 2 Blocks = 2N B # Multiplies/Input Sample = 2(1 + (N 2 1)/ N B ) [1 + log 2 (N B + N 2 1)] 15

Comparison to TD Method Complexity Complexity of TD Method Filter h[ has length of N 2 To get each output sample:! Multiply each filter coefficient by a signal sample: N 2 Multiplies # Multiplies/Input Sample = N 2 Multiplies Condition Needed For OLA to Be More Efficient: N 2 1 2 1+ 1 N N B [ 1+ log2 ( N2 + N B )] < 2 (5.38) In Porat Thus For a given N 2, Choose N B to minimize the left-hand side 16

FD Complexity vs TD Complexity Plot of: [Left-Hand Side]/[Right-Hand Side] of (5.38) Block S ize N B 10 5 10 4 10 3 2.5 1.5 1 0.8 0.6 Contours = (OLA Multiplies )/(TD Multiplies) 0.4 0.3 0.2 Optimal Block Size For Filter Length of 125 (Compare to Table 5.2 in Porat) 10 2 10 1 20 40 60 80 100 120 140 160 180 200 Filter Length N 2 OLA More Efficient Only For Filters Longer than 19 17