Optimal FIR Filters

© All Rights Reserved

10 views

Optimal FIR Filters

© All Rights Reserved

- Ee 262 Formal
- Filter Design
- Method to Measure Displacement and Velocity From Acceleration Signals
- Bandpass Filter Tutorial
- DSP CYCLE I & II
- Effect of Windowing Methods on Performance of FIR filter Design
- Books
- dsp_lab_manual_2011-2012_1
- Dsp Scaling Pid
- interpolated_filters_small
- Dsp Matlab Programs
- the Lab Manual Rev 5 (1).pdf
- ECE Syllabus(Total)
- AUC_2013
- Ax 26326329
- Filter Design 2
- DSP FILE
- SP05 Dig Filters 1 Classif Analysis1 Vs100609
- Filters
- 10 Chapter 4

You are on page 1of 93

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

7: Optimal FIR ﬁlters

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 1 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

2

h[n]e −jnω

M

−

2

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

M

2

h[n]e −jnω = h[0] + 2 h[n] cos nω

2

M

1

−

2

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

M

2

h[n]e −jnω = h[0] + 2 h[n] cos nω

2

M

1

−

2

H(ω) is real but not necessarily positive (unlike

H(e jω ) ).

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

M

2

h[n]e −jnω = h[0] + 2 h[n] cos nω

2

M

1

−

2

H(ω) is real but not necessarily positive (unlike

H(e jω ) ).

Weighted error: e(ω) = s(ω) H(ω) − d(ω) where d(ω) is the target.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

M

2

h[n]e −jnω = h[0] + 2 h[n] cos nω

2

M

1

−

2

H(ω) is real but not necessarily positive (unlike

H(e jω ) ).

Weighted error: e(ω) = s(ω) H(ω) − d(ω) where d(ω) is the target.

Choose s(ω) to control the error variation with ω.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

M

2

h[n]e −jnω = h[0] + 2 h[n] cos nω

2

M

1

−

2

H(ω) is real but not necessarily positive (unlike

H(e jω ) ).

Weighted error: e(ω) = s(ω) H(ω) − d(ω) where d(ω) is the target.

Choose s(ω) to control the error variation with ω.

Example: lowpass ﬁlter

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

M

2

h[n]e −jnω = h[0] + 2 h[n] cos nω

2

M

1

−

2

H(ω) is real but not necessarily positive (unlike

H(e jω ) ).

Weighted error: e(ω) = s(ω) H(ω) − d(ω) where d(ω) is the target.

Choose s(ω) to control the error variation with ω.

Example: lowpass ﬁlter

1

0 ≤ ω ≤ ω 1

d(ω) =

0

ω 2 ≤ ω ≤ π

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

M

2

h[n]e −jnω = h[0] + 2 h[n] cos nω

2

M

1

−

2

H(ω) is real but not necessarily positive (unlike

H(e jω ) ).

Weighted error: e(ω) = s(ω) H(ω) − d(ω) where d(ω) is the target.

Choose s(ω) to control the error variation with ω.

Example: lowpass ﬁlter

1

0 ≤ ω ≤ ω 1

d(ω) =

0

ω 2 ≤ ω ≤ π

s(ω) = δ −1 0 ≤ ω ≤ ω 1

ǫ −1 ω 2 ≤ ω ≤ π

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

M

2

h[n]e −jnω = h[0] + 2 h[n] cos nω

2

M

1

−

2

H(ω) is real but not necessarily positive (unlike

H(e jω ) ).

Weighted error: e(ω) = s(ω) H(ω) − d(ω) where d(ω) is the target.

Choose s(ω) to control the error variation with ω.

Example: lowpass ﬁlter

1

0 ≤ ω ≤ ω 1

d(ω) =

0

ω 2 ≤ ω ≤ π

s(ω) = δ −1 0 ≤ ω ≤ ω 1

ǫ −1 ω 2 ≤ ω ≤ π

e(ω) = ±1 when H(ω) lies at the edge of the speciﬁcation.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Optimal Filters

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

We restrict ourselves to zero-phase ﬁlters of odd length M + 1, symmetric

around h[0], i.e. h[−n] = h[n].

H(ω) = H(e jω ) =

M

M

2

h[n]e −jnω = h[0] + 2 h[n] cos nω

2

M

1

−

2

H(ω) is real but not necessarily positive (unlike

H(e jω ) ).

Weighted error: e(ω) = s(ω) H(ω) − d(ω) where d(ω) is the target.

Choose s(ω) to control the error variation with ω.

Example: lowpass ﬁlter

1

0 ≤ ω ≤ ω 1

d(ω) =

0

ω 2 ≤ ω ≤ π

s(ω) = δ −1 0 ≤ ω ≤ ω 1

ǫ −1 ω 2 ≤ ω ≤ π

e(ω) = ±1 when H(ω) lies at the edge of the speciﬁcation.

Minimax criterion: h[n] = arg min h[n] max ω |e(ω)|: minimize max error

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 2 / 11

Alternation Theorem

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Want to ﬁnd the best ﬁt line: with the smallest maximal error.

8

6

4

2

2

4

6

8

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 3 / 11

Alternation Theorem

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Want to ﬁnd the best ﬁt line: with the smallest maximal error.

Best ﬁt line always attains the

maximal error three times with

alternate signs

8

6

4

2

2

4

6

8

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 3 / 11

Alternation Theorem

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Want to ﬁnd the best ﬁt line: with the smallest maximal error.

Best ﬁt line always attains the

maximal error three times with

alternate signs

8

6

4

2

2

4

6

8

Proof:

Assume the ﬁrst maximal deviation from the line is negative as shown.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 3 / 11

Alternation Theorem

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Want to ﬁnd the best ﬁt line: with the smallest maximal error.

Best ﬁt line always attains the

maximal error three times with

alternate signs

8

6

4

2

2

4

6

8

Proof:

Assume the ﬁrst maximal deviation from the line is negative as shown.

There must be an equally large positive deviation; or else just move the line

downwards to reduce the maximal deviation.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 3 / 11

Alternation Theorem

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Want to ﬁnd the best ﬁt line: with the smallest maximal error.

Best ﬁt line always attains the

maximal error three times with

alternate signs

8

6

4

2

2

4

6

8

Proof:

Assume the ﬁrst maximal deviation from the line is negative as shown.

There must be an equally large positive deviation; or else just move the line

downwards to reduce the maximal deviation.

This must be followed by another maximal negative deviation; or else you

can rotate the line and reduce the deviations.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 3 / 11

Alternation Theorem

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Want to ﬁnd the best ﬁt line: with the smallest maximal error.

Best ﬁt line always attains the

maximal error three times with

alternate signs

8

6

4

2

2

4

6

8

Proof:

Assume the ﬁrst maximal deviation from the line is negative as shown.

There must be an equally large positive deviation; or else just move the line

downwards to reduce the maximal deviation.

This must be followed by another maximal negative deviation; or else you

can rotate the line and reduce the deviations.

Alternation Theorem:

A polynomial ﬁt of degree n to a bounded set of points is minimax if and

only if it attains its maximal error at n + 2 points with alternating signs.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 3 / 11

Alternation Theorem

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Want to ﬁnd the best ﬁt line: with the smallest maximal error.

Best ﬁt line always attains the

maximal error three times with

alternate signs

8

6

4

2

2

4

6

8

Proof:

Assume the ﬁrst maximal deviation from the line is negative as shown.

There must be an equally large positive deviation; or else just move the line

downwards to reduce the maximal deviation.

This must be followed by another maximal negative deviation; or else you

can rotate the line and reduce the deviations.

Alternation Theorem:

A polynomial ﬁt of degree n to a bounded set of points is minimax if and

only if it attains its maximal error at n + 2 points with alternating signs.

There may be additional maximal error points.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 3 / 11

Alternation Theorem

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Want to ﬁnd the best ﬁt line: with the smallest maximal error.

Best ﬁt line always attains the

maximal error three times with

alternate signs

8

6

4

2

2

4

6

8

Proof:

Assume the ﬁrst maximal deviation from the line is negative as shown.

There must be an equally large positive deviation; or else just move the line

downwards to reduce the maximal deviation.

This must be followed by another maximal negative deviation; or else you

can rotate the line and reduce the deviations.

Alternation Theorem:

A polynomial ﬁt of degree n to a bounded set of points is minimax if and

only if it attains its maximal error at n + 2 points with alternating signs.

There may be additional maximal error points.

Fitting to a continuous function is the same as to an inﬁnite number of

points.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 3 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

But

cos 2ω = 2 cos 2 ω − 1

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

But

cos 2ω =

2 cos 2

cos 3ω = 4 cos 3

ω − 1

ω − 3 cos ω

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

But cos nω = T n (cos ω): Chebyshev polynomial of 1st kind

cos 2ω = 2 cos 2

cos 3ω = 4 cos 3

ω − 1 = T 2 (cos ω)

ω − 3 cos ω = T 3 (cos ω)

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

But cos nω = T n (cos ω): Chebyshev polynomial of 1st kind

cos 2ω = 2 cos 2

cos 3ω = 4 cos 3

ω − 1 = T 2 (cos ω)

ω − 3 cos ω = T 3 (cos ω)

Recurrence Relation:

T n+1 (x) = 2xT n (x) − T n−1 (x) with T 0 (x) = 1, T 1 (x) = x

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

But cos nω = T n (cos ω): Chebyshev polynomial of 1st kind

cos 2ω = 2 cos 2

cos 3ω = 4 cos 3

ω − 1 = T 2 (cos ω)

ω − 3 cos ω = T 3 (cos ω)

Recurrence Relation:

T n+1 (x) = 2xT n (x) − T n−1 (x) with T 0 (x) = 1, T 1 (x) = x

Proof: cos (nω + ω) + cos (nω − ω) = 2 cos ω cos nω

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

But cos nω = T n (cos ω): Chebyshev polynomial of 1st kind

cos 2ω = 2 cos 2

cos 3ω = 4 cos 3

ω − 1 = T 2 (cos ω)

ω − 3 cos ω = T 3 (cos ω)

Recurrence Relation:

T n+1 (x) = 2xT n (x) − T n−1 (x) with T 0 (x) = 1, T 1 (x) = x

Proof: cos (nω + ω) + cos (nω − ω) = 2 cos ω cos nω

So H(ω) is an M

order polynomial in cos ω: alternation theorem applies.

2

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

But cos nω = T n (cos ω): Chebyshev polynomial of 1st kind

cos 2ω = 2 cos 2

cos 3ω = 4 cos 3

ω − 1 = T 2 (cos ω)

ω − 3 cos ω = T 3 (cos ω)

Recurrence Relation:

T n+1 (x) = 2xT n (x) − T n−1 (x) with T 0 (x) = 1, T 1 (x) = x

Proof: cos (nω + ω) + cos (nω − ω) = 2 cos ω cos nω

So H(ω) is an M

order polynomial in cos ω: alternation theorem applies.

2

Example: Low-pass ﬁlter of length 5 (M = 4)

1.4

M=4

1.2

1

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

3.5

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

But cos nω = T n (cos ω): Chebyshev polynomial of 1st kind

cos 2ω = 2 cos 2

cos 3ω = 4 cos 3

ω − 1 = T 2 (cos ω)

ω − 3 cos ω = T 3 (cos ω)

Recurrence Relation:

T n+1 (x) = 2xT n (x) − T n−1 (x) with T 0 (x) = 1, T 1 (x) = x

Proof: cos (nω + ω) + cos (nω − ω) = 2 cos ω cos nω

So H(ω) is an M order polynomial in cos ω: alternation theorem applies.

Example: Low-pass ﬁlter of length 5 (M = 4)

2

1.4

M=4

M=4

1.2

0

1

-5

0.8

0.6

-10

0.4

0.2

-15

0

0

0.5

1

1.5

2

2.5

3

3.5

0

0.5

1

1.5

2

2.5

3

|g|

|g| (dB)

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Chebyshev Polynomials

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

M

H(ω) = H(e jω ) = h[0] + 2 h[n] cos nω

2

1

But cos nω = T n (cos ω): Chebyshev polynomial of 1st kind

cos 2ω = 2 cos 2

cos 3ω = 4 cos 3

ω − 1 = T 2 (cos ω)

ω − 3 cos ω = T 3 (cos ω)

Recurrence Relation:

T n+1 (x) = 2xT n (x) − T n−1 (x) with T 0 (x) = 1, T 1 (x) = x

Proof: cos (nω + ω) + cos (nω − ω) = 2 cos ω cos nω

So H(ω) is an M

order polynomial in cos ω: alternation theorem applies.

2

Example: Low-pass ﬁlter of length 5 (M = 4)

1.4

M=4

M=4

½M=2

1.2

0

1

1

-5

0.8

0.5

0.6

-10

0.4

0

0.2

-15

0

0

0.5

1

1.5

2

2.5

3

3.5

0

0.5

1

1.5

2

2.5

3

-1

-0.5

0

0.5

1

cos( )

|g|

|g| (dB)

–

g

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 4 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

M

H(ω) = h[0] + 2 h[n] cos nω

2

0.6

1

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

M

H(ω)

= h[0] + 2 h[n] cos nω

= P(cos ω)

2

0.6

1

0.4

0.2

where P(x) is a polynomial of order M

.

0

0

0.5

1

1.5

2

2.5

3

2

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

M

H(ω)

= h[0] + 2 h[n] cos nω

= P(cos ω)

2

0.6

1

0.4

0.2

where P(x) is a polynomial of order M

.

0

0

0.5

1

1.5

2

2.5

3

2

dH

= −P ′ (cos ω) sin ω

dω

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

M

H(ω)

= h[0] + 2 h[n] cos nω

= P(cos ω)

2

0.6

1

0.4

0.2

where P(x) is a polynomial of order M

.

0

0

0.5

1

1.5

2

2.5

3

2

dH

= −P ′ (cos ω) sin ω

dω

= 0 at ω = 0, π and at most M

− 1 zeros of polynomial P ′ (x).

2

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

M

H(ω)

= h[0] + 2 h[n] cos nω

= P(cos ω)

2

0.6

1

0.4

0.2

where P(x) is a polynomial of order M

.

0

0

0.5

1

1.5

2

2.5

3

2

dH

= −P ′ (cos ω) sin ω

dω

= 0 at ω = 0, π and at most M

∴ With two bands, we have at most M

− 1 zeros of polynomial P ′ (x).

2

+ 3 maximal error frequencies.

2

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

M

H(ω)

= h[0] + 2 h[n] cos nω

= P(cos ω)

2

0.6

1

0.4

0.2

where P(x) is a polynomial of order M

.

0

0

0.5

1

1.5

2

2.5

3

2

dH

= −P ′ (cos ω) sin ω

dω

= 0 at ω = 0, π and at most M

∴ With two bands, we have at most M

− 1 zeros of polynomial P ′ (x).

2

+ 3 maximal error frequencies.

2

We require M

+ 2 of alternating signs for the optimal ﬁt.

2

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

M

H(ω)

= h[0] + 2 h[n] cos nω

= P(cos ω)

2

0.6

1

0.4

0.2

where P(x) is a polynomial of order M

.

0

0

0.5

1

1.5

2

2.5

3

2

dH

= −P ′ (cos ω) sin ω

dω

= 0 at ω = 0, π and at most M

∴ With two bands, we have at most M

− 1 zeros of polynomial P ′ (x).

2

+ 3 maximal error frequencies.

2

We require M

+ 2 of alternating signs for the optimal ﬁt.

2

Only three possibilities exist (try them all):

(a) ω = 0 + two band edges + M

(b) ω = π + two band edges + M

− 1 zeros of P ′ (x).

2

− 1 zeros of P ′ (x).

2

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Maximal Error Locations

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Maximal error locations occur either at band

1.2

M=18

edges or when dH

= 0

dω

1

0.8

M

H(ω)

= h[0] + 2 h[n] cos nω

= P(cos ω)

2

0.6

1

0.4

0.2

where P(x) is a polynomial of order M

.

0

0

0.5

1

1.5

2

2.5

3

2

dH

= −P ′ (cos ω) sin ω

dω

= 0 at ω = 0, π and at most M

∴ With two bands, we have at most M

− 1 zeros of polynomial P ′ (x).

2

+ 3 maximal error frequencies.

2

We require M

+ 2 of alternating signs for the optimal ﬁt.

2

Only three possibilities exist (try them all):

(a)

ω

= 0 + two band edges + M

− 1 zeros of P ′ (x).

2

(b)

ω

= π + two band edges + M

− 1 zeros of P ′ (x).

2

(c)

ω = {0 and π} + two band edges + M

− 2 zeros of P ′ (x).

2

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 5 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

2. Determine the error magnitude, ǫ, and the M

+ 1 coefﬁcients of

2

the polynomial that passes through the maximal error locations.

1.5

M = 4

Iteration 1

1

0.5

0

-0.5

0

0.5

1

1.5

2

2.5

3

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

2.

Determine the error magnitude, ǫ, and the M

+ 1 coefﬁcients of

2

the polynomial that passes through the maximal error locations.

3.

Find the local maxima of the error function by evaluating

e(ω) = s(ω) H(ω) − d(ω) on a dense set of ω.

1.5

M = 4

Iteration 1

1

0.5

0

-0.5

0

0.5

1

1.5

2

2.5

3

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

2.

Determine the error magnitude, ǫ, and the M

+ 1 coefﬁcients of

2

the polynomial that passes through the maximal error locations.

3.

Find the local maxima of the error function by evaluating

e(ω) = s(ω) H(ω) − d(ω) on a dense set

of ω.

4.

Update the maximal error frequencies to be an alternating subset of

the local maxima + band edges + {0 and/or π}.

1.5

M = 4

Iteration 1

1

0.5

0

-0.5

0

0.5

1

1.5

2

2.5

3

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

2.

Determine the error magnitude, ǫ, and the M

+ 1 coefﬁcients of

2

the polynomial that passes through the maximal error locations.

3.

Find the local maxima of the error function by evaluating

e(ω) = s(ω) H(ω) − d(ω) on a dense set

of ω.

4.

Update the maximal error frequencies to be an alternating subset of

the local maxima + band edges + {0 and/or π}.

If maximum error is > ǫ, go back to step 2.

1.5

M = 4

Iteration 1

1

0.5

0

-0.5

0

0.5

1

1.5

2

2.5

3

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

2.

Determine the error magnitude, ǫ, and the M

+ 1 coefﬁcients of

2

the polynomial that passes through the maximal error locations.

3.

Find the local maxima of the error function by evaluating

e(ω) = s(ω) H(ω) − d(ω) on a dense set

of ω.

4.

Update the maximal error frequencies to be an alternating subset of

the local maxima + band edges + {0 and/or π}.

If maximum error is > ǫ, go back to step 2.

1.5

M = 4

Iteration 1

M = 4

Iteration 2

1

1

0.5

0.5

0

0

-0.5

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

|g|

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

2.

Determine the error magnitude, ǫ, and the M

+ 1 coefﬁcients of

2

the polynomial that passes through the maximal error locations.

3.

Find the local maxima of the error function by evaluating

e(ω) = s(ω) H(ω) − d(ω) on a dense set

of ω.

4.

Update the maximal error frequencies to be an alternating subset of

the local maxima + band edges + {0 and/or π}.

If maximum error is > ǫ, go back to step 2. (typically 15 iterations)

1.5

M = 4

Iteration 1

M = 4

Iteration 2

1

1

0.5

0.5

0

0

-0.5

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

|g|

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

2.

Determine the error magnitude, ǫ, and the M

+ 1 coefﬁcients of

2

the polynomial that passes through the maximal error locations.

3.

Find the local maxima of the error function by evaluating

e(ω) = s(ω) H(ω) − d(ω) on a dense set

of ω.

4.

Update the maximal error frequencies to be an alternating subset of

the local maxima + band edges + {0 and/or π}.

If maximum error is > ǫ, go back to step 2. (typically 15 iterations)

1.5

M = 4

Iteration 1

M = 4

Iteration 2

M = 4

Iteration 3

1

1

1

0.5

0.5

0.5

0

0

0

-0.5

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

|g|

|g|

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

2.

Determine the error magnitude, ǫ, and the M

+ 1 coefﬁcients of

2

the polynomial that passes through the maximal error locations.

3.

Find the local maxima of the error function by evaluating

e(ω) = s(ω) H(ω) − d(ω) on a dense set

of ω.

4.

Update the maximal error frequencies to be an alternating subset of

the local maxima + band edges + {0 and/or π}.

If maximum error is > ǫ, go back to step 2. (typically 15 iterations)

1.5

M = 4

Iteration 1

M = 4

Iteration 2

M = 4

Iteration 3

1

1

1

0.5

0.5

0.5

0

0

0

-0.5

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

|g|

|g|

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Remez Exchange Algorithm

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

1. Guess the positions of the M

+ 2 maximal error frequencies and give

2

alternating signs to the errors (e.g. choose evenly spaced ω).

2.

Determine the error magnitude, ǫ, and the M

+ 1 coefﬁcients of

2

the polynomial that passes through the maximal error locations.

3.

Find the local maxima of the error function by evaluating

e(ω) = s(ω) H(ω) − d(ω) on a dense set

of ω.

4.

Update the maximal error frequencies to be an alternating subset of

the local maxima + band edges + {0 and/or π}.

If maximum error is > ǫ, go back to step 2. (typically 15 iterations)

5.

Evaluate H(ω) on M + 1 evenly spaced ω and do an IDFT to get h[n].

1.5

M = 4

Iteration 1

M = 4

Iteration 2

M = 4

Iteration 3

1

1

1

0.5

0.5

0.5

0

0

0

-0.5

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

|g|

|g|

|g|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 6 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

d(ω i ) = H(ω i ) + (−1) i ǫ

s(ω i )

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1:

Solve M

+ 2 equations in M

+ 2 unknowns for h[n] + ǫ.

2

2

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1:

Solve M

+ 2 equations in M + 2 unknowns for h[n] + ǫ.

2

2

M

2

In step 3, evaluate H(ω) = h[0] + 2

n=1 h[n] cos nω i

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1: (Computation time ∝ M 3 )

Solve M

+ 2 equations in M

+ 2 unknowns for h[n] + ǫ.

2

2

M

2

In step 3, evaluate H(ω) = h[0] + 2

n=1 h[n] cos nω i

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1: (Computation time ∝ M 3 )

Solve M

+ 2 equations in M

+ 2 unknowns for h[n] + ǫ.

2

2

M

2

In step 3, evaluate H(ω) = h[0] + 2

n=1 h[n] cos nω i

Method 2: Don’t calculate h[n] explicitly

1

Multiply equations by c i = j

and add:

=i cos ω i −cos ω j

M

M

M

+2

+2

2

c i h[0] + 2 n=1 h[n] cos nω + (−1) i ǫ =

2

2

c

i d(ω i )

i=1

s(ω i )

i=1

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1: (Computation time ∝ M 3 )

Solve M

+ 2 equations in M + 2 unknowns for h[n] + ǫ.

2

2

M

In step 3, evaluate H(ω) = h[0] + 2

n=1 h[n] cos nω i

2

Method 2: Don’t calculate h[n] explicitly

1

Multiply equations by c i = j

and add:

=i cos ω i −cos ω j

M

M

M

+2

+2

2

c i h[0] + 2 n=1 h[n] cos nω + (−1) i ǫ =

2

2

c

i d(ω i )

i=1

s(ω i )

i=1

All terms involving h[n] sum to zero leaving

M

M

+2

(−1) i

+2

c i

2

ǫ =

2

c

i d(ω i )

i=1

s(ω i

)

i=1

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1: (Computation time ∝ M 3 )

Solve M

+ 2 equations in M

+ 2 unknowns for h[n] + ǫ.

2

2

M

In step 3, evaluate H(ω) = h[0] + 2

n=1 h[n] cos nω i

2

Method 2: Don’t calculate h[n] explicitly

1

Multiply equations by c i = j

and add:

=i cos ω i −cos ω j

M

M

M

+2

+2

2

c i h[0] + 2 n=1 h[n] cos nω + (−1) i ǫ =

2

2

c

i d(ω i )

i=1

s(ω i )

i=1

All terms involving h[n] sum to zero leaving

M

M

+2

(−1) i

+2

c i

2

ǫ =

2

c

i d(ω i )

i=1

s(ω i

)

i=1

Solve for ǫ

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1: (Computation time ∝ M 3 )

Solve M

+ 2 equations in M

+ 2 unknowns for h[n] + ǫ.

2

2

M

In step 3, evaluate H(ω) = h[0] + 2

n=1 h[n] cos nω i

2

Method 2: Don’t calculate h[n] explicitly

1

Multiply equations by c i = j

and add:

=i cos ω i −cos ω j

M

M

M

+2

+2

2

c i h[0] + 2 n=1 h[n] cos nω + (−1) i ǫ =

2

2

c

i d(ω i )

i=1

s(ω i )

i=1

All terms involving h[n] sum to zero leaving

M

M

+2

(−1) i

+2

c i

2

ǫ =

2

c

i d(ω i )

i=1

s(ω i

)

i=1

Solve for ǫ then calculate the H(ω i )

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1: (Computation time ∝ M 3 )

Solve M

+ 2 equations in M

+ 2 unknowns for h[n] + ǫ.

2

2

M

In step 3, evaluate H(ω) = h[0] + 2

n=1 h[n] cos nω i

2

Method 2: Don’t calculate h[n] explicitly

1

Multiply equations by c i = j

and add:

=i cos ω i −cos ω j

M

M

M

+2

+2

2

c i h[0] + 2 n=1 h[n] cos nω + (−1) i ǫ =

2

2

c

i d(ω i )

i=1

s(ω i )

i=1

All terms involving h[n] sum to zero leaving

M

M

+2

(−1) i

+2

c i

2

ǫ =

2

c

i d(ω i )

i=1

s(ω i

)

i=1

Solve for ǫ then calculate the H(ω i ) then use Lagrange interpolation:

M

+2

cos ω−cos ω j

H(ω) = P(cos ω) =

2

H(ω i ) j

i=1

=i cos ω i −cos ω j

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1: (Computation time ∝ M 3 )

Solve M

+ 2 equations in M

+ 2 unknowns for h[n] + ǫ.

2

2

M

2

In step 3, evaluate H(ω) = h[0] + 2

n=1 h[n] cos nω i

Method 2: Don’t calculate h[n] explicitly

1

Multiply equations by c i = j

and add:

=i cos ω i −cos ω j

M

M

M

+2

+2

2

c i h[0] + 2 n=1 h[n] cos nω + (−1) i ǫ =

2

2

c

i d(ω i )

i=1

s(ω i )

i=1

All terms involving h[n] sum to zero leaving

M

M

+2

(−1) i

+2

c i

2

ǫ =

2

c

i d(ω i )

i=1

s(ω i

)

i=1

Solve for ǫ then calculate the H(ω i ) then use Lagrange interpolation:

M

+2

cos ω−cos ω j

H(ω) = P(cos ω) =

2

H(ω i ) j

i=1

=i cos ω i −cos ω j

M

+ 1 -polynomial going through all the H(ω i ) [actually order M ]

2

2

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Determine Polynomial

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

For each extremal frequency, ω i for 1 ≤ i ≤ M

+ 2

2

M

d(ω i ) = H(ω i ) + (−1) i ǫ = h[0] + 2 n=1 h[n] cos nω i + (−1) i ǫ

2

s(ω i )

s(ω i )

Method 1: (Computation time ∝ M 3 )

Solve M

+ 2 equations in M

+ 2 unknowns for h[n] + ǫ.

2

2

M

2

In step 3, evaluate H(ω) = h[0] + 2

n=1 h[n] cos nω i

Method 2: Don’t calculate h[n] explicitly (Computation time ∝ M 2 )

1

Multiply equations by c i = j

and add:

=i cos ω i −cos ω j

M

M

M

+2

+2

2

c i h[0] + 2 n=1 h[n] cos nω + (−1) i ǫ =

2

2

c

i d(ω i )

i=1

s(ω i )

i=1

All terms involving h[n] sum to zero leaving

M

M

+2

(−1) i

+2

c i

2

ǫ =

2

c

i d(ω i )

i=1

s(ω i

)

i=1

Solve for ǫ then calculate the H(ω i ) then use Lagrange interpolation:

M

+2

cos ω−cos ω j

H(ω) = P(cos ω) =

2

H(ω i ) j

i=1

=i cos ω i −cos ω j

M

+ 1 -polynomial going through all the H(ω i ) [actually order M ]

2

2

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 7 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1],

1

M=36

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

1

M=36

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

Stopband Attenuation: −25 dB and −15 dB

1

M=36

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

Stopband Attenuation: −25 dB and −15 dB

Passband Ripple: ±0.3 dB

1

M=36

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

Stopband Attenuation: −25 dB and −15 dB

Passband Ripple: ±0.3 dB

Determine gain tolerances for each band:

−25 dB = 0.056, −0.3 dB = 1 − 0.034, −15 dB = 0.178

1

M=36

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

Stopband Attenuation: −25 dB and −15 dB

Passband Ripple: ±0.3 dB

Determine gain tolerances for each band:

−25 dB = 0.056, −0.3 dB = 1 − 0.034, −15 dB = 0.178

Predicted order: M = 36

1

M=36

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

Stopband Attenuation: −25 dB and −15 dB

Passband Ripple: ±0.3 dB

Determine gain tolerances for each band:

−25 dB = 0.056, −0.3 dB = 1 − 0.034, −15 dB = 0.178

Predicted order: M = 36

M

+ 2 extremal frequencies are distributed between the bands

2

1

M=36

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

Stopband Attenuation: −25 dB and −15 dB

Passband Ripple: ±0.3 dB

Determine gain tolerances for each band:

−25 dB = 0.056, −0.3 dB = 1 − 0.034, −15 dB = 0.178

Predicted order: M = 36

M

+ 2 extremal frequencies are distributed between the bands

Filter meets specs

2

1

M=36

0.8

0.6

0.4

0.2

0

0

0.5

1

1.5

2

2.5

3

|H|

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

Stopband Attenuation: −25 dB and −15 dB

Passband Ripple: ±0.3 dB

Determine gain tolerances for each band:

−25 dB = 0.056, −0.3 dB = 1 − 0.034, −15 dB = 0.178

Predicted order: M = 36

M

+ 2 extremal frequencies are distributed between the bands

Filter meets specs ; clearer on a decibel scale

2

0

1

M=36

M=36

-5

0.8

-10

0.6

-15

0.4

-20

0.2

-25

-30

0

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

|H|

|H| (dB)

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

Stopband Attenuation: −25 dB and −15 dB

Passband Ripple: ±0.3 dB

Determine gain tolerances for each band:

−25 dB = 0.056, −0.3 dB = 1 − 0.034, −15 dB = 0.178

Predicted order: M = 36

M

+ 2 extremal frequencies are distributed between the bands

Filter meets specs ; clearer on a decibel scale

Most zeros are on the unit circle + three reciprocal pairs

2

0

1

M=36

M=36

1

-5

0.8

0.5

-10

0.6

-15

0

0.4

-20

-0.5

0.2

-25

-1

-30

0

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

-1

0

1

2

|H|

|H| (dB)

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

Example Design

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Filter Speciﬁcations:

Bandpass ω = [0.5, 1], Transition widths: ∆ω = 0.2

Stopband Attenuation: −25 dB and −15 dB

Passband Ripple: ±0.3 dB

Determine gain tolerances for each band:

−25 dB = 0.056, −0.3 dB = 1 − 0.034, −15 dB = 0.178

Predicted order: M = 36

M

+ 2 extremal frequencies are distributed between the bands

Filter meets specs ; clearer on a decibel scale

Most zeros are on the unit circle + three reciprocal pairs

Reciprocal pairs give a linear phase shift

2

0

1

M=36

M=36

1

-5

0.8

0.5

-10

0.6

-15

0

0.4

-20

-0.5

0.2

-25

-1

-30

0

0

0.5

1

1.5

2

2.5

3

0

0.5

1

1.5

2

2.5

3

-1

0

1

2

|H|

|H| (dB)

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 8 / 11

FIR Pros and Cons

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

•

Can have linear phase

no envelope distortion, all frequencies have the same delay

symmetric or antisymmetric: h[n] = h[−n]∀n or −h[−n]∀n

◦

◦

◦ antisymmetric ﬁlters have H(e j0 ) = H(e jπ ) = 0

◦

symmetry means you only need M

to implement the ﬁlter.

+ 1 multiplications

2

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 9 / 11

FIR Pros and Cons

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

•

Can have linear phase

no envelope distortion, all frequencies have the same delay

◦ symmetric or antisymmetric: h[n] = h[−n]∀n or −h[−n]∀n

◦

◦ antisymmetric ﬁlters have H(e j0 ) = H(e jπ ) = 0

◦

symmetry means you only need M

to implement the ﬁlter.

+ 1 multiplications

2

•

Always stable

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 9 / 11

FIR Pros and Cons

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

•

Can have linear phase

no envelope distortion, all frequencies have the same delay

◦ symmetric or antisymmetric: h[n] = h[−n]∀n or −h[−n]∀n

◦

◦ antisymmetric ﬁlters have H(e j0 ) = H(e jπ ) = 0

◦

symmetry means you only need M

to implement the ﬁlter.

+ 1 multiplications

2

•

•

Always stable

Low coefﬁcient sensitivity

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 9 / 11

FIR Pros and Cons

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

•

Can have linear phase

no envelope distortion, all frequencies have the same delay

◦ symmetric or antisymmetric: h[n] = h[−n]∀n or −h[−n]∀n

◦

◦ antisymmetric ﬁlters have H(e j0 ) = H(e jπ ) = 0

symmetry means you only need M

to implement the ﬁlter.

Always stable

Low coefﬁcient sensitivity

Optimal design method fast and robust

◦

+ 1 multiplications

2

•

•

•

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 9 / 11

FIR Pros and Cons

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

•

Can have linear phase

no envelope distortion, all frequencies have the same delay

symmetric or antisymmetric: h[n] = h[−n]∀n or −h[−n]∀n

◦

◦

• Maximal Error Locations

• Remez Exchange

◦ antisymmetric ﬁlters have H(e j0 ) = H(e jπ ) = 0

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

◦

symmetry means you only need M

to implement the ﬁlter.

+ 1 multiplications

2

•

•

Always stable

Low coefﬁcient sensitivity

•

•

Optimal design method fast and robust

Normally needs higher order than an IIR ﬁlter

dB

◦

Filter order M ≈

3.5∆ω where ∆ω is the most rapid transition

atten

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 9 / 11

FIR Pros and Cons

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

•

Can have linear phase

no envelope distortion, all frequencies have the same delay

symmetric or antisymmetric: h[n] = h[−n]∀n or −h[−n]∀n

◦ antisymmetric ﬁlters have H(e j0 ) = H(e jπ ) = 0

◦

◦

◦

symmetry means you only need M

to implement the ﬁlter.

+ 1 multiplications

2

•

•

Always stable

Low coefﬁcient sensitivity

•

•

Optimal design method fast and robust

Normally needs higher order than an IIR ﬁlter

dB

◦

Filter order M ≈

3.5∆ω where ∆ω is the most rapid transition

atten

dB

dB

2

◦

Filtering complexity ∝ M × f s ≈

atten

atten

3.5∆ω f s = 3.5∆Ω f s

2

∝ f

for a given speciﬁcation in unscaled Ω units.

s

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 9 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

use weight function, s(ω), to allow different errors

in different frequency bands

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

Response of symmetric ﬁlter is a polynomial in cos ω

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

• Response of symmetric ﬁlter is a polynomial in cos ω

•

Alternation Theorem: M

+ 2 maximal errors with alternating signs

2

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

Response of symmetric ﬁlter is a polynomial in cos ω

•

Alternation Theorem: M

+ 2 maximal errors with alternating signs

2

Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

Response of symmetric ﬁlter is a polynomial in cos ω

•

Alternation Theorem: M

+ 2 maximal errors with alternating signs

2

Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)

•

multiple constant-gain bands separated by transition regions

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

• Response of symmetric ﬁlter is a polynomial in cos ω

•

•

•

Alternation Theorem: M

+ 2 maximal errors with alternating signs

2

Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)

multiple constant-gain bands separated by transition regions

• very robust, works for ﬁlters with M > 1000

•

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

Response of symmetric ﬁlter is a polynomial in cos ω

•

Alternation Theorem: M

+ 2 maximal errors with alternating signs

2

Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)

•

•

•

multiple constant-gain bands separated by transition regions

very robust, works for ﬁlters with M > 1000

Efﬁcient: computation ∝ M 2

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

Response of symmetric ﬁlter is a polynomial in cos ω

•

Alternation Theorem: M

+ 2 maximal errors with alternating signs

2

Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)

•

•

•

•

multiple constant-gain bands separated by transition regions

very robust, works for ﬁlters with M > 1000

Efﬁcient: computation ∝ M 2

can go mad in the transition regions

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

Response of symmetric ﬁlter is a polynomial in cos ω

•

Alternation Theorem: M

+ 2 maximal errors with alternating signs

2

Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)

•

•

•

•

multiple constant-gain bands separated by transition regions

very robust, works for ﬁlters with M > 1000

Efﬁcient: computation ∝ M 2

can go mad in the transition regions

Modiﬁed version works on arbitrary gain function

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

Response of symmetric ﬁlter is a polynomial in cos ω

•

Alternation Theorem: M

+ 2 maximal errors with alternating signs

2

Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)

•

•

•

•

multiple constant-gain bands separated by transition regions

very robust, works for ﬁlters with M > 1000

Efﬁcient: computation ∝ M 2

can go mad in the transition regions

Modiﬁed version works on arbitrary gain function

Does not always converge

•

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

Summary

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

Optimal Filters: minimax error criterion

•

•

•

use weight function, s(ω), to allow different errors

in different frequency bands

symmetric ﬁlter has zeros on unit circle or in reciprocal pairs

Response of symmetric ﬁlter is a polynomial in cos ω

•

Alternation Theorem: M

+ 2 maximal errors with alternating signs

2

Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)

•

•

•

•

multiple constant-gain bands separated by transition regions

very robust, works for ﬁlters with M > 1000

Efﬁcient: computation ∝ M 2

can go mad in the transition regions

Modiﬁed version works on arbitrary gain function

Does not always converge

•

For further details see Mitra: 10.

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 10 / 11

MATLAB routines

7: Optimal FIR ﬁlters

• Optimal Filters

• Alternation Theorem

• Chebyshev Polynomials

• Maximal Error Locations

• Remez Exchange

Algorithm

• Determine Polynomial

• Example Design

• FIR Pros and Cons

• Summary

• MATLAB routines

ﬁrpm

ﬁrpmord

cﬁrpm

remez

optimal FIR ﬁlter design

estimate require order for ﬁrpm

arbitrary-response ﬁlter design

[obsolete] optimal FIR ﬁlter design

DSP and Digital Filters (2014-5490)

Optimal FIR: 7 – 11 / 11

- Ee 262 FormalUploaded byAnkit Rao
- Filter DesignUploaded bywferry27
- Method to Measure Displacement and Velocity From Acceleration SignalsUploaded bysaid
- Bandpass Filter TutorialUploaded byJaideep Bose
- DSP CYCLE I & IIUploaded byvinoth
- Effect of Windowing Methods on Performance of FIR filter DesignUploaded byijsret
- BooksUploaded byMridanku Shekhar Pramanick
- dsp_lab_manual_2011-2012_1Uploaded byJoy Bautista
- Dsp Scaling PidUploaded byVIJAYPUTRA
- interpolated_filters_smallUploaded bygopal_svsemails8998
- Dsp Matlab ProgramsUploaded byZohaib Afridi
- the Lab Manual Rev 5 (1).pdfUploaded byJesrey Salazar Macasero
- ECE Syllabus(Total)Uploaded byশেখ আরিফুল ইসলাম
- AUC_2013Uploaded byananthakanna2010
- Ax 26326329Uploaded byAnonymous 7VPPkWS8O
- Filter Design 2Uploaded bysadyehclen
- DSP FILEUploaded bywasim
- SP05 Dig Filters 1 Classif Analysis1 Vs100609Uploaded byChris Gull
- FiltersUploaded byfamtalu
- 10 Chapter 4Uploaded byAbinaya
- CE105E12_AS5-SolUploaded bySolitary Wolf
- Rt 32042112018Uploaded bymounika jammigumpula
- IJET-V4I3P88.pdfUploaded byInternational Journal of Engineering and Techniques
- 01Uploaded byDante Filho
- Carias Lab4 Ecc311l e51Uploaded byCJ Valete Jacob
- Overview of DSP and Image ProcessingUploaded byAsad Tarar
- Arsitektur Sistem Komputer - Week 3 - Bit and ByteUploaded byBasry Answar Sihotang
- Offer Eins 85 DigitalUploaded bygautamreddy_g
- HdlUploaded byAnkit Pawar
- 07423734Uploaded bymani manis

- Picturing Programs an Introduction to Computer ProgrammingUploaded byVinod Velayudhan
- Signal Denoising Using WaveletsUploaded byVinod Velayudhan
- CalculusUploaded byAshwani Raj
- Markov Chain Monte CarloUploaded byVinod Velayudhan
- Introduction to Wavelet AnalysisUploaded byVinod Velayudhan
- Completeness AxiomUploaded byVinod Velayudhan
- remezUploaded bymmaher844
- UntitledUploaded byVinod Velayudhan
- Beautified Gutenberg BooksUploaded byVinod Velayudhan
- UntitledUploaded byVinod Velayudhan
- UntitledUploaded byVinod Velayudhan
- StatisticsUploaded byVinod Velayudhan
- UntitledUploaded byVinod Velayudhan
- UntitledUploaded byVinod Velayudhan
- Product cost managementUploaded byVinod Velayudhan
- Chicago2K4Uploaded byVinod Velayudhan
- a byte of pythonUploaded byeebeta
- Beagle C4B SchematicUploaded byVinod Velayudhan
- Operators on Hilbert SpaceUploaded byVinod Velayudhan

- Matlab ProgramsUploaded bykrishna
- Digital FiltersUploaded byJames
- Band-Pass Filter Design ProjectUploaded byTim Laux
- Frequency FilteringUploaded byDileep
- Design and Analysis of IIR Peak & Notch FilterUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Chap7Uploaded byDharun Santhosh
- Mitra AddEx Ch13Uploaded byHiron Bose
- Mccelans PaperUploaded byRahul Makhijani
- filtercad3.0Uploaded byAlberto Alonso
- IJETAE_0815_56Uploaded byPramod Putta
- Digital Filter Design Using MatlabUploaded byKirti Susan Varghese
- CH16Uploaded byapi-3771799
- A Basic Introduction to Band-pass FilterUploaded byTalal Al-Sindi
- Mclellan Parks Rabiner algorithmUploaded byJoseph K Joseph
- DSP Lab ManualUploaded bylovelyosmile253
- Active Filter Circuits-2Uploaded bysightlesswarrior
- IT6502-Digital Signal ProcessingUploaded byAnonymous 5rejZkKg
- DSP.docxUploaded bySebastin Suresh
- DSPLABUploaded byHardik Govani
- pdf_5532Uploaded byGdfsndh Gfdvhjzd
- Chapter 7Uploaded byCaroline
- MicrowaveUploaded byEdwin Okoampa Boadu
- Lecture 02 - Multirate SPUploaded byGnana Jeevan
- firpmUploaded byRakesh Inani
- ImageUploaded byHajer Ahmed
- FIR FilterUploaded byPrabu Kan
- Design and SimulationUploaded byaublysodon
- 08.508 DSP Lab Expt No 6 HandoutUploaded byAssini Hussain
- DIP Lecture7 1Uploaded bySandeep Kumar Mekapothula
- Active Filters StudyUploaded byTo Dinh Du