Efficient algorithms for the design of finite impulse response - - PowerPoint PPT Presentation

efficient algorithms for the design of finite impulse
SMART_READER_LITE
LIVE PREVIEW

Efficient algorithms for the design of finite impulse response - - PowerPoint PPT Presentation

Efficient algorithms for the design of finite impulse response digital filters Silviu Filip under the supervision of N. Brisebarre and G. Hanrot (AriC, LIP, ENS Lyon) Journes Nationales de Calcul Formel (JNCF) CIRM, Luminy, November 3-7, 2014


slide-1
SLIDE 1

Efficient algorithms for the design of finite impulse response digital filters

Silviu Filip

under the supervision of N. Brisebarre and G. Hanrot

(AriC, LIP, ENS Lyon)

Journées Nationales de Calcul Formel (JNCF) CIRM, Luminy, November 3-7, 2014

1 / 19

slide-2
SLIDE 2

Digital Signal Processing

became increasingly relevant over the past 4 decades: ANALOG → DIGITAL

2 / 19

slide-3
SLIDE 3

Digital Signal Processing

became increasingly relevant over the past 4 decades: ANALOG → DIGITAL think of:

data communications (ex: Internet, HD TV and digital radio) audio and video systems (ex: CD, DVD, BD players) many more

2 / 19

slide-4
SLIDE 4

Digital Signal Processing

became increasingly relevant over the past 4 decades: ANALOG → DIGITAL think of:

data communications (ex: Internet, HD TV and digital radio) audio and video systems (ex: CD, DVD, BD players) many more

What are the ’engines’ powering all these?

2 / 19

slide-5
SLIDE 5

Digital filters

y[n] = x[n] ⋆ h[n] → we get two categories of filters finite impulse response (FIR) filters infinite impulse response (IIR) filters

3 / 19

slide-6
SLIDE 6

Digital filters

y[n] = x[n] ⋆ h[n] → we get two categories of filters finite impulse response (FIR) filters infinite impulse response (IIR) filters → natural to work in the frequency domain

3 / 19

slide-7
SLIDE 7

Digital filters

Y (ω) = X(ω)H(ω), ω ∈ [0, π] → we get two categories of filters finite impulse response (FIR) filters infinite impulse response (IIR) filters → natural to work in the frequency domain H is the transfer function of the filter

3 / 19

slide-8
SLIDE 8

Digital filters

Y (ω) = X(ω)H(ω), ω ∈ [0, π] → we get two categories of filters finite impulse response (FIR) filters H is a polynomial infinite impulse response (IIR) filters H is a rational fraction → natural to work in the frequency domain H is the transfer function of the filter

3 / 19

slide-9
SLIDE 9

The filtering toolchain

Steps:

  • 1. derive a concrete mathematical representation of the filter

→ use theory of minimax approximation

4 / 19

slide-10
SLIDE 10

The filtering toolchain

Steps:

  • 1. derive a concrete mathematical representation of the filter

→ use theory of minimax approximation

  • 2. quantization of the filter coefficients using fixed-point or floating-point

formats → use tools from algorithmic number theory (euclidean lattices)

4 / 19

slide-11
SLIDE 11

The filtering toolchain

Steps:

  • 1. derive a concrete mathematical representation of the filter

→ use theory of minimax approximation

  • 2. quantization of the filter coefficients using fixed-point or floating-point

formats → use tools from algorithmic number theory (euclidean lattices)

  • 3. hardware synthesis of the filter

4 / 19

slide-12
SLIDE 12

The filtering toolchain

Steps:

  • 1. derive a concrete mathematical representation of the filter

→ use theory of minimax approximation

  • 2. quantization of the filter coefficients using fixed-point or floating-point

formats → use tools from algorithmic number theory (euclidean lattices)

  • 3. hardware synthesis of the filter

Today’s focus: first step for FIR filters

4 / 19

slide-13
SLIDE 13

Finite Impulse Response (FIR) filters

large class of filters, with a lot of desirable properties Usual representation: H(ω) = L

k=0 ak cos(ωk)

5 / 19

slide-14
SLIDE 14

Finite Impulse Response (FIR) filters

large class of filters, with a lot of desirable properties Usual representation: H(ω) = L

k=0 ak cos(ωk) = L k=0 akTk(cos(ω))

→ if x = cos(ω), view H in the basis of Chebyshev polynomials

5 / 19

slide-15
SLIDE 15

Finite Impulse Response (FIR) filters

large class of filters, with a lot of desirable properties Usual representation: H(ω) = L

k=0 ak cos(ωk) = L k=0 akTk(cos(ω))

→ if x = cos(ω), view H in the basis of Chebyshev polynomials Specification:

5 / 19

slide-16
SLIDE 16

Finite Impulse Response (FIR) filters

large class of filters, with a lot of desirable properties Usual representation: H(ω) = L

k=0 ak cos(ωk) = L k=0 akTk(cos(ω))

→ if x = cos(ω), view H in the basis of Chebyshev polynomials Specification:

H(ω) =

8

  • k=0

ak cos(ωk)

5 / 19

slide-17
SLIDE 17

Optimal FIR design with real coefficients

The problem: Given a closed real set F, find an approximation H(ω) = L

k=0 ak cos(ωk) of degree L for a continuous function D(ω), ω ∈ F

such that δ = E(ω)∞,F = max

ω∈F |H(ω) − D(ω)|

is minimal.

6 / 19

slide-18
SLIDE 18

Optimal FIR design with real coefficients

The solution: characterized by the Alternation Theorem

Theorem

The unique solution H(ω) = L

k=0 ak cos(ωk) has an error function E(ω), for

which there exist L + 2 values ω0 < ω1 < · · · < ωL+1, belonging to F, such that E(ωi) = −E(ωi+1) = ±δ, for i = 0, . . . , L.

7 / 19

slide-19
SLIDE 19

Optimal FIR design with real coefficients

The solution: characterized by the Alternation Theorem

Theorem

The unique solution H(ω) = L

k=0 ak cos(ωk) has an error function E(ω), for

which there exist L + 2 values ω0 < ω1 < · · · < ωL+1, belonging to F, such that E(ωi) = −E(ωi+1) = ±δ, for i = 0, . . . , L. → well studied in Digital Signal Processing literature 1972: Parks and McClellan → based on a powerful iterative approach from Approximation Theory: 1932: Remez

7 / 19

slide-20
SLIDE 20

The Parks-McClellan design method: Example

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

8 / 19

slide-21
SLIDE 21

The Parks-McClellan design method: Example

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

8 / 19

slide-22
SLIDE 22

The Parks-McClellan design method: Example

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

8 / 19

slide-23
SLIDE 23

The Parks-McClellan design method: Example

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

8 / 19

slide-24
SLIDE 24

The Parks-McClellan design method: Example

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

8 / 19

slide-25
SLIDE 25

The Parks-McClellan design method: Example

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

8 / 19

slide-26
SLIDE 26

The Parks-McClellan design method: Example

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

8 / 19

slide-27
SLIDE 27

The Parks-McClellan design method: Example

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

8 / 19

slide-28
SLIDE 28

The Parks-McClellan design method: Steps

9 / 19

slide-29
SLIDE 29

Step 1: Choosing the L + 2 initial references

Traditional approach: take the L + 2 references uniformly from F → can lead to convergence problems

10 / 19

slide-30
SLIDE 30

Step 1: Choosing the L + 2 initial references

Traditional approach: take the L + 2 references uniformly from F → can lead to convergence problems → want to start from better approximations Existing approaches: not general enough and/or costly to execute

10 / 19

slide-31
SLIDE 31

Step 1: Choosing the L + 2 initial references

Traditional approach: take the L + 2 references uniformly from F → can lead to convergence problems → want to start from better approximations Existing approaches: not general enough and/or costly to execute Our approach: extrema position extrapolation from smaller filters → although empirical, it is rather robust in practice

10 / 19

slide-32
SLIDE 32

Step 2: Computing the current error function E(ω) and δ

Amounts to solving a linear system in a0, . . . , aL and δ.      1 cos(ω0) · · · cos(Lω0) 1 . . . . . . . . . . . . 1 cos(ωL) · · · cos(LωL) (−1)L 1 cos(ωL+1) · · · cos(LωL+1) (−1)L+1           a0 . . . aL δ      =      D(ω0) . . . D(ωL) D(ωL+1)      → solving system directly: can be numerically unstable

11 / 19

slide-33
SLIDE 33

Step 2: Computing the current error function E(ω) and δ

Amounts to solving a linear system in a0, . . . , aL and δ.      1 cos(ω0) · · · cos(Lω0) 1 . . . . . . . . . . . . 1 cos(ωL) · · · cos(LωL) (−1)L 1 cos(ωL+1) · · · cos(LωL+1) (−1)L+1           a0 . . . aL δ      =      D(ω0) . . . D(ωL) D(ωL+1)      → solving system directly: can be numerically unstable → use barycentric form of Lagrange interpolation [Berrut&Trefethen2004]

11 / 19

slide-34
SLIDE 34

Barycentric Lagrange interpolation

Problem: p polynomial with deg p L interpolates f at points xj, i.e., p(xj) = fj, j = 0, . . . , L

12 / 19

slide-35
SLIDE 35

Barycentric Lagrange interpolation

Problem: p polynomial with deg p L interpolates f at points xj, i.e., p(xj) = fj, j = 0, . . . , L → the barycentric form of p is: p(x) =

L

  • j=0

wj x − xj fj

L

  • j=0

wj x − xj , where wj = 1

  • k=j(xj − xk).

Cost: O(L2) for computing all wj, O(L) for evaluating p(x).

12 / 19

slide-36
SLIDE 36

Barycentric Lagrange interpolation

→ numerically stable if the family of interpolation nodes used has a small Lebesgue constant [Mascarenhas&Camargo2014] The Lebesgue constant: specific to each grid of points; quantifies the convergence/divergence properties of polynomial interpolants using those nodes

13 / 19

slide-37
SLIDE 37

Barycentric Lagrange interpolation

→ numerically stable if the family of interpolation nodes used has a small Lebesgue constant [Mascarenhas&Camargo2014] The Lebesgue constant: specific to each grid of points; quantifies the convergence/divergence properties of polynomial interpolants using those nodes → from empirical observation, the families of points used inside the Parks-McClellan algorithm (Step 1 + Step 3) usually converge to sets of points with small Lebesgue constant

13 / 19

slide-38
SLIDE 38

Step 3: Finding the local extrema of E(ω)

Traditional approach: evaluate E(ω) on a dense grid of uniformly distributed points (in practice it is usually 16L) → works well for degree L < 100, tends to fail in some cases for larger L

14 / 19

slide-39
SLIDE 39

Step 3: Finding the local extrema of E(ω)

Traditional approach: evaluate E(ω) on a dense grid of uniformly distributed points (in practice it is usually 16L) → works well for degree L < 100, tends to fail in some cases for larger L Our approach: → Chebyshev-proxy rootfinder(CPR) [Boyd2002,Boyd2013]

14 / 19

slide-40
SLIDE 40

Step 3: Finding the local extrema of E(ω)

Traditional approach: evaluate E(ω) on a dense grid of uniformly distributed points (in practice it is usually 16L) → works well for degree L < 100, tends to fail in some cases for larger L Our approach: → Chebyshev-proxy rootfinder(CPR) [Boyd2002,Boyd2013] → [Pachon&Trefethen2009] use it to implement the Remez algorithm

14 / 19

slide-41
SLIDE 41

Step 3: Finding the local extrema of E(ω)

Traditional approach: evaluate E(ω) on a dense grid of uniformly distributed points (in practice it is usually 16L) → works well for degree L < 100, tends to fail in some cases for larger L Our approach: → Chebyshev-proxy rootfinder(CPR) [Boyd2002,Boyd2013] → [Pachon&Trefethen2009] use it to implement the Remez algorithm → apply a similar idea for FIR approximations

14 / 19

slide-42
SLIDE 42

Step 3: Finding the local extrema of E(ω)

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

Idea: split F into appropriate subintervals F = N

i=0 Fi

interpolate E(ω) on each Fi with small degree Chebyshev interpolants Ci compute roots of the derivative of Ci using a Chebyshev-proxy rootfinder

15 / 19

slide-43
SLIDE 43

Step 3: Finding the local extrema of E(ω)

  • 0.2

0.2 0.4 0.6 0.8 1 1.2

Idea: split F into appropriate subintervals F = N

i=0 Fi

interpolate E(ω) on each Fi with small degree Chebyshev interpolants Ci compute roots of the derivative of Ci using a Chebyshev-proxy rootfinder

Advantages: → robust, numerically stable root finding approach → easy to parallelize Cost: if N = O(L), overall O(L2) arithmetic operations

15 / 19

slide-44
SLIDE 44

Step 4: Recover coefficients of H(ω) upon convergence

→ can use the Inverse Discrete Fourier Transform

16 / 19

slide-45
SLIDE 45

Step 4: Recover coefficients of H(ω) upon convergence

→ can use the Inverse Discrete Fourier Transform → implement it using Clenshaw’s algorithm for computing linear combinations of Chebyshev polynomials (numerically robust approach) Cost: O(L2) arithmetic operations

16 / 19

slide-46
SLIDE 46

Our implementation: Examples & Results

Comparison with MATLAB & demo

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 −80 −60 −40 −20 20

Normalized Frequency (×π rad/sample) Magnitude (dB)

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 −300 −200 −100 100

Normalized Frequency (×π rad/sample) Magnitude (dB) 17 / 19

slide-47
SLIDE 47

Our implementation: Examples & Results

→ design of channelizers for software radio systems Specification: degree 53248 filter with stopband

  • 0,

1 8192π

  • and passband
  • 3

8192π, π

  • .

Figure: error function on [0.99π, 0.9905π] Convergence: required 5 iterations

18 / 19

slide-48
SLIDE 48

Perspectives

Conclusion: improved the practical behavior of a well known polynomial approximation algorithm for filter design → use numerically stable barycentric Lagrange interpolation + rootfinders without sacrifices in efficiency this new approach can take huge advantage of parallel architectures Future work: release the code for our implementation as an open source library provide a complete toolchain for constructing FIR filters (approximation + quantification + hardware synthesis) tackle the IIR filter setting (rational fraction)

non-linear problem constraints: poles located inside the unit circle

19 / 19