450 likes | 844 Views
CE 40763 Digital Signal Processing Optimal FIR Filter Design. Hossein Sameti Department of Computer Engineering Sharif University of Technology. Optimal FIR filter design. Definition of generalized linear-phase (GLP): Let ’ s focus on Type I FIR filter:. It can be shown that.
E N D
CE 40763Digital Signal ProcessingOptimal FIR Filter Design HosseinSameti Department of Computer Engineering Sharif University of Technology
Optimal FIR filter design • Definition of generalized linear-phase (GLP): • Let’s focus on Type I FIR filter: • It can be shown that (L+1) unknown parameters a(n) Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Problem statement for optimal FIR filter design • Given determine coefficients of G(ω) (i.e. a(n)) such that L is minimized (minimum length of the filter). Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Observations on G(ω) • G(ω) is a continuous function of ωand is as many times differentiable as we want. • How many local extrema (min/max) does G(ω) have in the range ? • In order to answer the above question, we have to write cos(ωn) as a sum of powers of cos(ω). : sum of powers of cos(ω) Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Observations on G(ω) Find extrema Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Observations on G(ω) Polynomial of degree L-1 Maximum of L-1real zeros Max. total number of real zeros: L+1 Conclusion: The maximum number of real zeros for (derivative of the frequency response of type I FIR filter) is L+1, where (N is the number of taps). Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Problem Statement for optimal FIR filter design Problem A • Given determine coefficients of G(ω) (i.e. a(n)) such that L is minimized (minimum length of the filter). Problem A Problem B Problem C Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Problem B • Given determine coefficients of G(ω) (i.e. a(n)) such that Compute Guess L is minimized. Algorithm B Decrease L by 1 Increase L by 1 Yes Stop!
Problem C Define F as a union of closed intervals in Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Problem C where W is a positive weighting function Desired frequency response Find a(n) to minimize (same assumption as Problem B)
Problem C= Problem B? • We start by showing that Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Problem C= Problem B? By definition: Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Problem C= Problem B? By definition: Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Problem C= Problem B? Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Problem C= Problem B? in Problem C in Problem B
Problem C= Problem B? • Conclusion: Problem B: Find a(n) such that is minimized. Problem C: Find a(n) such that is minimized. Problem B= Problem C Problem A= Problem C We now try to solve Problem C. Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Alternation Theorem Assumptions: • F: union of closed intervals • G(x) to be a polynomial of order L: • D = Desired function that is continuous in F. • W= positive function
Alternation Theorem • The necessary and sufficient conditions for G(x) to be uniqueLth order polynomial that minimizes is that E(x) exhibits at least L+2 alternations, i.e., there are at least L+2 values of x such that for a polynomial of degree 4 Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Number of alternations in the optimal case • Recall G(ω) can have at most L+1 local extrema. • According to the alternation theorem, G(ω) should have at least L+2 alternations(local extrema) in F. Contradiction!?
Number of alternations in the optimal case Ex: Polynomial of degree 7 • can also be alternation frequencies, although they are not local extrema. • G(ω) can have at most L+3 local extrema in F. Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Number of alternations in the optimal case • According to the alternation theorem, we have at least L+2 alternations. • According to our current argument, we have at most L+3 local extrema. • Conclusion: we have either L+2 or L+3 alternations in F for the optimal case. Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Example: polynomial of degree 7 Extra-ripple case Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Example: polynomial of degree 7 Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Optimal Type I Lowpass Filters • For Type I low-pass filters, alternations always occur at • If not, we potentially lose two alternations. Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Optimal Type I Lowpass Filters Equi-ripple except possibly at Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Summary of observations • For optimal type I low-pass filters, alternations always occur at • If not, two alternations are lost and the filter is no longer optimal. • Filter will be equi-ripple except possibly at Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Parks-McClellan Algorithm (solving Problem C) • Given determine coefficients of G(ω) (i.e. a(n)) such that is minimized. At alternation frequencies, we have: Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Parks-McClellan Algorithm Equating Eq.1 and Eq.2 Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Parks-McClellan Algorithm L+2 linear equations and L+2 unknowns Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Parks-McClellan Algorithm Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Remez Exchange Algorithm It can be shown that if 's are known, then can be derived using the following formulae: Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Remez Exchange Algorithm is an Lth-order trigonometric polynomial. We can interpolate a trigonometric polynomial through L+1 of the L+2 known values of or G. Using Lagrange interpolation formulae we can find the frequency response as: Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Remez Exchange Algorithm • Now is available at any desired frequency, without the need to solve the set of equations for the coefficients of . • If for all in the passband and stopband, then the optimum approximation has been found. Otherwise, we must find a new set of extremal frequencies. Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Example of type I LP filter before the optimum is found Next alternation frequency Original alternation frequency Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Comparison with the Kaiser window • App. estimate of L: • App. Length of Kaiser filter: • Example: • Optimal filter: • Kaiser filter: Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Demonstration Does it meet the specs? Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Demonstration Increase the length of the filter by 1. Does it meet the specs? Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology