Optimum Approximation of FIR Filters

Download Report

Transcript Optimum Approximation of FIR Filters

Optimum Approximation of FIR Filters
Quote of the Day
There are three kinds of lies: lies, damned lies, and
statistics.
Benjamin Disraeli
Content and Figures are from Discrete-Time Signal Processing, 2e by Oppenheim, Shafer, and Buck, ©1999-2000 Prentice Hall
Inc.
Optimum Filter Design
• Filter design by windows is simple but not optimal
– Like to design filters with minimal length
• Optimality Criterion
– Window design with rectangular filter is optimal in one sense
• Minimizes the mean-squared approximation error to desired response
• But causes large error around discontinuities
h n 0  n  M
hn   d
else
 0

   
2
1
2
j
j
 
Hd e  H e
d

2  
– Alternative criteria can give better results
• Minimax: Minimize maximum error
• Frequency-weighted error
• Most popular method: Parks-McClellan Algorithm
– Reformulates filter design problem as function approximation
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
2
Function Approximation
• Consider the design of type I FIR filter
– Assume zero-phase for simplicity
– Can delay by sufficient amount to make causal
    h ne
he n  he  n
Ae e
L
j
– Assume L=M/2 an integer
n  L
e
 jn
   h 0   2h ncosn
Ae e
j
L
e
n 1
e
• After delaying the resulting impulse response
 
 
hn  he n  M / 2  hM  n
H ej  Ae ej e jM / 2
• Goal is to approximate a desired response with Ae ej
 
• Example approximation mask
– Low-pass filter
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
3
Polynomial Approximation
• Using Chebyshev polynomials

cosn  Tn cos 
where Tn x  cos n cos1 x

• Express the following as a sum of powers
   h 0   2h ncosn   a cos
Ae e
L
j
e
n 1
L
e
   Px
Ae e
x  cos 
k
k 0
• Can also be represented as
j
k
where Px 
L
k
a
x
 k
k 0
• Parks and McClellan fix p, s, and L
– Convert filter design to an approximation problem
• The approximation error is defined as
  
 
E  W Hd ej  Ae ej
–
–
–
–
W() is the weighting function
Hd(ej) is the desired frequency response
Both defined only over the passpand and stopband
Transition bands are unconstrained
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
4
Lowpass Filter Approximation
• The weighting function for
lowpass filter is
 2

W   1

1
0    p
s    
• This choice will force the
error to = 2 in both
bands
• Criterion used is minmax
min
maxE 
he n:0 nL 
F
• F is the set of frequencies
the approximations is
made over
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
5
Alternation Theorem
• Fp denote the closed subset
– consisting of the disjoint union of closed subsets of the real axis x
• The following is an rth order polynomial
Px  
r
a x
k 0
k
k
• Dp(x) denotes given desired function that is continuous on Fp
• Wp(x) is a positive function that is continuous on Fp
• The weighted error is given as
Ep x  Wp xDp x  Px
• The maximum error is defined as
E  maxEp x
xFp
• A necessary and sufficient condition that P(x) be the unique rth order
polynomial that minimizes E is that Ep(x) exhibit at least (r+2)
alternations
• There must be at least (r+2) values xi in Fp such that x1<x2<…<xr+2
Ep xi   Ep xi1    E for i  1,2,...,(r  2)
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
6
Example
• Examine polynomials
P(x) that approximate
1 for
 1  x  0.1
0 for 0.1  x  1
• Fifth order polynomials
shown
• Which satisfy the
theorem?
Not
alternations
Not
alternations
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
7
Optimal Type I Lowpass Filters
• In this case the P(x) polynomial is the cosine polynomial
Pcos  
L
 ak cos 
k
k 0
• The desired lowpass filter frequency response (x=cos)
1 cos p    1
Dp cos   
0  1    cos s
• The weighting function is given as
1 / K cos p    1
Wp cos   
 1    cos s
 1
• The approximation error is given as
Ep cos  Wp cosDp cos  Pcos
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
8
Typical Example Lowpass Filter Approximation
• 7th order approximation
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
9
Properties of Type I Lowpass Filters
• Maximum possible number of alternations of the error is L+3
• Alternations will always occur at p and s
• All points with zero slope inside the passpand and all points
with zero slope inside the stopband will correspond to
alternations
– The filter will be equiripple except possibly at 0 and 
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
10
Flowchart of Parks-McClellan Algorithm
Copyright (C) 2005 Güner Arslan
351M Digital Signal Processing
11