ELEG–305: Digital Digital Signal Processing Lecture 19: Lattice Filters Kenneth E. Barner Department of Electrical and Computer Engineering University of Delaware
Fall 2008
K. E. Barner (Univ (Univ.. of Delaware Delaware))
ELEG–305: Digital Signal Processing
Outline
1
Review of Previous Lecture
2
Lecture Objectives
3
Implementation of Discrete-Time Systems Lattice Structures for FIR systems Lattice to Direct–Form Translation
Fall 2008
1 / 19
Review of Previous Lecture
Review of Previous Lecture Efficient FFT computation for real sequences – For x 1 (n ) and x 2 (n ) real, set x (n ) = x 1 (n ) + jx 2 (n ) then X 1 (k ) =
1 [X (k ) + X (N − k )]; 2 ∗
X 2 (k ) =
1 [X (k ) − X (N − k )] 2 j ∗
Similar “tricks’ hold for length 2N real sequences Linear filtering computation of the DFT – the Goertzel algorithm y k (n ) = W N k y k (n − 1) + x (n ) −
gives X (k ) = y k (n )|n =N Implementations of FIR discrete–time systems – Direct, Cascade, and Lattice filter structures K. E. Barner (Univ. of Delaware)
ELEG–305: Digital Signal Processing
Fall 2008
3 / 19
Lecture Objectives
Lecture Objectives
Objective Derive lattice structures for FIR filters; Develop a method for converting lattice filter coefficients to direct–form (FIR) coefficients Reading Chapters 9 (9.2); Next lecture, complete lattice filters, structures for IIR systems (Chapter 9.2–9.3); start filter design (Chapter 10.1–10.2)
Implementation of Discrete-Time Systems
Lattice Structures for FIR systems
Objective: Developed a lattice–structure realization of FIR filters Approach: Suppose we have a sequence of FIR filters H m (z ) = Am (z )
m = 0, 1, . . . , M − 1
where by definition m
Am (z ) = 1
+ α ( ) m
−
k z
k
m ≥ 1
k =1
Suppose m = 1. Then the output of H 1 (z ), for input x (n ), is y (n ) = x (n ) + α1 (1)x (n − 1)
(∗)
To build a cascade of 1 st order stages, generalize the notation. Let f 0 (n ) = x (n ) g 0 (n ) = x (n ) f 1 (n ) = f 0 (n ) + K 1 g 0 (n − 1) g 1 (n ) = K 1 f 0 (n ) + g 0 (n − 1) Question: For what K 1 value is (∗) realized, i.e., f 1 (n ) = y (n )? K. E. Barner (Univ. of Delaware)
ELEG–305: Digital Signal Processing
Implementation of Discrete-Time Systems
Fall 2008
Lattice Structures for FIR systems
Single Stage Lattice Filter
To realize (∗), let K 1 = α1 (1). Then f 1 (n ) = f 0 (n ) + K 1 g 0 (n − 1)
= x (n ) + α1 (1)x (n − 1) = y (n ) Similarly,
[order m = 1 filter output]
g 1 (n ) = α1 (1)x (n ) + x (n − 1)
Note: The stage 1 governing equations are f 1 (n ) = f 0 (n ) + K 1 g 0 (n − 1)
g 1 (n ) = K 1 f 0 (n ) + g 0 (n − 1)
5 / 19
Implementation of Discrete-Time Systems
Lattice Structures for FIR systems
Objective: Add a second stage and equate to the m = 2 filter Note that [m = 2 filter]
H 2 (z ) = A2 (z ) = 1 + α2 (1)z
1
−
+ α2 (2)z
−
2
⇒ y (n ) = x (n ) + α2 (1)x (n − 1) + α2 (2)x (n − 2)
(∗)
The two stage lattice filter is given by
The governing equations are f 1 (n ) = f 0 (n ) + K 1 g 0 (n − 1)
f 2 (n ) = f 1 (n ) + K 2 g 1 (n − 1)
g 1 (n ) = K 1 f 0 (n ) + g 0 (n − 1)
g 2 (n ) = K 2 f 1 (n ) + g 1 (n − 1)
Procedure: Set K 1 and K 2 such that (∗) is realized Note: f 0 (n ) = g 0 (n ) = x (n ) [pipeline input] and f 2 (n ) = y (n ) [output] K. E. Barner (Univ. of Delaware)
ELEG–305: Digital Signal Processing
Implementation of Discrete-Time Systems
Fall 2008
7 / 19
Lattice Structures for FIR systems
[lattice
f 1 (n ) = f 0 (n ) + K 1 g 0 (n − 1)
f 2 (n ) = f 1 (n ) + K 2 g 1 (n − 1)
equations]
g 1 (n ) = K 1 f 0 (n ) + g 0 (n − 1) g 2 (n ) = K 2 f 1 (n ) + g 1 (n − 1)
By substitution f 2 (n ) = f 1 (n ) + K 2 g 1 (n − 1)
= [f 0 (n ) + K 1 g 0 (n − 1)] + K 2 [K 1 f 0 (n − 1) + g 0 (n − 2)] = [x (n ) + K 1 x (n − 1)] + K 2 [K 1 x (n − 1) + x (n − 2)] = x (n ) + K 1 (1 + K 2 )x (n − 1) + K 2 x (n − 2)
(∗∗)
Recalling (∗) [direct FIR form] y (n ) = x (n ) + α2 (1)x (n − 1) + α2 (2)x (n − 2) and equating with (∗∗) [lattice form] yields
α2 (2) = K 2
and
α2 (1) = K 1 (1 − K 2 )
or, equivalently,
( )
α2 (1)
(∗)
Implementation of Discrete-Time Systems
Lattice Structures for FIR systems
Process: This is repeated for M − 1 stages, with general recursion f 0 (n ) = g 0 (n ) = x (n ) f m (n ) = f m 1 (n ) + K m g m 1 (n − 1),
m = 1, 2, . . . , M − 1
g m (n ) = K m f m 1 (n ) + g m 1 (n − 1),
m = 1, 2, . . . , M − 1
−
−
−
−
At the final stage y (n ) = f m 1 (n ) −
m −1
=
α
m −1 (k )x (n −
k )
k =0
K. E. Barner (Univ. of Delaware)
ELEG–305: Digital Signal Processing
Implementation of Discrete-Time Systems
Fall 2008
Lattice Structures for FIR systems
Observation: At each stage there are two outputs, f m (n ) and g m (n ) Consider g 2 (n ). First & second stage equations: f 1 (n ) = f 0 (n ) + K 1 g 0 (n − 1)
f 2 (n ) = f 1 (n ) + K 2 g 1 (n − 1)
g 1 (n ) = K 1 f 0 (n ) + g 0 (n − 1)
g 2 (n ) = K 2 f 1 (n ) + g 1 (n − 1)
Apply substitution – similarly to the previous case g 2 (n ) = K 2 f 1 (n ) + g 1 (n − 1)
= K 2 [f 0 (n ) + K 1 g 0 (n − 1)] + [K 1 f 0 (n − 1) + g 0 (n − 2)] = K 2 x (n ) + K 1 (1 + K 2 )x (n − 1) + x (n − 2) using the prior result K 2 = α2 (2) and K 1 (1 − K 2 ) = α2 (1),
⇒ g 2 (n ) = α2 (2)x (n ) + α2 (1)x (n − 1) + x (n − 2)
9 / 19
Implementation of Discrete-Time Systems
Lattice Structures for FIR systems
Result: The two outputs at arbitrary stage m are expressed as m
m
( )= α ( ) (
f m n
m
k x n − k )
and
( )= β ( ) (
g m n
k =0
m
k x n − k )
k =0
where
β m (k ) = αm (m − k ),
k = 0, 1, . . . , m
Note: f m (n ) is the forward prediction; g m (n ) the backward prediction Taking the z –transform F m (z ) = Am (z )X (z )
or
F m (z ) F m (z ) Am (z ) = = X (z ) F 0 (z )
or
G m (z ) G m (z ) B m (z ) = = X (z ) G 0 (z )
Similarly G m (z ) = B m (z )X (z ) K. E. Barner (Univ. of Delaware)
ELEG–305: Digital Signal Processing
Implementation of Discrete-Time Systems
Fall 2008
Lattice Structures for FIR systems
m
( )= α ( )
Recall Am z
m
−
k z
k
k =0
Question: How does B m (z ) relate to Am (z )? m
B m (z ) =
β ( ) α ( − ) α ( ) α ( ) m
k z
k
m
m
k z
m
l z l
−
[substitute β m (k ) = αm (m − k )]
k =0 m
=
−
k
[let l = m − k ]
k =0 m
=
−
m
l =0
m
−
= z
m
m
l z l
l =0
= z
−
Am (z 1 )
m
−
Result: B ( ) has reciprocal zeros of A( ) B ( ) is the reciprocal, or
11 / 19
Implementation of Discrete-Time Systems
Lattice Structures for FIR systems
Lattice Filter Representation Summary Case 1: FIR filter representations m
m
( )= α ( ) (
f m n
m
k x n − k )
( )= β ( ) (
and
g m n
k =0
m
k x n − k )
k =0
Case 2: z –domain representations F m (z ) = Am (z )X (z )
or
G m (z ) = B m (z )X (z )
or
Also, B m (z ) = z
−
Am (z 1 ),
m
−
F m (z ) Am (z ) = X (z ) G m (z ) B m (z ) = X (z )
m = 1, 2, . . . , M − 1
Case 3: Recursion lattice representations f 0 (n ) = g 0 (n ) = x (n ) f m (n ) = f m 1 (n ) + K m g m 1 (n − 1),
m = 1, 2, . . . , M − 1
g m (n ) = K m f m 1 (n ) + g m 1 (n − 1),
m = 1, 2, . . . , M − 1
−
−
−
−
K. E. Barner (Univ. of Delaware)
ELEG–305: Digital Signal Processing
Implementation of Discrete-Time Systems
Fall 2008
Lattice Structures for FIR systems
Taking z –transform of the recursion lattice representations F 0 (z ) = G 0 (z ) = X (z ) F m (z ) = F m 1 (z ) + K m z 1 G m 1 (z ),
m = 1, 2, . . . , M − 1
G m (z ) = K m F m 1 (z ) + z 1 G m 1 (z ),
m = 1, 2, . . . , M − 1
−
−
−
−
−
−
Dividing by X (z ) and using Am (z ) =
F m (z ) X (z )
and B m (z ) =
G m (z ) X (z )
Case 4: z –domain recursion lattice representations A0 (z ) = B 0 (z ) = 1 Am (z ) = Am 1 (z ) + K m z 1 B m 1 (z ),
m = 1, 2, . . . , M − 1
B m (z ) = K m Am 1 (z ) + z 1 B m 1 (z ),
m = 1, 2, . . . , M − 1
−
−
−
−
−
−
or in matrix notation
( )
Am z B m (z )
=
1 K m K m 1
Am 1 (z ) z 1 B m 1 (z ) −
−
13 / 19
Implementation of Discrete-Time Systems
Lattice to Direct–Form Translation
Design Questions: How do we convert lattice coefficients (K terms) to direct-form filter coefficients (α terms)? How do we convert direct–form coefficients to lattice coefficients? Case 1: Lattice to Direct–Form Translation Approach: Utilize relations A0 (z ) = B 0 (z ) = 1 Am (z ) = Am 1 (z ) + K m z 1 B m 1 (z ),
m = 1, 2, . . . , M − 1
−
−
−
B m (z ) = z
−
Am (z 1 ),
m
−
m = 1, 2, . . . , M − 1
Solve for α terms recursively, starting with m = 1 Example Determine the direct form realization of a three–stage (M = 4) lattice filter with coefficients K 1 = 1/2, K 2 = 1/2, K 3 = 1/4. K. E. Barner (Univ. of Delaware)
ELEG–305: Digital Signal Processing
Implementation of Discrete-Time Systems
Fall 2008
Lattice to Direct–Form Translation
Start recursion – set m = 1 A1 (z ) = A0 (z ) + K 1 z 1 B 0 (z ) 1 1 = 1 + z (∗) 2 −
−
Set (∗) equal to α1 polynomial −
A1 (z ) = 1 + α1 (1)z 1 ⇒ α1 (1) = 2
1
Note, B m (z ) is the reverse polynomial of Am (z )
⇒ B 1 (z ) = z 1 A1 (z 1 ) = z −
=
−
1 + z 2
−
1
−
1
1+
1 z 2
15 / 19
Implementation of Discrete-Time Systems
Lattice to Direct–Form Translation
For m = 2, use recursion Am (z ) = Am 1 (z ) + K m z 1 B m 1 (z ) −
−
−
A2 (z ) = A1 (z ) + K 2 z 1 B 1 (z ) 1 1 1 1 z = 1 + z + 2 2 3 1 = 1 + z 1 + z 2 4 2 −
−
−
−
1 + z 2
−
1
−
equating α terms yields
α2 (1) =
3 4
α2 (2) =
and
1 2
Reversing the polynomial of Am (z ) to get B m (z ) B 2 (z ) = z 2 A2 (z 1 ) = −
K. E. Barner (Univ. of Delaware)
−
1 3 + z 2 4
1
−
+ z
−
2
ELEG–305: Digital Signal Processing
Implementation of Discrete-Time Systems
Fall 2008
Lattice to Direct–Form Translation
For m = 3, A3 (z ) = A2 (z ) + K 3 z 1 B 2 (z ) 3 1 1 z = 1 + z 1 + z 2 + 4 2 4 7 11 2 1 3 = 1 + z 1 + z + z 8 16 4 −
−
−
−
−
−
1
1 3 + z 2 4
−
1
+ z
−
2
−
Thus
α3 (1) =
7 , 8
α3 (2) =
11 , 16
α3 (3) =
1 4
Result: The system in direct-form: (where α3 (0) = 1) 3
y (n ) =
α ( ) ( 3
k x n − k )
k =0
= x (n ) +
7 11 1 x (n − 1) + x (n − 2) + x (n − 3) 8 16 4
17 / 19
Lecture Summary
Lecture Summary Lattice Filters – general recursion f 0 (n ) = g 0 (n ) = x (n ) f m (n ) = f m 1 (n ) + K m g m 1 (n − 1) −
−
g m (n ) = K m f m 1 (n ) + g m 1 (n − 1), −
−
Lattice to Direct–Form Translation – utilize recursion on A0 (z ) = B 0 (z ) = 1 Am (z ) = Am 1 (z ) + K m z 1 B m 1 (z ), −
−
−
B m (z ) = z
−
Am (z 1 ),
m
−
m = 1, 2, . . . , M − 1
m = 1, 2, . . . , M − 1
Next lecture – Complete lattice filters, structures for IIR systems (Chapter 9.2–9.3); start filter design (Chapter 10.1–10.2) K. E. Barner (Univ. of Delaware)
ELEG–305: Digital Signal Processing
Fall 2008
19 / 19