  The Parks-McClellan algorithm provides an efficient method for designing a
linear phase FIR filter with a pre-specified weight function on the
approximation error. For the given filter order and the specified weight
function, the filter designed with this algorithm will have the unique optimal
frequency response that approximates a desired filter response as certified by
the alternation theorem. In this paper, a nonlinear phase FIR filter design
algorithm is provided that allows the specification of a piecewise constant
weight function on the approximation error in an analogous manner to linear
phase FIR filters. For the given filter order and weight function, the
resulting filter will provably have the unique optimal magnitude response that
approximates a desired filter response, where the certification of optimality
is given and is also based on the alternations that the weighted error function
exhibits. Furthermore, the method is applicable to designing filters with both
real- and complex-valued coefficients, which in turn determines the number of
required alternations.
