optimal fir filters
DESCRIPTION
Optimal FIR FiltersTRANSCRIPT
-
7: Optimal FIR filters
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 1 / 11
-
Optimal Filters
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
-
Optimal Filters
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn
-
Optimal Filters
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn= h[0] + 2M
2
1 h[n] cosn
-
Optimal Filters
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn= h[0] + 2M
2
1 h[n] cosn
H() is real but not necessarily positive (unlikeH(ej)).
-
Optimal Filters
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn= h[0] + 2M
2
1 h[n] cosn
H() is real but not necessarily positive (unlikeH(ej)).
Weighted error: e() = s()(H() d()
)where d() is the target.
-
Optimal Filters
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn= h[0] + 2M
2
1 h[n] cosn
H() is real but not necessarily positive (unlikeH(ej)).
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 Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn= h[0] + 2M
2
1 h[n] cosn
H() is real but not necessarily positive (unlikeH(ej)).
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 Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn= h[0] + 2M
2
1 h[n] cosn
H() is real but not necessarily positive (unlikeH(ej)).
Weighted error: e() = s()(H() d()
)where d() is the target.
Choose s() to control the error variation with .Example: lowpass filter
d() =
{1 0 1
0 2
-
Optimal Filters
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn= h[0] + 2M
2
1 h[n] cosn
H() is real but not necessarily positive (unlikeH(ej)).
Weighted error: e() = s()(H() d()
)where d() is the target.
Choose s() to control the error variation with .Example: lowpass filter
d() =
{1 0 1
0 2
s() =
{1 0 1
1 2
-
Optimal Filters
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn= h[0] + 2M
2
1 h[n] cosn
H() is real but not necessarily positive (unlikeH(ej)).
Weighted error: e() = s()(H() d()
)where d() is the target.
Choose s() to control the error variation with .Example: lowpass filter
d() =
{1 0 1
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 Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 2 / 11
We restrict ourselves to zero-phase filters of odd length M + 1, symmetricaround h[0], i.e. h[n] = h[n].
H() = H(ej) =M
2
M2
h[n]ejn= h[0] + 2M
2
1 h[n] cosn
H() is real but not necessarily positive (unlikeH(ej)).
Weighted error: e() = s()(H() d()
)where d() is the target.
Choose s() to control the error variation with .Example: lowpass filter
d() =
{1 0 1
0 2
s() =
{1 0 1
1 2
e() = 1 when H() lies at the edge of the specification.
Minimax criterion: h[n] = argminh[n]max |e()|: minimize max error
-
Alternation Theorem
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 3 / 11
Want to find the best fit line: with the smallest maximal error.
2 4 6 82
4
6
8
-
Alternation Theorem
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 3 / 11
Want to find the best fit line: with the smallest maximal error.
Best fit line always attains themaximal error three times withalternate signs
2 4 6 82
4
6
8
-
Alternation Theorem
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 3 / 11
Want to find the best fit line: with the smallest maximal error.
Best fit line always attains themaximal error three times withalternate signs
2 4 6 82
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 Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 3 / 11
Want to find the best fit line: with the smallest maximal error.
Best fit line always attains themaximal error three times withalternate signs
2 4 6 82
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 linedownwards to reduce the maximal deviation.
-
Alternation Theorem
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 3 / 11
Want to find the best fit line: with the smallest maximal error.
Best fit line always attains themaximal error three times withalternate signs
2 4 6 82
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 linedownwards to reduce the maximal deviation.This must be followed by another maximal negative deviation; or else youcan rotate the line and reduce the deviations.
-
Alternation Theorem
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 3 / 11
Want to find the best fit line: with the smallest maximal error.
Best fit line always attains themaximal error three times withalternate signs
2 4 6 82
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 linedownwards to reduce the maximal deviation.This must be followed by another maximal negative deviation; or else youcan rotate the line and reduce the deviations.
Alternation Theorem:A polynomial fit of degree n to a bounded set of points is minimax if andonly 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 Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 3 / 11
Want to find the best fit line: with the smallest maximal error.
Best fit line always attains themaximal error three times withalternate signs
2 4 6 82
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 linedownwards to reduce the maximal deviation.This must be followed by another maximal negative deviation; or else youcan rotate the line and reduce the deviations.
Alternation Theorem:A polynomial fit of degree n to a bounded set of points is minimax if andonly 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 Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 3 / 11
Want to find the best fit line: with the smallest maximal error.
Best fit line always attains themaximal error three times withalternate signs
2 4 6 82
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 linedownwards to reduce the maximal deviation.This must be followed by another maximal negative deviation; or else youcan rotate the line and reduce the deviations.
Alternation Theorem:A polynomial fit of degree n to a bounded set of points is minimax if andonly 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 ofpoints.
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
But
cos 2 = 2 cos2 1
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
But
cos 2 = 2 cos2 1cos 3 = 4 cos3 3 cos
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
But cosn = Tn(cos): Chebyshev polynomial of 1st kind
cos 2 = 2 cos2 1 = T2(cos)cos 3 = 4 cos3 3 cos = T3(cos)
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
But cosn = Tn(cos): Chebyshev polynomial of 1st kind
cos 2 = 2 cos2 1 = T2(cos)cos 3 = 4 cos3 3 cos = T3(cos)
Recurrence Relation:Tn+1(x) = 2xTn(x) Tn1(x) with T0(x) = 1, T1(x) = x
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
But cosn = Tn(cos): Chebyshev polynomial of 1st kind
cos 2 = 2 cos2 1 = T2(cos)cos 3 = 4 cos3 3 cos = T3(cos)
Recurrence Relation:Tn+1(x) = 2xTn(x) Tn1(x) with T0(x) = 1, T1(x) = x
Proof: cos (n + ) + cos (n ) = 2 cos cosn
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
But cosn = Tn(cos): Chebyshev polynomial of 1st kind
cos 2 = 2 cos2 1 = T2(cos)cos 3 = 4 cos3 3 cos = T3(cos)
Recurrence Relation:Tn+1(x) = 2xTn(x) Tn1(x) with T0(x) = 1, T1(x) = x
Proof: cos (n + ) + cos (n ) = 2 cos cosn
So H() is an M2 order polynomial in cos: alternation theorem applies.
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
But cosn = Tn(cos): Chebyshev polynomial of 1st kind
cos 2 = 2 cos2 1 = T2(cos)cos 3 = 4 cos3 3 cos = T3(cos)
Recurrence Relation:Tn+1(x) = 2xTn(x) Tn1(x) with T0(x) = 1, T1(x) = x
Proof: cos (n + ) + cos (n ) = 2 cos cosn
So H() is an M2 order polynomial in cos: alternation theorem applies.
Example: Low-pass filter of length 5 (M = 4)
0 0.5 1 1.5 2 2.5 3 3.50
0.2
0.4
0.6
0.8
1
1.2
1.4
|
g
|
M=4
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
But cosn = Tn(cos): Chebyshev polynomial of 1st kind
cos 2 = 2 cos2 1 = T2(cos)cos 3 = 4 cos3 3 cos = T3(cos)
Recurrence Relation:Tn+1(x) = 2xTn(x) Tn1(x) with T0(x) = 1, T1(x) = x
Proof: cos (n + ) + cos (n ) = 2 cos cosn
So H() is an M2 order polynomial in cos: alternation theorem applies.
Example: Low-pass filter of length 5 (M = 4)
0 0.5 1 1.5 2 2.5 3 3.50
0.2
0.4
0.6
0.8
1
1.2
1.4
|
g
|
M=4
0 0.5 1 1.5 2 2.5 3
-15
-10
-5
0
|
g
|
(
d
B
)
M=4
-
Chebyshev Polynomials
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 4 / 11
H() = H(ej) = h[0] + 2M
2
1 h[n] cosn
But cosn = Tn(cos): Chebyshev polynomial of 1st kind
cos 2 = 2 cos2 1 = T2(cos)cos 3 = 4 cos3 3 cos = T3(cos)
Recurrence Relation:Tn+1(x) = 2xTn(x) Tn1(x) with T0(x) = 1, T1(x) = x
Proof: cos (n + ) + cos (n ) = 2 cos cosn
So H() is an M2 order polynomial in cos: alternation theorem applies.
Example: Low-pass filter of length 5 (M = 4)
0 0.5 1 1.5 2 2.5 3 3.50
0.2
0.4
0.6
0.8
1
1.2
1.4
|
g
|
M=4
0 0.5 1 1.5 2 2.5 3
-15
-10
-5
0
|
g
|
(
d
B
)
M=4
-1 -0.5 0 0.5 1
0
0.5
1
cos()
g
M=2
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
H() = h[0] + 2M
2
1 h[n] cosn
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
H() = h[0] + 2M
2
1 h[n] cosn= P (cos)
where P (x) is a polynomial of order M2 . 0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
H() = h[0] + 2M
2
1 h[n] cosn= P (cos)
where P (x) is a polynomial of order M2 . 0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
dHd
= P (cos) sin
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
H() = h[0] + 2M
2
1 h[n] cosn= P (cos)
where P (x) is a polynomial of order M2 . 0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
dHd
= P (cos) sin
= 0 at = 0, and at most M2 1 zeros of polynomial P(x).
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
H() = h[0] + 2M
2
1 h[n] cosn= P (cos)
where P (x) is a polynomial of order M2 . 0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
dHd
= P (cos) sin
= 0 at = 0, and at most M2 1 zeros of polynomial P(x).
With two bands, we have at most M2 + 3 maximal error frequencies.
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
H() = h[0] + 2M
2
1 h[n] cosn= P (cos)
where P (x) is a polynomial of order M2 . 0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
dHd
= P (cos) sin
= 0 at = 0, and at most M2 1 zeros of polynomial P(x).
With two bands, we have at most M2 + 3 maximal error frequencies.We require M2 + 2 of alternating signs for the optimal fit.
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
H() = h[0] + 2M
2
1 h[n] cosn= P (cos)
where P (x) is a polynomial of order M2 . 0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
dHd
= P (cos) sin
= 0 at = 0, and at most M2 1 zeros of polynomial P(x).
With two bands, we have at most M2 + 3 maximal error frequencies.We require M2 + 2 of alternating signs for the optimal fit.
Only three possibilities exist (try them all):(a) = 0 + two band edges + M2 1 zeros of P (x).(b) = + two band edges + M2 1 zeros of P (x).
-
Maximal Error Locations
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 5 / 11
Maximal error locations occur either at bandedges or when dH
d= 0
H() = h[0] + 2M
2
1 h[n] cosn= P (cos)
where P (x) is a polynomial of order M2 . 0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
1.2
|
H
|
M=18
dHd
= P (cos) sin
= 0 at = 0, and at most M2 1 zeros of polynomial P(x).
With two bands, we have at most M2 + 3 maximal error frequencies.We require M2 + 2 of alternating signs for the optimal fit.
Only three possibilities exist (try them all):(a) = 0 + two band edges + M2 1 zeros of P (x).(b) = + two band edges + M2 1 zeros of P (x).(c) = {0 and } + two band edges + M2 2 zeros of P (x).
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
2. Determine the error magnitude, , and the M2 + 1 coefficients ofthe polynomial that passes through the maximal error locations.
0 0.5 1 1.5 2 2.5 3
-0.5
0
0.5
1
1.5
|
g
|
M = 4Iteration 1
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
2. Determine the error magnitude, , and the M2 + 1 coefficients ofthe polynomial that passes through the maximal error locations.
3. Find the local maxima of the error function by evaluatinge() = s()
(H() d()
)on a dense set of .
0 0.5 1 1.5 2 2.5 3
-0.5
0
0.5
1
1.5
|
g
|
M = 4Iteration 1
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
2. Determine the error magnitude, , and the M2 + 1 coefficients ofthe polynomial that passes through the maximal error locations.
3. Find the local maxima of the error function by evaluatinge() = s()
(H() d()
)on a dense set of .
4. Update the maximal error frequencies to be an alternating subset ofthe local maxima + band edges + {0 and/or }.
0 0.5 1 1.5 2 2.5 3
-0.5
0
0.5
1
1.5
|
g
|
M = 4Iteration 1
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
2. Determine the error magnitude, , and the M2 + 1 coefficients ofthe polynomial that passes through the maximal error locations.
3. Find the local maxima of the error function by evaluatinge() = s()
(H() d()
)on a dense set of .
4. Update the maximal error frequencies to be an alternating subset ofthe local maxima + band edges + {0 and/or }.
If maximum error is > , go back to step 2.
0 0.5 1 1.5 2 2.5 3
-0.5
0
0.5
1
1.5
|
g
|
M = 4Iteration 1
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
2. Determine the error magnitude, , and the M2 + 1 coefficients ofthe polynomial that passes through the maximal error locations.
3. Find the local maxima of the error function by evaluatinge() = s()
(H() d()
)on a dense set of .
4. Update the maximal error frequencies to be an alternating subset ofthe local maxima + band edges + {0 and/or }.
If maximum error is > , go back to step 2.
0 0.5 1 1.5 2 2.5 3
-0.5
0
0.5
1
1.5
|
g
|
M = 4Iteration 1
0 0.5 1 1.5 2 2.5 3
0
0.5
1
|
g
|
M = 4Iteration 2
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
2. Determine the error magnitude, , and the M2 + 1 coefficients ofthe polynomial that passes through the maximal error locations.
3. Find the local maxima of the error function by evaluatinge() = s()
(H() d()
)on a dense set of .
4. Update the maximal error frequencies to be an alternating subset ofthe local maxima + band edges + {0 and/or }.
If maximum error is > , go back to step 2. (typically 15 iterations)
0 0.5 1 1.5 2 2.5 3
-0.5
0
0.5
1
1.5
|
g
|
M = 4Iteration 1
0 0.5 1 1.5 2 2.5 3
0
0.5
1
|
g
|
M = 4Iteration 2
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
2. Determine the error magnitude, , and the M2 + 1 coefficients ofthe polynomial that passes through the maximal error locations.
3. Find the local maxima of the error function by evaluatinge() = s()
(H() d()
)on a dense set of .
4. Update the maximal error frequencies to be an alternating subset ofthe local maxima + band edges + {0 and/or }.
If maximum error is > , go back to step 2. (typically 15 iterations)
0 0.5 1 1.5 2 2.5 3
-0.5
0
0.5
1
1.5
|
g
|
M = 4Iteration 1
0 0.5 1 1.5 2 2.5 3
0
0.5
1
|
g
|
M = 4Iteration 2
0 0.5 1 1.5 2 2.5 3
0
0.5
1
|
g
|
M = 4Iteration 3
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
2. Determine the error magnitude, , and the M2 + 1 coefficients ofthe polynomial that passes through the maximal error locations.
3. Find the local maxima of the error function by evaluatinge() = s()
(H() d()
)on a dense set of .
4. Update the maximal error frequencies to be an alternating subset ofthe local maxima + band edges + {0 and/or }.
If maximum error is > , go back to step 2. (typically 15 iterations)
0 0.5 1 1.5 2 2.5 3
-0.5
0
0.5
1
1.5
|
g
|
M = 4Iteration 1
0 0.5 1 1.5 2 2.5 3
0
0.5
1
|
g
|
M = 4Iteration 2
0 0.5 1 1.5 2 2.5 3
0
0.5
1
|
g
|
M = 4Iteration 3
-
Remez Exchange Algorithm
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 6 / 11
1. Guess the positions of the M2 + 2 maximal error frequencies and givealternating signs to the errors (e.g. choose evenly spaced ).
2. Determine the error magnitude, , and the M2 + 1 coefficients ofthe polynomial that passes through the maximal error locations.
3. Find the local maxima of the error function by evaluatinge() = s()
(H() d()
)on a dense set of .
4. Update the maximal error frequencies to be an alternating subset ofthe 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].
0 0.5 1 1.5 2 2.5 3
-0.5
0
0.5
1
1.5
|
g
|
M = 4Iteration 1
0 0.5 1 1.5 2 2.5 3
0
0.5
1
|
g
|
M = 4Iteration 2
0 0.5 1 1.5 2 2.5 3
0
0.5
1
|
g
|
M = 4Iteration 3
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1:Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1:Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
In step 3, evaluate H() = h[0] + 2M
2
n=1 h[n] cosni
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1: (Computation time M3)Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
In step 3, evaluate H() = h[0] + 2M
2
n=1 h[n] cosni
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1: (Computation time M3)Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
In step 3, evaluate H() = h[0] + 2M
2
n=1 h[n] cosni
Method 2: Dont calculate h[n] explicitlyMultiply equations by ci =
j 6=i
1cosicosj
and add:M2+2
i=1 ci
(h[0] + 2
M2
n=1 h[n] cosn +(1)is(i)
)=M
2+2
i=1 cid(i)
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1: (Computation time M3)Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
In step 3, evaluate H() = h[0] + 2M
2
n=1 h[n] cosni
Method 2: Dont calculate h[n] explicitlyMultiply equations by ci =
j 6=i
1cosicosj
and add:M2+2
i=1 ci
(h[0] + 2
M2
n=1 h[n] cosn +(1)is(i)
)=M
2+2
i=1 cid(i)
All terms involving h[n] sum to zero leavingM2+2
i=1(1)icis(i)
=M
2+2
i=1 cid(i)
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1: (Computation time M3)Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
In step 3, evaluate H() = h[0] + 2M
2
n=1 h[n] cosni
Method 2: Dont calculate h[n] explicitlyMultiply equations by ci =
j 6=i
1cosicosj
and add:M2+2
i=1 ci
(h[0] + 2
M2
n=1 h[n] cosn +(1)is(i)
)=M
2+2
i=1 cid(i)
All terms involving h[n] sum to zero leavingM2+2
i=1(1)icis(i)
=M
2+2
i=1 cid(i)
Solve for
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1: (Computation time M3)Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
In step 3, evaluate H() = h[0] + 2M
2
n=1 h[n] cosni
Method 2: Dont calculate h[n] explicitlyMultiply equations by ci =
j 6=i
1cosicosj
and add:M2+2
i=1 ci
(h[0] + 2
M2
n=1 h[n] cosn +(1)is(i)
)=M
2+2
i=1 cid(i)
All terms involving h[n] sum to zero leavingM2+2
i=1(1)icis(i)
=M
2+2
i=1 cid(i)
Solve for then calculate the H(i)
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1: (Computation time M3)Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
In step 3, evaluate H() = h[0] + 2M
2
n=1 h[n] cosni
Method 2: Dont calculate h[n] explicitlyMultiply equations by ci =
j 6=i
1cosicosj
and add:M2+2
i=1 ci
(h[0] + 2
M2
n=1 h[n] cosn +(1)is(i)
)=M
2+2
i=1 cid(i)
All terms involving h[n] sum to zero leavingM2+2
i=1(1)icis(i)
=M
2+2
i=1 cid(i)
Solve for then calculate the H(i) then use Lagrange interpolation:H() = P (cos) =
M2+2
i=1 H(i)
j 6=icoscosjcosicosj
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1: (Computation time M3)Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
In step 3, evaluate H() = h[0] + 2M
2
n=1 h[n] cosni
Method 2: Dont calculate h[n] explicitlyMultiply equations by ci =
j 6=i
1cosicosj
and add:M2+2
i=1 ci
(h[0] + 2
M2
n=1 h[n] cosn +(1)is(i)
)=M
2+2
i=1 cid(i)
All terms involving h[n] sum to zero leavingM2+2
i=1(1)icis(i)
=M
2+2
i=1 cid(i)
Solve for then calculate the H(i) then use Lagrange interpolation:H() = P (cos) =
M2+2
i=1 H(i)
j 6=icoscosjcosicosj(
M2 + 1
)-polynomial going through all the H(i) [actually order M2 ]
-
Determine Polynomial
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 7 / 11
For each extremal frequency, i for 1 i M2 + 2
d(i) = H(i) +(1)is(i)
= h[0] + 2M
2
n=1 h[n] cosni +(1)is(i)
Method 1: (Computation time M3)Solve M2 + 2 equations in
M2 + 2 unknowns for h[n] + .
In step 3, evaluate H() = h[0] + 2M
2
n=1 h[n] cosni
Method 2: Dont calculate h[n] explicitly (Computation time M2)Multiply equations by ci =
j 6=i
1cosicosj
and add:M2+2
i=1 ci
(h[0] + 2
M2
n=1 h[n] cosn +(1)is(i)
)=M
2+2
i=1 cid(i)
All terms involving h[n] sum to zero leavingM2+2
i=1(1)icis(i)
=M
2+2
i=1 cid(i)
Solve for then calculate the H(i) then use Lagrange interpolation:H() = P (cos) =
M2+2
i=1 H(i)
j 6=icoscosjcosicosj(
M2 + 1
)-polynomial going through all the H(i) [actually order M2 ]
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1],
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2Stopband Attenuation: 25 dB and 15 dB
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2Stopband Attenuation: 25 dB and 15 dBPassband Ripple: 0.3 dB
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2Stopband Attenuation: 25 dB and 15 dBPassband Ripple: 0.3 dB
Determine gain tolerances for each band:25 dB = 0.056, 0.3 dB = 1 0.034, 15 dB = 0.178
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2Stopband Attenuation: 25 dB and 15 dBPassband 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
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2Stopband Attenuation: 25 dB and 15 dBPassband 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 = 36M2 + 2 extremal frequencies are distributed between the bands
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2Stopband Attenuation: 25 dB and 15 dBPassband 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 = 36M2 + 2 extremal frequencies are distributed between the bands
Filter meets specs ,
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2Stopband Attenuation: 25 dB and 15 dBPassband 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 = 36M2 + 2 extremal frequencies are distributed between the bands
Filter meets specs ,; clearer on a decibel scale
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
0 0.5 1 1.5 2 2.5 3-30
-25
-20
-15
-10
-5
0
|
H
|
(
d
B
)
M=36
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2Stopband Attenuation: 25 dB and 15 dBPassband 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 = 36M2 + 2 extremal frequencies are distributed between the bands
Filter meets specs ,; clearer on a decibel scaleMost zeros are on the unit circle + three reciprocal pairs
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
0 0.5 1 1.5 2 2.5 3-30
-25
-20
-15
-10
-5
0
|
H
|
(
d
B
)
M=36
-1 0 1 2
-1
-0.5
0
0.5
1
-
Example Design
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 8 / 11
Filter Specifications:Bandpass = [0.5, 1], Transition widths: = 0.2Stopband Attenuation: 25 dB and 15 dBPassband 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 = 36M2 + 2 extremal frequencies are distributed between the bands
Filter meets specs ,; clearer on a decibel scaleMost zeros are on the unit circle + three reciprocal pairs
Reciprocal pairs give a linear phase shift
0 0.5 1 1.5 2 2.5 30
0.2
0.4
0.6
0.8
1
|
H
|
M=36
0 0.5 1 1.5 2 2.5 3-30
-25
-20
-15
-10
-5
0
|
H
|
(
d
B
)
M=36
-1 0 1 2
-1
-0.5
0
0.5
1
-
FIR Pros and Cons
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 9 / 11
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(ej0) = H(ej) = 0 symmetry means you only need M2 + 1 multiplications
to implement the filter.
-
FIR Pros and Cons
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 9 / 11
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(ej0) = H(ej) = 0 symmetry means you only need M2 + 1 multiplications
to implement the filter.
Always stable ,
-
FIR Pros and Cons
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 9 / 11
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(ej0) = H(ej) = 0 symmetry means you only need M2 + 1 multiplications
to implement the filter.
Always stable ,
Low coefficient sensitivity ,
-
FIR Pros and Cons
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 9 / 11
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(ej0) = H(ej) = 0 symmetry means you only need M2 + 1 multiplications
to implement the filter.
Always stable ,
Low coefficient sensitivity ,
Optimal design method fast and robust ,
-
FIR Pros and Cons
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 9 / 11
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(ej0) = H(ej) = 0 symmetry means you only need M2 + 1 multiplications
to implement the filter.
Always stable ,
Low coefficient sensitivity ,
Optimal design method fast and robust ,
Normally needs higher order than an IIR filter / Filter order M dBatten3.5 where is the most rapid transition
-
FIR Pros and Cons
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 9 / 11
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(ej0) = H(ej) = 0 symmetry means you only need M2 + 1 multiplications
to implement the filter.
Always stable ,
Low coefficient sensitivity ,
Optimal design method fast and robust ,
Normally needs higher order than an IIR filter / Filter order M dBatten3.5 where is the most rapid transition
Filtering complexity M fs dBatten3.5 fs =dBatten3.5f
2s
f2s for a given specification in unscaled units.
-
Summary
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
-
Summary
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin different frequency bands
-
Summary
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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 Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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 Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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: M2 + 2 maximal errors with alternating signs
-
Summary
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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: M2 + 2 maximal errors with alternating signs
Remez Exchange Algorithm (also known as Parks-McLellan Algorithm)
-
Summary
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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: M2 + 2 maximal errors with alternating signs
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 Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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: M2 + 2 maximal errors with alternating signs
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 Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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: M2 + 2 maximal errors with alternating signs
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 M2
-
Summary
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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: M2 + 2 maximal errors with alternating signs
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 M2 can go mad in the transition regions
-
Summary
7: Optimal FIR filters Optimal Filters Alternation Theorem Chebyshev Polynomials Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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: M2 + 2 maximal errors with alternating signs
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 M2 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 Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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: M2 + 2 maximal errors with alternating signs
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 M2 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 Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 10 / 11
Optimal Filters: minimax error criterion
use weight function, s(), to allow different errorsin 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: M2 + 2 maximal errors with alternating signs
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 M2 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 Maximal Error Locations Remez ExchangeAlgorithm Determine Polynomial Example Design FIR Pros and Cons Summary MATLAB routines
DSP and Digital Filters (2014-5490) Optimal FIR: 7 11 / 11
firpm optimal FIR filter designfirpmord estimate require order for firpmcfirpm arbitrary-response filter designremez [obsolete] optimal FIR filter design
7: Optimal FIR filtersOptimal FiltersAlternation TheoremChebyshev PolynomialsMaximal Error LocationsRemez Exchange AlgorithmDetermine PolynomialExample DesignFIR Pros and ConsSummaryMATLAB routines