You are on page 1of 93
7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal Error
7: Optimal FIR filters
• 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 filters
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters of odd length M + 1, symmetric
around h[0], i.e. h[−n] = h[n].
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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ω ) ).
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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.
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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 ω.
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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 filter
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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 filter
1
0 ≤ ω ≤ ω 1
d(ω) =
0
ω 2 ≤ ω ≤ π
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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 filter
1
0 ≤ ω ≤ ω 1
d(ω) =
0
ω 2 ≤ ω ≤ π
s(ω) = δ −1 0 ≤ ω ≤ ω 1
ǫ −1 ω 2 ≤ ω ≤ π
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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 filter
1
0 ≤ ω ≤ ω 1
d(ω) =
0
ω 2 ≤ ω ≤ π
s(ω) = δ −1 0 ≤ ω ≤ ω 1
ǫ −1 ω 2 ≤ ω ≤ π
e(ω) = ±1 when H(ω) lies at the edge of the specification.
Optimal Filters 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Optimal Filters
7: Optimal FIR filters
• 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 filters 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 filter
1
0 ≤ ω ≤ ω 1
d(ω) =
0
ω 2 ≤ ω ≤ π
s(ω) = δ −1 0 ≤ ω ≤ ω 1
ǫ −1 ω 2 ≤ ω ≤ π
e(ω) = ±1 when H(ω) lies at the edge of the specification.
Minimax criterion: h[n] = arg min h[n] max ω |e(ω)|: minimize max error
Alternation Theorem 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Alternation Theorem
7: Optimal FIR filters
• 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 find the best fit line: with the smallest maximal error.
8
6
4
2
2
4
6
8
Alternation Theorem 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Alternation Theorem
7: Optimal FIR filters
• 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 find the best fit line: with the smallest maximal error.
Best fit line always attains the
maximal error three times with
alternate signs
8
6
4
2
2
4
6
8
Alternation Theorem 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Alternation Theorem
7: Optimal FIR filters
• 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 find the best fit line: with the smallest maximal error.
Best fit line always attains the
maximal error three times with
alternate signs
8
6
4
2
2
4
6
8
Proof:
Assume the first maximal deviation from the line is negative as shown.
Alternation Theorem 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Alternation Theorem
7: Optimal FIR filters
• 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 find the best fit line: with the smallest maximal error.
Best fit line always attains the
maximal error three times with
alternate signs
8
6
4
2
2
4
6
8
Proof:
Assume the first 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.
Alternation Theorem 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Alternation Theorem
7: Optimal FIR filters
• 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 find the best fit line: with the smallest maximal error.
Best fit line always attains the
maximal error three times with
alternate signs
8
6
4
2
2
4
6
8
Proof:
Assume the first 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 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Alternation Theorem
7: Optimal FIR filters
• 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 find the best fit line: with the smallest maximal error.
Best fit line always attains the
maximal error three times with
alternate signs
8
6
4
2
2
4
6
8
Proof:
Assume the first 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 fit 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.
Alternation Theorem 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Alternation Theorem
7: Optimal FIR filters
• 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 find the best fit line: with the smallest maximal error.
Best fit line always attains the
maximal error three times with
alternate signs
8
6
4
2
2
4
6
8
Proof:
Assume the first 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 fit 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.
Alternation Theorem 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Alternation Theorem
7: Optimal FIR filters
• 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 find the best fit line: with the smallest maximal error.
Best fit line always attains the
maximal error three times with
alternate signs
8
6
4
2
2
4
6
8
Proof:
Assume the first 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 fit 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 infinite number of
points.
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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 ω
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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 ω)
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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ω
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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 filter 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|
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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 filter 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)
Chebyshev Polynomials 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Chebyshev Polynomials
7: Optimal FIR filters
• 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 filter 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
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
1
0.8
0.6
0.4
0.2
0
0
0.5
1
1.5
2
2.5
3
|H|
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
1
0.8
0.6
0.4
0.2
0
0
0.5
1
1.5
2
2.5
3
|H|
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
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|
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
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|
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
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 ω
|H|
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
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 ω
= 0 at ω = 0, π and at most M
− 1 zeros of polynomial P ′ (x).
2
|H|
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
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 ω
= 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|
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
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 ω
= 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 fit.
2
|H|
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
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 ω
= 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 fit.
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|
Maximal Error Locations 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Maximal Error Locations
7: Optimal FIR filters
• 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
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 ω
= 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 fit.
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|
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 ω).
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 coefficients 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|
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 coefficients 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|
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 coefficients 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|
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 coefficients 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|
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 coefficients 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|
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 coefficients 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|
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 coefficients 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|
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 coefficients 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|
Remez Exchange Algorithm 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials
Remez Exchange Algorithm
7: Optimal FIR filters
• 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 coefficients 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|
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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 )
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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 )
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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 ǫ
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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 )
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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
Determine Polynomial 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Determine Polynomial
7: Optimal FIR filters
• 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
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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|
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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|
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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|
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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|
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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|
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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|
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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|
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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|
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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)
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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)
Example Design 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
Example Design
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
Filter Specifications:
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)
FIR Pros and Cons 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev
FIR Pros and Cons
7: Optimal FIR filters
• 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 filters have H(e j0 ) = H(e jπ ) = 0
symmetry means you only need M
to implement the filter.
+ 1 multiplications
2
FIR Pros and Cons 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev
FIR Pros and Cons
7: Optimal FIR filters
• 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 filters have H(e j0 ) = H(e jπ ) = 0
symmetry means you only need M
to implement the filter.
+ 1 multiplications
2
Always stable
FIR Pros and Cons 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev
FIR Pros and Cons
7: Optimal FIR filters
• 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 filters have H(e j0 ) = H(e jπ ) = 0
symmetry means you only need M
to implement the filter.
+ 1 multiplications
2
Always stable
Low coefficient sensitivity
FIR Pros and Cons 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev
FIR Pros and Cons
7: Optimal FIR filters
• 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 filters have H(e j0 ) = H(e jπ ) = 0
symmetry means you only need M
to implement the filter.
Always stable
Low coefficient sensitivity
Optimal design method fast and robust
+ 1 multiplications
2
FIR Pros and Cons 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev
FIR Pros and Cons
7: Optimal FIR filters
• 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 filters 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 filter.
+ 1 multiplications
2
Always stable
Low coefficient sensitivity
Optimal design method fast and robust
Normally needs higher order than an IIR filter
dB
Filter order M ≈
3.5∆ω where ∆ω is the most rapid transition
atten
FIR Pros and Cons 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev
FIR Pros and Cons
7: Optimal FIR filters
• 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 filters have H(e j0 ) = H(e jπ ) = 0
symmetry means you only need M
to implement the filter.
+ 1 multiplications
2
Always stable
Low coefficient sensitivity
Optimal design method fast and robust
Normally needs higher order than an IIR filter
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 specification in unscaled Ω units.
s
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
Response of symmetric filter is a polynomial in cos ω
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
• Response of symmetric filter is a polynomial in cos ω
Alternation Theorem: M
+ 2 maximal errors with alternating signs
2
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
Response of symmetric filter is a polynomial in cos ω
Alternation Theorem: M
+ 2 maximal errors with alternating signs
2
Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
Response of symmetric filter 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
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
• Response of symmetric filter 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 filters with M > 1000
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
Response of symmetric filter 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 filters with M > 1000
Efficient: computation ∝ M 2
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
Response of symmetric filter 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 filters with M > 1000
Efficient: computation ∝ M 2
can go mad in the transition regions
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
Response of symmetric filter 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 filters with M > 1000
Efficient: computation ∝ M 2
can go mad in the transition regions
Modified version works on arbitrary gain function
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
Response of symmetric filter 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 filters with M > 1000
Efficient: computation ∝ M 2
can go mad in the transition regions
Modified version works on arbitrary gain function
Does not always converge
Summary 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials • Maximal
Summary
7: Optimal FIR filters
• 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 filter has zeros on unit circle or in reciprocal pairs
Response of symmetric filter 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 filters with M > 1000
Efficient: computation ∝ M 2
can go mad in the transition regions
Modified version works on arbitrary gain function
Does not always converge
For further details see Mitra: 10.
MATLAB routines 7: Optimal FIR filters • Optimal Filters • Alternation Theorem • Chebyshev Polynomials •
MATLAB routines
7: Optimal FIR filters
• Optimal Filters
• Alternation Theorem
• Chebyshev Polynomials
• Maximal Error Locations
• Remez Exchange
Algorithm
• Determine Polynomial
• Example Design
• FIR Pros and Cons
• Summary
• MATLAB routines
firpm
firpmord
cfirpm
remez
optimal FIR filter design
estimate require order for firpm
arbitrary-response filter design
[obsolete] optimal FIR filter design