Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 51 Lecture 5: Block Processing for FIR Filters l Block.

Similar presentations


Presentation on theme: "EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 51 Lecture 5: Block Processing for FIR Filters l Block."— Presentation transcript:

1

2 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 51 Lecture 5: Block Processing for FIR Filters l Block processing methods –recorded data: x = {x 0 x 1 x 2 … x L-1 } length: L x = L –system impulse response: h = {h 0 h 1 h 2 h 3 … h M } length: L h = M+1 –output data: y = {y 0 y 1 y 2 y3 … y Ly-1 } length: L y = L x + L h - 1 –key question: how do we process h and x to compute y? x h y

3 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 52 Block Processing l Convolution table y(0) = h(0)x(0) y(1) = h(0)x(1) + h(1)x(0) y(2) = h(0)x(2) + h(1)x(1) + h(2)x(0) y(3) = h(0)x(3) + h(1)x(2) + h(2)x(1) + h(3)x(0) y(4) = h(0)x(4) + h(1)x(3) + h(2)x(2) + h(3)x(1) + h(4)x(0) y(0) y(1) y(2) y(3) y(4)

4 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 53 Block Processing l Convolution table –example: x = {1 2 1 3}, h = {4 2 1} n=0 y(0) = 4 y(1) = 10 y(2) = 9y(3) = 16y(4) = 7y(5) = 3 y = {4 10 9 16 7 3} n=0

5 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 54 Block Processing l LTI Form y(n) = … + x(0)h(n) + x(1)h(n-1) + x(2)h(n-2) + x(3)h(n-3) + … y(0)y(1)y(2)y(3)y(4)

6 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 55 Block Processing l LTI form –example: x = {1 2 1 3}, h = {4 2 1} n=0 410916730 y = {4 10 9 16 7 3} n=0

7 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 56 Block Processing l Matrix form:

8 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 57 Block Processing l Matrix form –example: x = {1 2 1 3}, h = {4 2 1} n=0 y = {4 10 9 16 7 3} n=0

9 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 58 Block Processing l Flip-and-slide form: y(n) = h(0)x(n) + h(1)x(n-1) + h(2)x(n-2) + … + h(L)x(n-L) h(2) h(1) h(0) y(0) h(2) h(1) h(0) y(1) y(2) h(2) h(1) h(0) y(3) h(2) h(1) h(0) y(4) h(2) h(1) h(0) y(5)

10 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 59 Block Processing l Flip-and-slide form: –example: x = {1 2 1 3}, h = {4 2 1} n=0 1 2 4 4 10 9 1 2 4 16 1 2 4 7 3 y = {4 10 9 16 7 3} n=0

11 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 510 Block Processing l Programming considerations –convolution table form function y = conv(h, x) Lh = length(h); Lx = length(x); Ly = Lh+Lx-1; y = zeros(1,Ly); for n = 0:Ly-1 y(n+1) = 0; for i = 0:Lh-1 for j = 0:Lx-1 if (i+j == n) y(n+1) = y(n+1) + h(i+1)*x(j+1); end; end end end All these for loops will be inefficient in Matlab!

12 EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 511 Block Processing l Programming considerations –LTI form function y = conv(h, x) Lh = length(h); Lx = length(x); Ly = Lh+Lx-1; y = zeros(1,Ly); for j = 0:Lx-1 shifth = [zeros(1, j) h zeros(1,Ly-Lh-j)]; y = y + x(j+1)*shifth; end Only 1 for loop!


Download ppt "EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 24-Sept, 1998EE421, Lecture 51 Lecture 5: Block Processing for FIR Filters l Block."

Similar presentations


Ads by Google