Professional Documents
Culture Documents
2
In this chapter, block processing and sample
processing methods applied to FIR filtering and
Convolution. Several computational aspects of
convolution equations are considered:
* Direct form
* Convolution table
* LTI form
* Matrix form
* Flip-and-slide form
* Overlap-add block convolution form.
* Z-Transform (be discussed in the Z-
transform Chapter)
3
1. Block processing methods
1.1. Convolution
Sampling time interval, T=1/fs.
Number of time samples: L = TLfs
x(n) = [x0, x1, … , xL-1]
where n = 0, 1, …, L – 1:
The direct and convolution forms
y ( n ) h ( m) x ( n m) x ( m) h( n m)
m m
Convolution table form
y (n) h(i ) x( j ) (i j n)
i. j
4
1.2 DIRECT FORM
Consider a causal FIR filter of order M with
impulse response h(n),
h = [h0, h1, …, hM]
where n = 0, 1, …, M
the length of the filter or the number of filter
coefficients LH = M + 1
The output of the filter:
y ( n ) h ( m) x ( n m)
m
5
with conditions 0 mM
and 0 n – m L – 1
mnL–1+m
The limit of output index n:
0mnL–1+mL–1+M
0n L–1+M
y = [y0, y1, y2, … , yL – 1 + M]
Ly = Lx + Lh –1
6
m must satisfy simultaneously the inequalities
0 mM
n–L+1 mn
7
It follows:
max(0, n – L + 1 ) m min(n,M)
The direct form of convolution
min( n , M )
y ( n) h ( m) x ( n m)
m max( 0 , n L 1)
Example: an order 3 filter and a length 5-input
signal: h = [h0, h1, h2, h3]
x = [x0, x1, x2, x3, x4]
y = h * x = [y0, y1, y2, y3, y4, y5, y6, y7]
8
Equation applied:
min( n , 3)
y ( n) h ( m) x ( n m)
m max( 0 , n 4 )
n 0,1, ..., 7
for n= 0, 1, 2,….7
max (0, 0 – 4) m min(0, 3) => m = 0
max (0, 1 – 4) m min(1, 3) => m = 0, 1
max (0, 2 – 4) m min(2, 3) => m = 0,1 ,2
max (0, 3 – 4) m min(3, 3) => m = 0, 1, 2, 3
max (0, 4 – 4) m min(4, 3) => m = 0, 1, 2, 3
max (0, 5 – 4) m min(5, 3) => m = 1, 2, 3
max (0, 6 – 4) m min(6, 3) => m = 2, 3
max (0, 7 – 4) m min(7, 3) => m = 3
i.e. n = 5, y5 = h1x4 + h2x3 + h3x2
9
All the output samples:
y0 = h0x0
y1 = h0x1 + h1x0
y2 = h0x2 + h1x1 + h2x0
y3 = h0x3 + h1x2 + h2x1 + h3x0
y4 = h0x4 + h1x3 + h2x2 + h3x1
y5 = h1x4 + h2x3 + h3x2
y6 = h2x4 + h3x3
y7 = h3x4
10
1.3. Convolution table:
11
Example: Find the convolution of the following
filter and input signal
h = [1, 2, -1, 1]
x = [1, 1, 2, 1, 2, 2, 1, 1]
y = [1, 3, 3, 5, 3, 7, 4, 3, 3, 0, 1]
Ly = L + M = 8 + 3 = 11
12
1.4. LTI form:
h = [h0, h0, h2, h3]
x = [x0, x1, x2, x3, x4]
Input x can be rewritten as a linear combination of delayed
impulses
x = x0[1, 0, 0, 0, 0] + x1[0, 1, 0, 0, 0] + x2[0, 0, 1, 0, 0] +
x3[0, 0, 0, 1, 0] + x4[0, 0, 0, 0, 1]
x(n)=x0(n)+x1(n–1)+x2(n–2)+x3(n–3)+x4(n–4)
Then:
y(n)=x0h(n)+x1h(n–1)+x2h(n–2)+x3h(n–3)+x4h(n–4)
13
We can present the input and output signals as blocks:
14
LTI form of convolution
15
Example: h = [1, 2, -1, 1] and
x = [1, 1, 2, 1, 2, 2, 1, 1]
16
The LTI form can also be written in a form
similar by determine the proper limits of
For n = 0, 1, …, L + M – 1
17
1.5. Matrix form
Linear matrix form: y = Hx
The filter matrix H must be rectangular with
dimensions:
Ly * Lx = (L + M) * L
y0 h0 0 0 0 0
y h h0 0 0 0
1 1 x0
y2 h2 h1 h0 0 0
x1
y3 h3 h2 h1 h0 0
y x2 Hx
y4 0 h3 h2 h1
h0
x3
y5 0 0 h3 h2 h1
x4
y 0 0 0 h3 h2
6
y7 0 0 0 0 h3
19
1.6. Flip and slide
21
Example: An IIR filter has the impulse response
h(n)=(0.75)nu(n). Using convolution to find y(n)
when the inputs are:
a) x(n) = u(n)
b) x(n) = (-1)nu(n)
c) x(n) = u(n) – u(n – 25)
Find the steady state response for each case.
Solve:
n n
a) y (n) h(m)x(n - m) (0.75) n u(m)u(n - m)
m0 m 0
n
n1 (0.75) n 1
(0.75) 4 3(0.75) n
m 0 1 0.75
1
lim y ( n) 4
1 0.75
22
n n
b) m n -m
y (n) h(m)x(n - m) (0.75) (-1)
m 0 m 0
n
(-1)n (0.75) m
m 0
Steady state response:
n 1
n 1 ( 0. 75 ) n 4 3
(-1) = (-1) + (0.75) n
1 0.75 7 7
n 1 n 4
y(n) - (1) (1)
1 0.75 7
23
n n
c) m
yn hm xnm
m max( 0 , n L 1)
( 0.75)
m max( 0 , n L 1)
Two cases:
n n 1
1 ( 0 . 75)
yn (0.75) m 4 3(0.75) n
m0 1 0.75
n 25
1 - (0.75)
yn (0.75) m = (0.75) n -24
m n 24 1 - 0.75
24
1.8. Overlap-Add Block Convolution Method
26
2. Sample processing method
Adder
Multiplier
Delay
27
FIR Filtering in Direct Form
28