For many lowpass filter designs the peak passband excursion δ1δ1
exceeds the peak stopband excursion δ2δ2 by a factor of ten or more.
This ratio, earlier denoted as the weight WW, was just evaluted
in the previous section to have the
value 28.8 for a typical set of specifications.
In this example the stopband attenuation specification drives the required
filter order. In this case, and with a few additional assumptions which
will be enumerated later, the
number of coefficients in the impulse response of a high-order
FIR linear phase filter, denoted NN, can be accurately estimated using the
formula:
N
≈
α
f
s
Δ
f
,
N
≈
α
f
s
Δ
f
,
(1)
where the design parameter αα is given by the equation:
α
=
0
.
22
+
0
.
0366
·
S
B
R
.
α
=
0
.
22
+
0
.
0366
·
S
B
R
.
(2)
As before, SBR is the minimum stopband attenuation compared to the
nominal passband power transmission level, measured in decibels.
Suppose as before that the lowpass
filter of interest is to have a peak-to-peak passband ripple (PBR) of 0.5 dB and
a minimum stopband attenuation of 60 dB. Since WW has been evaluated to be
approximately 29 in this case, Equation 1 applies. Using
Equation 2, αα is evaluated to be 2.42. Thus
NN is closely approximated by 2.42 times the reciprocal of the normalized
transition bandwidth ΔffsΔffs.
To continue the example assume that the sampling rate is 8 kHz, that
the cutoff frequency fcfc is 1530 Hz, and that the stopband edge fstfst
is 2330 Hz. Thus Δf=800Δf=800 Hz and Δffs=0.1Δffs=0.1,
yielding an estimated filter order NN of approximately 24.
Executing the Parks-McClellan design program with these
parameters happens to produce an impulse response which almost perfectly
matches the desired result (e.g., peak stopband ripple of 60.07 dB as
opposed to the stated objective of 60 dB).♠♠
Note that the required filter order NN as estimated by
Equation 1 and Equation 2 does not depend on
the passband ripple PBR or on the exact values of the cutoff and stopband
frequencies. Thus, when the conditions allowing the underlying assumptions to
be met are true, estimating the required filter order NN becomes very easy.
Table 1 provides the values of the design parameter αα
from Equation 2
for various degrees of stopband suppression. Given also is the range of
the passband ripple for which the values of αα apply. The
column marked maximum passband ripple reflects the the assumption that
the passband deviation δ1δ1 is small compared to unity;
specifically, the stated value of 1.74 dB corresponds
to δ1=0.1δ1=0.1. The rightmost column, denoted minimum
passband ripple, is the limit imposed by the assumption that
δ1>10·δ2δ1>10·δ2. Of course FIR linear phase equal ripple
filters can be designed with passband ripple extending beyond the stated range.
However, as the PBR specification approaches either of these endpoints the
validity of Equation 2 will degrade. The predicted filter length
will err on the low side for small PBR values and be overly pessimistic for
PBR >> 1.74 dB. In such cases, an iteration on design might be necessary to
obtain the desired filter characteristics.
Table 1: Values of the Design Parameter α as a Function of the Minimum Stopband Attenuation
| Stopband Attenuation (in dB) |
α
α
|
Maximum Passband Ripple (in dB) |
Minimum
Passband Ripple (in dB) |
| 45 |
1.87 |
1.74 |
1.0 |
| 50 |
2.05 |
1.74 |
0.55 |
| 55 |
2.23 |
1.74 |
0.31 |
| 60 |
2.42 |
1.74 |
0.174 |
| 65 |
2.60 |
1.74 |
0.098 |
| 70 |
2.78 |
1.74 |
0.055 |
This section describes the theoretical underpinnings of
Equation 1 and Equation 2. A clear understanding of this
section is not required to use the Parks-McClellan software routines or
to enjoy the remainder of this technical note.
As discussed in Section 2, the Parks-McClellan synthesis algorithm uses the
Remez exchange algorithm to optimally select the values of the NN impulse
response coefficients in such a way as to minimize the weighted peak difference
between the desired magnitude frequency response and the actual one. Since
the solution to this optimization problem does not have a closed form, it is
not easy to generalize its properties. To learn about its properties and to
develop appropriate design rules, McClellan, Rabiner, and others synthesized
thousands of filters and measured their properties. Curves with this sort of
information are presented in [1], along with a complicated empirical formula for
the filter order NN in terms of all of the parameters specifying the filter.
While this work is not immediately useful for design work, a limiting case
uncovered by those workers does provide some insight into the optimal
filter solutions and leads to the simple rules compressed into
Equation 1 and Equation 2.
Suppose we desire to design a high-order, FIR, linear phase filter for
which the passband is as narrow as possible. Looking again at
Figure 1 from the module titled "Statement of the Optimal Linear Phase FIR Filter Design Problem"
with this in mind reveals that all of
the ripple behavior for such a filter will occur in the stopband. Such
a filter, or a very close approximation to it, can be synthesized using
another FIR filter design method, that of multiplying a
sampled sinqqsinqq function, where q=πffsq=πffs,
by an NN-point window function
constructed from a Chebyshev polynomial.
The sampled sinqqsinqq, or sinc, function is the inverse z-transform
of a perfect lowpass filter. It cannot be used directly since it extends
infinitely far into both forward and backward time. A finite duration
impulse response is obtained by multiplying the “perfect" response by
a finite-duration window function. The one discussed here uses Chebyshev
polynomials as their basis.
These polynomials are discussed in
Appendix B
They all have the property that the polynomials'
peak magnitude is unity for values of xx between -1 and 1, and that for
greater values of |x||x|, the magnitude grows as xMxM where MM is the order
of the polynomial. One such polynomial is shown in Figure 1.
We desire that the oscillatory portion of the polynomial correspond to the
stopband region of the filter response and the xMxM portion to correspond
to the transition from the stopband to the passband. This is accomplished by
invoking a change of variables relating xx to the frequency ff. The
resulting equation is then evaluated at the several points to obtain an
expression for the transition bandwidth ΔfΔf. The details of this
manipulation are contained in Appendix C.
They result
in the following equation:
Δ
f
=
f
s
π
(
N
-
1
)
[
c
o
s
h
-
1
(
1
+
δ
1
δ
2
)
-
{
(
c
o
s
h
-
1
(
1
+
δ
1
δ
2
)
)
2
-
(
c
o
s
h
-
1
(
1
-
δ
1
δ
2
)
)
2
}
1
2
]
.
Δ
f
=
f
s
π
(
N
-
1
)
[
c
o
s
h
-
1
(
1
+
δ
1
δ
2
)
-
{
(
c
o
s
h
-
1
(
1
+
δ
1
δ
2
)
)
2
-
(
c
o
s
h
-
1
(
1
-
δ
1
δ
2
)
)
2
}
1
2
]
.
(3)
If δ1δ1 is small compared to unity and NN is large
compared to unity, as already assumed, then ΔfΔf is closely
approximated by
Δ
f
=
f
s
π
N
(
c
o
s
h
-
1
(
1
δ
2
)
)
.
Δ
f
=
f
s
π
N
(
c
o
s
h
-
1
(
1
δ
2
)
)
.
(4)
When the argument of the hyperbolic cosine is large, the
function can be approximated as
1
δ
2
=
c
o
s
h
y
≈
e
y
2
1
δ
2
=
c
o
s
h
y
≈
e
y
2
(5)
With suitable manipulation we find that
y
≈
l
o
g
e
2
δ
2
=
l
o
g
e
2
-
l
o
g
e
δ
2
.
y
≈
l
o
g
e
2
δ
2
=
l
o
g
e
2
-
l
o
g
e
δ
2
.
(6)
Substituting this expression for the inverse hyperbolic cosine
yields a simple formula for ΔfΔf:
Δ
f
=
f
s
π
N
(
l
o
g
e
2
-
l
o
g
e
δ
2
)
.
Δ
f
=
f
s
π
N
(
l
o
g
e
2
-
l
o
g
e
δ
2
)
.
(7)
Rewriting this equation shows that NN must equal or exceed:
N
≥
α
f
s
Δ
f
N
≥
α
f
s
Δ
f
(8)
where αα is given by
α
=
l
o
g
e
2
-
l
o
g
e
δ
2
π
.
α
=
l
o
g
e
2
-
l
o
g
e
δ
2
π
.
(9)
Rewriting equation 4 from the module titled "Statement of the Optimal Linear Phase FIR Filter Design Problem", δ2δ2 can be written as
δ
2
=
10
-
S
B
R
20
=
e
-
2
.
303
·
S
B
R
20
.
δ
2
=
10
-
S
B
R
20
=
e
-
2
.
303
·
S
B
R
20
.
(10)
Substituting this into Equation 9 yields
α
=
0
.
22
+
0
.
0366
·
S
B
R
,
α
=
0
.
22
+
0
.
0366
·
S
B
R
,
(11)
which can be recognized as Equation 2.
The derivation just presented assumes that the filter of interest is a
lowpass design, the filter order is high (>20>20 or
so), that the passband ripple is small (that δ1≪1δ1≪1), and that
the filter uses all degrees of freedom except one in the stopband, that is,
that the filter has the lowest possible cutoff frequency. In fact not all of
these conditions have to be met to make the design Equation 1
and Equation 2 useful. An indication of how errors can enter the
estimate of NN under other conditions can be seen, however, by examining
Figure 2.
This figure shows the smallest value of ΔfΔf attainable with optimal
equal-ripple linear phase filters of different lengths as a function of the
cutoff frequency fcfc. Equation 1 and Equation 2
predict that the transition bandwidth is constant as a function of cutoff
frequency and that it always gets smaller as the filter order NN increases.
Figure 2 shows that these generalities are not true. It can
be seen that ΔfΔf varies somewhat as a function of fcfc and that
there are particular choices of fcfc where a lower value of ΔfΔf is
actually attainable with a lower filter order rather than a higher one.
It would appear that, for a given filter order NN, some values of fcfc
are “hard" to attain a small transition bandwidth and others are “easy".
This is in fact true and the reason for it will be discussed in
"Why does alpha Depend on the Cutoff Frequency fc?".
While Figure 2 shows that ΔfΔf is not truly
independent of the cutoff frequency fcfc and monotonic in the
filter order NN, the significant variations appear only for low filter
orders. If NN is greater than 20 or so, and the other conditions listed
above hold true, as they usually do, then Equation 1
and Equation 2 can be used with impugnity, even for highpass
and bandpass filters.