CE 40763 Digital Signal Processing Optimal FIR Filter

  • Slides: 39
Download presentation
CE 40763 Digital Signal Processing Optimal FIR Filter Design Hossein Sameti Department of Computer

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

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 2

Problem statement for optimal FIR filter design • Given determine coefficients of G(ω) (i.

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 3

Observations on G(ω) is a continuous function of ω and is as many times

Observations on 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 4

Observations on G(ω) Find extrema Hossein Sameti, Dept. of Computer Eng. , Sharif University

Observations on G(ω) Find extrema Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 5

Observations on G(ω) Polynomial of degree L-1 Maximum of L-1 real zeros Max. total

Observations on G(ω) Polynomial of degree L-1 Maximum of L-1 real 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 6

Problem Statement for optimal FIR filter design Problem A • Given determine coefficients of

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 7

Problem B • Given determine coefficients of G(ω) (i. e. a(n)) such that Compute

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! 8

Problem C Define F as a union of closed intervals in Hossein Sameti, Dept.

Problem C Define F as a union of closed intervals in Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 9

Problem C where W is a positive weighting function Desired frequency response Find a(n)

Problem C where W is a positive weighting function Desired frequency response Find a(n) to minimize (same assumption as Problem B) 10

Problem C= Problem B? We start by showing that Hossein Sameti, Dept. of Computer

Problem C= Problem B? We start by showing that Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 11

Problem C= Problem B? By definition: Hossein Sameti, Dept. of Computer Eng. , Sharif

Problem C= Problem B? By definition: Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 12

Problem C= Problem B? By definition: Hossein Sameti, Dept. of Computer Eng. , Sharif

Problem C= Problem B? By definition: Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 13

Problem C= Problem B? Hossein Sameti, Dept. of Computer Eng. , Sharif University of

Problem C= Problem B? Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 14

Problem C= Problem B? in Problem C in Problem B 15

Problem C= Problem B? in Problem C in Problem B 15

Problem C= Problem B? Conclusion: Problem B: Find a(n) such that is minimized. Problem

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 16

Alternation Theorem Assumptions: F: union of closed intervals G(x) to be a polynomial of

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 17

Alternation Theorem The necessary and sufficient conditions for G(x) to be unique Lth order

Alternation Theorem The necessary and sufficient conditions for G(x) to be unique Lth order polynomial that minimizes is that E(x) exhibits at least L+2 alternations, i. e. , there 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 18

Number of alternations in the optimal case • Recall G(ω) can have at most

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!? 19

Number of alternations in the optimal case Ex: Polynomial of degree 7 • can

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 20

Number of alternations in the optimal case According to the alternation theorem, we have

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 21

Example: polynomial of degree 7 Extra-ripple case Hossein Sameti, Dept. of Computer Eng. ,

Example: polynomial of degree 7 Extra-ripple case Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 22

Example: polynomial of degree 7 Hossein Sameti, Dept. of Computer Eng. , Sharif University

Example: polynomial of degree 7 Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 23

Optimal Type I Lowpass Filters For Type I low-pass filters, alternations always occur at

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 24

Optimal Type I Lowpass Filters Equi-ripple except possibly at Hossein Sameti, Dept. of Computer

Optimal Type I Lowpass Filters Equi-ripple except possibly at Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 25

Summary of observations Ø For optimal type I low-pass filters, alternations always occur at

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 26

Parks-Mc. Clellan Algorithm (solving Problem C) • Given such that determine coefficients of G(ω)

Parks-Mc. Clellan Algorithm (solving Problem C) • Given such that determine coefficients of G(ω) (i. e. a(n)) is minimized. At alternation frequencies, we have: Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 27

Parks-Mc. Clellan Algorithm Equating Eq. 1 and Eq. 2 Hossein Sameti, Dept. of Computer

Parks-Mc. Clellan Algorithm Equating Eq. 1 and Eq. 2 Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 28

Parks-Mc. Clellan Algorithm 29

Parks-Mc. Clellan Algorithm 29

Parks-Mc. Clellan Algorithm L+2 linear equations and L+2 unknowns Hossein Sameti, Dept. of Computer

Parks-Mc. Clellan Algorithm L+2 linear equations and L+2 unknowns Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 30

Parks-Mc. Clellan Algorithm Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology

Parks-Mc. Clellan Algorithm Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 31

Remez Exchange Algorithm It can be shown that if 's are known, then can

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 32

Remez Exchange Algorithm Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology

Remez Exchange Algorithm Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 33

Remez Exchange Algorithm Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology

Remez Exchange Algorithm Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 34

Flowchart of P&M Algorithm 35

Flowchart of P&M Algorithm 35

Example of type I LP filter before the optimum is found Next alternation frequency

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 36

Comparison with the Kaiser window App. estimate of L: App. Length of Kaiser filter:

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 37

Demonstration Does it meet the specs? Hossein Sameti, Dept. of Computer Eng. , Sharif

Demonstration Does it meet the specs? Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 38

Demonstration Increase the length of the filter by 1. Does it meet the specs?

Demonstration Increase the length of the filter by 1. Does it meet the specs? Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 39