1 log(x+2.005)

 4.2, with 22-bit (21 bits for the fractional part) filter taps. The top row corresponds to the situation before any basis reduction algorithm was applied, whereas the bottom row shows the effect of LLL reduction. BKZ (with block size β = 8) and HKZ reductions give very similar results, which is why they are not shown.

A grid of n + 2 equispaced points inside the convex hull of X was used. . . . . . . . . . . . 80 4.8 Stopband attenuation for the minimax design of a given lowpass specification, alongside the 16-bit fixed-point designs of the error shaped approach and our LLL-based algorithm. . . . and last iteration). The starting reference set is computed using uniform intialization. . . . 3.8 Lebesgue constant evolution when the reference scaling approach described in Section 3.6 is used. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9 Lebesgue constant evolution when the AFP-based approach described in Section 3.6 is used. 3.10 Relative error of h k with respect to δ X for Example 3.18, n = 100. . . . . . . . . . . . . . . 3.11 Relative error of h k with respect to δ X for Example 3.19, n = 100. . . . . . . . . . . . . . . 3.12 Runtime (real time) comparisons of our IEEE-754 double-precision implementation of the second Remez algorithm with those available in GNURadio 3.7.8.1 (also written in C++), MATLAB R2014b, the one from SciPy 0.16.1 (python code) and two other MATLAB implementations. The same machine, a quad core 3.6 GHz 64-bit Intel Xeon(R) E5-1620 running Linux 4.1.12 (15.9), was used for all the tests. The average execution times (in seconds) of running each piece of code 50 times, are given. When a routine did not converge to the minimax result, NC was used in place of the execution time. The a/b entries in the last column correspond to the two implementations described in [START_REF] Ahsan | Two Novel Implementations of the Remez Multiple Exchange Algorithm for Optimum FIR Filter Design[END_REF]. . . . . . . . . . . . . . 3.13 Timings (real time) showing the effect of running our code with different options. As for Table 3.12, the numerical values represent the averages in seconds over 50 executions. For the first seven lines, the double-precision version of our routine was used, while for the last one long double 80-bit operations were carried out. In all cases, our code was compiled using g++5.

Notation

N

The set of natural numbers {0, 1, . . .}.

N

The set of natural numbers, without 0: {1, 2, . . .}.

Z

The set of integers {. . . , -2, -1, 0, 1, 2, . . .}.

R

The set of real numbers.

C

The set of complex numbers.

R[x]

The set of univariate polynomials with real coefficients.

R n [x]
The set of univariate polynomials with real coefficients of degree at most n.

R n [x 1 , . . . , x d ]
The set of d-variate polynomials with real coefficients of degree at most n.

C(X)

The set of all continuous functions over the set X. sgn(x)

The sign function: returns 1 if x > 0, -1 if x < 0 and is undefined if x = 0. a Small bold letters are used to represent column vectors.

A

Capital bold letters are used to represent matrices.

A t

The transpose of the matrix A. A

The conjugate transpose of the matrix A (i.e., A t ).

diag(a)

The diagonal matrix whose diagonal is formed by taking the elements of a. ker(A)

The kernel of the matrix A, that is, the set of vectors x for which Ax = 0. L 2 ([a, b], w(x), dx) The space of square-integrable functions on [ This is a thesis about univariate minimax approximation problems, most of which are derived from applications found in Digital Signal Processing (more specifically digital filter design). The focus is on the study and improvement of existing algorithmic solutions for these problems, together with corresponding implementations which are robust and convenient to use in practice.

A central topic of Approximation Theory is the constructive approximation of functions, which broadly speaking, revolves around the idea of replacing a given function f by a simpler one, having values which are not necessarily identical, but very close (with respect to an established error measure) to those of f . The ultimate goal of doing this is to have the ability to manipulate and answer nontrivial questions about the nature of f in a numerical context, where computational resources are finite. Having mathematically sound and computationally efficient algorithms to work with such proxies of f is hence crucial.

Choosing from a particular class P of functions a proxy for f raises some natural questions, both from a theoretical and practical implementation point of view:

• Does f have a best approximation (according to a given optimality criterion) p ∈ P and is it algorithmically feasible to compute it?

• Consider P to be a finite dimensional vector space, for instance R n [x]. Then, if p exists, let us represent it in a particular basis {ϕ 0 , . . . , ϕ n } of R n [x] (i.e., p (x) = n k=0 a k ϕ k (x) is completely determined by a 0 , . . . , a n ∈ R). Since real numbers inside computers usually require that they be approximated by values from a finite set, how does this impact the quality of the approximation we will actually use?

Here are some concrete examples used throughout the text where such questions are relevant. An important constant in all of them are the Chebyshev polynomials of the first kind (treated in more detail in Section 2.1), which are the elements of R[x] defined by the recurrence T 0 (x) = 1, T 1 (x) = x, T n (x) = 2xT n-1 (x) -T n-2 (x), n 2.

(1.1) (i) For n = 62, determine p ∈ R n [x] expressed in the basis {T i } 0 i n , such that for X = [-1, cos(0.84π)]∪ [cos(0.68π), cos(0.4π)] ∪ [cos(0.24π), 1]

f (x) = 1,
x ∈ [-1, cos(0.84π)] ∪ [cos(0.24π), 1], 0, x ∈ [cos(0.68π), cos(0.4π)], and w(x) = 1, the weighted error δ = max x∈X |w(x)(f (x)p (x))| is minimal. What happens when we want the Chebyshev coefficients of our approximation to be stored using 21-bit wide fixed-point numbers? Can we still determine an optimal result efficiently?

Numerically, getting an approximation that is close to p in this case is not considered to be very complicated, with numerical software packages like MATLAB (their firpm command) having no problem outputting a result that would be qualified as good in practice. The default function call is [h, err]=firpm(124, [0.0 0.24 0.4 0.68 0.84 1.0], [1 1 0 0 1 1], [1 1 1]);

The approximation to δ it outputs (the err variable) is about 1.2538 • 10 -2 , which, based on computations we do with our own tools from Ch. 3, only seems to be accurate to two decimal digits (the actual δ is closer to 1.2785 • 10 -2 ). This is due mainly to the fact that the firpm command works on a discretized version of X containing about 11 • 62 = 682 points, instead of the actual domain. If we increase the discretization size by about a factor of four, meaning we execute [h, err]=firpm(124, [0.0 0.24 0.4 0.68 0.84 1.0], [1 1 0 0 1 1], [1 1 1], {68}); four digits of accuracy are now available at the cost of doubling the computation time; the two calls took about 0.13s and 0.27s in MATLAB R2014B on my Linux machine equipped with an Intel i7-3687U CPU.

On the other hand, adding fixed-point format constraints on the polynomial coefficients complicates the problem considerably and a guaranteed optimal result is computationally hard to find, particularly in this case. The optimistic approach would then be to try and determine a quasi-optimal approximation in a short amount of time. For instance, using the tools in Ch. 4 we were able to obtain an approximation with error 1.56 • 10 -6 , better than the best previously reported error 2.06 • 10 -6 , computed under the same constraints [START_REF] Kodek | Telescoping rounding for suboptimal finite wordlength FIR digital filter design[END_REF]. Whereas for (i) we stated that determining a sufficiently close approximation to p ∈ R n [x] is considered to be easy, this turns out to be much more difficult for (ii) using current software tools 1 , in large part due to the large degree we are considering. We shall see however that most of the numerical issues that are characteristic to such problems can be alleviated (see Ch. 3). Both (i) and (ii) are examples of (weighted) polynomial approximation questions that are specific to digital filter design (they give rise to a class of systems known as finite impulse response filters or FIR for short), an important branch of digital signal processing. They are very much the kind of problems that have motivated most of the work discussed in this text.

As an engineering discipline, digital signal processing is at the core of our modern digital world, enabling many of the communication technologies we are beginning to take for granted (one example is high-speed wireless data transmissions), medical devices used to diagnose and treat patients (examples include digital X-ray machines and digital hearing aid equipment) and can even be used to better understand and predict financial trends. Digital filtering becomes important when, for instance

• the data (i.e., the signals) we have to process is inaccurate (the errors present in measured data are usually called noise in signal processing parlance) and we want, at least to a certain extent, to limit their impact (a classic example is noise cancellation in audio transmissions);

• in a more general setting, the signals we must process and interpret are saturated with more information than we actually need and some way of filtering out the non-required parts is desirable.

1 MATLAB's firpm failed at the start of execution.

The information regarding univariate digital filtering we will need in this text is presented in Sec. 2.2.

(iii) Consider the approximation of f (x) = e x over x ∈ (-∞, 0] by rational functions with real coefficients of the same numerator and denominator degree n. For a fixed n, can we readily compute a degree (n, n) rational approximant r such that max x 0 |f (x)r (x)| is (very close to) minimal?

This example is rather different than the first two and it is meant to give an idea of the kind of problems polynomials are not really suited for (in this case approximating a function with finite range over an unbounded domain). Rational approximation of the exponential function over (-∞, 0] was first looked at in a systematic manner by Cody, Meinardus and Varga [START_REF] Cody | Chebyshev rational approximations to e -x in [0, +∞) and applications to heat-conduction problems[END_REF] and has since been studied by quite a number of people, both for theoretical and practical reasons. Such approximations prove useful for instance when trying to find numerical solutions to stiff partial differential equations (see for instance [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 23] and the references therein). We shall answer the question posed by this example in Ch. [START_REF] Ahsan | Two Novel Implementations of the Remez Multiple Exchange Algorithm for Optimum FIR Filter Design[END_REF]. Digital filters that map to rational approximation problems are also common and are known as infinite impulse response filters (IIR).

Our goal in this thesis is to, first of all, look at the existing algorithmic approaches used to solve problems like those given in (i)-(iii) and understand their strengths and limitations. Where possible, we try to introduce ideas that lead to more robust and efficient algorithms. Because of this, scalability of our approaches was always a big and constant driving factor if we ever planned to deal with such problems as those posed by (ii) or other practical instances where large degree polynomial approximations are needed.

As a result, the content of this text is a mix of numerical and symbolic ideas, used to build arithmetic algorithms. The most obvious thing that individualizes our work is the heavy focus on signal processing and digital filter design issues. What we get in the end is, we believe, an interesting and efficient blend of approaches mixing approximation theory, computer arithmetic, algorithmic number theory and digital signal processing.

Of course, we should always strive to walk the talk. That is why all the approaches described in the sequel come with open-source implementations which are available for testing. In the long run, we hope to integrate each of them in a more complete package for FIR and IIR filter design and synthesis.

Let us begin by formulating the approximation problems we wish to deal with in a more rigorous setting and outline what our contributions are in addressing them.

Minimax approximation -outline of the thesis

An approximation problem, as built by the examples in the previous paragraphs, consists of three major components:

• An element f to approximate that will belong to a function class Θ, which usually is a vector space (or linear space). We will only consider real functions of one real variable when discussing applications (although some of the theoretical results are also valid in multivariate settings). At the lowest level, we will be considering functions continuous on a certain compact subset X of R, which we will henceforth denote by C(X). When extra properties for Θ are required, they will be explicitly stated.

• The type of approximation (i.e., from what P) we are searching for. We will be considering mainly spaces of polynomials and to a slightly lesser extent, those of certain rational functions. In both contexts, these types will be subspaces of Θ.

• A norm which will be used to measure the quality of a certain approximation to f . When not referring to a particular norm, we will denote it with • . The closeness of a certain approximation p to f will then be measured by the scalar quantity fp .

Definition 1.1. Let V be a R-vector space. A norm • on V is any map from V to the non-negative real numbers which verifies the axioms:

1. v 0, with equality if and only if v = 0;

2. u + v u + v (the triangle inequality);

3. αu = |α| u , for any scalar α.

There are several standard choices of norms which are used in practice, with two of the most popular ones being:

-L ∞ norm (also known as uniform, minimax or Chebyshev norm).

f ∞,X = sup x∈X |f (x)| ;
-L 2 norm (also known as least-squares or Euclidean norm).

f 2,X = X (f (x)) 2 w(x)dx,
where w ∈ C(X) is a weight function which is positive almost everywhere. 2 .

As the title of the manuscript suggests, our focus will be on L ∞ problems, but L 2 results and ideas will also play an important role in our discussions. By settling on a norm, the question of what a best approximation to f is [START_REF] Mason | Chebyshev polynomials[END_REF]Def. 3.2]: Definition 1.2 (ε-good, best and near-best approximations).

• An element p ∈ P is said to be ε-good if fp ε, where ε is a prescribed target accuracy.

• An element p ∈ P is said to be best if, for any other p ∈ P, fp fp . A best approximation is not necessarily unique.

• An element p ∈ P is said to be near-best within a relative distance ρ if, fp (1 + ρ) fp , where p is a best approximation to f from P.

All three types of approximations from Definition 1.2 play a role in practice. An example is the filter synthesis flow we consider in Ch. 5; the problems are initially posed in terms of ε-good polynomial approximations with real coefficients that satisfy certain error constraints. Also, it seems natural to try and compute ideal mathematical objects such as best approximations, as we will do in Ch. [START_REF] Achieser | Theory of Approximation[END_REF]. And yet, best approximations are, apart from certain situations, very hard or impossible to compute exactly due to the finite nature of machine representable numerical formats. We are, in fact, forced to use near-best approximations with ρ close to zero (hopefully!), as we will exemplify in Ch. 4; near-best approximations also appear at each iteration of the algorithms of Ch. 3.

An application domain for minimax approximations we have not mentioned yet is that of implementing elementary mathematical functions for the design of mathematical libraries (like C's libm). We shall not mention them much in this text and instead refer the reader to the in-depth presentation made by Sylvain Chevillard in his PhD thesis [START_REF] Chevillard | Évaluation efficace de functions numériques[END_REF].

Our main contributions, summarized over the next paragraphs, concentrate on providing efficient algorithmic solutions that deal with weighted minimax polynomial approximation problems over multiinterval domains, starting from initial specification and going on to actual hardware synthesis of the final result (the entirety of Chapters 3-5). The signal processing applications of such problems run very deep, and a considerable amount of work went into "filtering" the sometimes overwhelmingly large engineering literature on the subject.

Weighted minimax polynomial approximation on compact subsets of R

Chapter 3 looks at the problem of determining best weighted polynomial approximations with real coefficients in the L ∞ setting. We perform a thorough study of so-called exchange algorithms (a classic topic in approximation theory literature and one which represents the "workhorse of digital filter design methods" [START_REF] Yang | Ultra-wideband communications: an idea whose time has come[END_REF]) that allow us to iteratively compute near-best approximations of increasingly better quality, converging to the best approximation (i.e., ρ → 0). For practical purposes, these approximations will be almost indistinguishable from the best ones, which is why we will also use the term minimax when referring to them, even though most of the time it will not be theoretically accurate. As it will quickly become apparent, the practical difficulties with implementing such algorithms in the filter design setting are very closely linked to the multi-interval nature of the approximation domain X. Despite the immense engineering literature on the exchange algorithm (see Section 3.5 for a comprehensive review of the state of the art regarding this), current implementations are not as robust as they could be, a fact we intend to change.

We introduce effective heuristics for initializing such algorithms in practice, ones which work extremely well even for problems when the target degree n is in the order of tens of thousands. While analyzing their impact, we also perform a thorough discussion on how one should diagnose, debug, but most of all, avoid numerical problems in polynomial exchange routines.

Machine-efficient weighted minimax FIR filter design

Chapter 4 takes into account the fact that the polynomial (and filter) coefficients will need to be represented using machine number (finite precision) coefficients (a problem known as coefficient quantization in the filter design literature). When these formats are small (as is frequently the case with applications targeting for example embedded circuits), they can have a huge impact on the quality of the approximation error. Exact approaches to solve such problems can be computationally demanding on moderately high degree instances (say, n 50). Our heuristic approach for quantizing the filter coefficients is based upon previous work targeting machine-efficient polynomial approximations for libm design, namely the fpminimax algorithm (see [START_REF] Brisebarre | Efficient polynomial L ∞ -approximations[END_REF] and [START_REF] Chevillard | Évaluation efficace de functions numériques[END_REF]Ch. 2.3]). A key new element is the introduction of a suitable discretization of the approximation domain which makes it possible to extend this work to FIR applications. We also analyze its practical effectiveness and scalability, when compared to exact methods and other similar heuristics found in the literature (like for instance [START_REF] Kodek | Telescoping rounding for suboptimal finite wordlength FIR digital filter design[END_REF][START_REF] Nielsen | Design of linear-phase direct-form FIR digital filters with quantized coefficients using error spectrum shaping[END_REF]).

Tools for hardware synthesis of FIR filters

The goal of Chapter 5 is to offer a practical application to the ideas and tools we present in Chapters 3 and 4 in terms of synthesizing FIR filters on Field Programmable Gate Arrays (FPGAs). We describe an automatic tool capable of efficient filter synthesis, starting only from a very small number of user parameters. With guaranteed output accuracy properties, preliminary results show that our approach compares very favorably to other mainstream tools, where more of a trial and error strategy needs to be applied if we want to get anywhere near the same performance characteristics.

Minimax rational approximation problems

Chapter 6 offers a preliminary overview of our ongoing work on minimax rational approximation problems with real coefficients. Just like in Chapter 3, we give an account on the existing literature and numerical approaches, the spotlight being on the issues that limit practical robustness and what are some of the approaches we can try to alleviate them. Prototype implementations of rational exchange algorithms we are working on are also discussed, together with examples.

Technical prerequisites

To isolate mathematics from the practical demands of the sciences is to invite the sterility of a cow shut away from the bulls.

Pafnuty L. Chebyshev

We now review some basic facts regarding Chebyshev polynomials, digital filter design and Computer Arithmetic. We will rely on them in the sequel of the manuscript.

Chebyshev technology

We shall see that the process of determining minimax solutions to problems like (i)-(iii) from the previous chapter is quite involved. On the other hand, interpolating f is usually a much simpler operation, one that, if done well, can in many cases produce quality approximants. Interpolation is also at the core of many iterative procedures for computing minimax polynomial and rational approximations. Though natural, this relationship between interpolation and approximation is a turbulent one -in full generality, interpolation can fail to converge in any way as the number of points tend to infinity, even for very regular functions (the famous Runge phenomenon). It is in this context that Chebyshev points and polynomials are seen as an indispensable tool for performing numerical approximation in the computer era: using this set of points and under mild regularity assumption (Lipschitz-continuity), we can actually guarantee convergence and thus use interpolation as a tool for approximation.

A telling example of this is the Chebfun [78] MATLAB library, which, as its name implies, is built around Chebyshev-centered ideas. The same holds true for much of the work in this thesis. A more detailed presentation of the results in this section is [START_REF] Mason | Chebyshev polynomials[END_REF] and many of them are also emphasized in [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]. Complementary results to the ones discussed here which are slightly more general are also presented in Section 3.6.1.

Basic facts about Chebyshev polynomials

Returning to the Chebyshev polynomials of the first kind we introduced with (1.1), the reader can check that they satisfy the following properties:

• for x ∈ [-1, 1], we have T n (x) = cos(n arccos x), n 0. • {T 0 , T 1 , . . . , T n } form a basis for R n [x].
• T n+1 has n + 1 distinct roots inside [-1, 1], called Chebyshev nodes of the first kind :

µ i = cos n -i + 1 2 π n + 1 , i = 0, . . . , n.
• T n has n + 1 distinct local extrema over [-1, 1], called Chebyshev nodes of the second kind :

ν i = cos (n -i)π n , i = 0, . . . , n.
The ν i 's also correspond to the zeros of the n + 1-th Chebyshev polynomial of the second kind U n+1 , which can also be given recursively as

U 0 (x) = 1, U 1 (x) = 2x, U n (x) = 2xU n-1 (x) -U n-2 (x), n 2.
We also have

dT n dx = nU n-1 , for n 1.
From a minimax perspective, Chebyshev polynomials are quite interesting, one of the reasons being:

Lemma 2.1 (The minimax property of T n ). The minimax approximation on [-1, 1] to the zero function by a monic polynomial of degree n with real coefficients is 2 1-n T n (x).

Proof. See for instance [START_REF] Mason | Chebyshev polynomials[END_REF]Ch. 3.2].

T 0 (x) T 1 (x) T 2 (x) T 3 (x) Figure 2.1: T0 to T3 on [-1, 1].
The equioscillatory nature of Chebyshev polynomials is also visible in Figure 2.1.

Equally noteworthy is that both types of Chebyshev polynomials are part of a larger class of functions called orthogonal polynomials, which, among other things, play an important role in numerical quadrature and least squares problems (see [START_REF] Gautschi | Orthogonal polynomials: computation and approximation[END_REF] for a recent in depth computational-centric account of orthogonal polynomials). To get a rough idea of some of their properties, we recall: 1 Again, in the sequel, the context will make it clear to which w we are referring to.

f and g are said to be orthogonal to one another over [a, b] with respect to the weight function w if f, g = 0.

This inner product defines the L 2 -type norm f 2,[a,b] := f, f . A family of orthogonal polynomials is any sequence of nonzero elements (ϕ n ) n 0 , where ϕ n ∈ R n [x], that verifies:

ϕ i , ϕ j = 0, (i = j).
Remark 2.3. The reader can check that both (T n ) n 0 and (U n ) n 0 form families of orthogonal polynomials over [-1, 1] with respect to the weight functions (1-x 2 ) -1 2 and (1-x 2 ) Moreover, it can be shown that:

1 2 . Also T 0 2 2 = π, T i 2 2 = π/2, i 1 and U i 2 2 = π/2, i 0. Remark 2.
Lemma 2.6. The best L 2 polynomial approximation f n of degree n to f may be expressed in terms of the orthogonal polynomial family {ϕ i } 0 i n in the form

f n (x) = n i=0 a i ϕ i (x),
where

a i = f, ϕ i ϕ i , ϕ i .
Thus, f n is the projection of f onto the linear span of {ϕ i } 0 i n .

Chebyshev series and Chebyshev interpolants

If a given function f can be expanded in a (suitable convergent) series based on an orthogonal family (ϕ n ) n 0 over [a, b], then we may write

f (x) = ∞ k=0 a k ϕ k (x),
and notice that f n inside Lemma 2.6 is in fact the partial sum of the orthogonal series expansion of f . We recall that a series is absolutely convergent if it remains convergent when each term is replaced by its absolute value (in which case one can reorder the series coefficients without changing the result). With respect to Chebyshev polynomials

(T n ) n 0 , if f is Lipschitz continuous over [-1, 1] (i.e., there exists C > 0 such that |f (x) -f (y)| < C |x -y| for all x, y ∈ [-1, 1]
), an assumption which is true in many cases (e.g., as soon as f is continuously differentiable over [-1, 1]), then

Theorem 2.7 (Chebyshev series). If f is Lipschitz continuous over [-1, 1]
, it has a unique representation as an absolutely and uniformly convergent series

f (x) = ∞ k=0 a k T k (x), (2.1)
over [-1, 1], with the coefficients a k , k 0 given by

a k = f, T k T k , T k = 2 π 1 -1 f (x)T k (x) √ 1 -x 2 dx, (2.2)
and the 2/π coefficient is replaced with 1/π for k = 0.

Proof. See for instance [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 3].

Apart from the good behavior of truncated orthogonal series with respect to the L 2 norm (via Lemma 2.6), truncated Chebyshev series also behave well in the minimax setting, but we postpone the discussion on the speed of convergence of f n to Section 3.6.1.

The use of truncated (or projected) Chebyshev series f n in practice is mitigated by how we can retrieve the a k coefficients. While for some functions they can be determined explicitly (see for instance [START_REF] Mason | Chebyshev polynomials[END_REF]Ch. 5.2]), in general eq. ( 2.2) would need to be evaluated numerically.

Computationally, it usually turns out to be much more practical to instead work with p n ∈ R n [x] which interpolates f at the Chebyshev nodes of the second kind (ν i ) 0 i n . It is generally known as a Chebyshev interpolant and it is also uniformly convergent if f is Lipschitz continuous (see discussion from Section 3.6.1). Expressed in the basis of Chebyshev polynomials of the first kind, we have

p n (x) = n k=0 c k T k (x) ∈ R n [x], (2.3)
which is very closely related to f n . One way to see this is through the so-called aliasing phenomenon:

Theorem 2.
c 0 = a 0 + a 2n + a 4n + • • • , c n = a n + a 3n + a 5n + • • • ,
and for 1 k n -1,

c k = a k + (a k+2n + a k+4n + • • • ) + (a -k+2n + a -k+4n + • • • ).
Proof. See for instance [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 4].

In fact, the difference between the minimax approximation quality of f n and p n over [-1, 1] is usually very small in practice, a difference of a factor of 2 between them being frequent [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Thm. 7.2,Thm. 8.2].

Another way to relate f n to p n is that the continuous orthogonality relationship stated in Definition 2.2 can be converted into a discrete orthogonality relationship when Chebyshev polynomials are concerned, by simply replacing the integral with a summation. Concretely, we have: Proposition 2.9 (Discrete orthogonality of Chebyshev polynomials). The polynomials T 0 , . . . , T n are orthogonal over the set {ν 0 , . . . , ν n } of local extrema of T n (x) with respect to the discrete inner product

u, v = 1 2 u(ν 0 )v(ν 0 ) + n-1 k=1 u(ν k )v(ν k ) + 1 2 u(ν n )v(ν n ), in the sense that T i , T j =      0, i = j, n, i = j = 0 or i = j = n, n/2, 0 < i = j < n.
Proof. See [START_REF] Mason | Chebyshev polynomials[END_REF]Ch. 4.6]. A similar result can also be derived for the Chebyshev nodes of the first kind.

From this result we can deduce Proposition 2.10 (Chebyshev interpolation formulas).

If p n (x) = n k=0 c k T k (x) is the degree n Chebyshev interpolant of f ( i.e., p n (ν k ) = f (ν k ), k = 0, . . . , n), then c k = 1 n f (ν 0 )T k (ν 0 ) + 2 n n-1 i=1 f (ν i )T k (ν i ) + 1 n f (ν n )T k (ν n ), k = 0, . . . , n. (2.4)
The c k coefficients in (2.4) can be evaluated in a numerically stable way with O(n 2 ) operations, by using Clenshaw's algorithm n + 1 times (see Algorithm 1), or faster, in only O(n log n) operations, by means of the Discrete Cosine Transform (DCT) [START_REF] Strang | The discrete cosine transform[END_REF] or the Fast Fourier Transform (FFT) [START_REF] Mason | Chebyshev polynomials[END_REF]Ch. 4.7.1], provided that the values f (ν i ), i = 0, . . . , n are already given. This ability to compute the coefficients of p n in a fast and stable manner is one of the key elements which makes Chebfun such a robust numerical library. Working with continuous functions f in Chebfun means replacing them with so-called chebfuns, that is Chebyshev interpolants of sufficiently high degree that approximate f close to the unit roundoff of 64-bit double floating-point values (see Section 2.3 and the references therein for the relevant definitions and values concerning floating-point arithmetic).

Algorithm 1: Clenshaw evaluation

Input: Chebyshev coefficients c 0 , . . . , c n and a point x Output:

n k=0 c k T k (x) 1 b n+1 ← 0, b n ← c n 2 for k ← n -1 down to 1 do 3 b k ← 2xb k+1 -b k+2 + c k 4 return c 0 + xb 1 -b 2
Since polynomials expressed in the Chebyshev basis (T i ) 0 i n are used extensively throughout the text, it is perhaps appropriate to also say a few words about evaluating them in practice. The idea goes back to Clenshaw [START_REF] Clenshaw | A note on the summation of Chebyshev series[END_REF] and consists of a recursive method to evaluate linear combinations of polynomials satisfying a three term recurrence. For Chebyshev polynomials, it works by taking advantage of (1.1). Given in Algorithm 1, it can be seen as an extension to Horner's rule for evaluating a polynomial as a sum of powers using nested multiplication and also runs in O(n) arithmetic operations. Indeed, by the definition of the b k 's, we have

n k=0 c k T k (x) = c 0 + (b 1 -2xb 2 + b 3 )T 1 (x) + . . . + (b n-1 -2xb n + b n+1 )T n-1 (x) + c n T n (x), which simplifies to c 0 + b 1 x + b 2 (T 2 (x) -2xT 1 (x)
) by using (1.1) and the values of b n and b n+1 . For remarks regarding its stable numerical behavior, we refer the reader to [START_REF] Smoktunowicz | Backward stability of Clenshaw's algorithm[END_REF] and [START_REF] Mason | Chebyshev polynomials[END_REF]Ch. 2.4.2].

Digital filter design

The content of this section is meant to give a very concise overview of some basic notions on digital filters we will be using throughout the text. It is by no means exhaustive and the reader is referred to standard digital signal processing texts like [START_REF] Antoniou | Digital Signal Processing: Signals, Systems, and Filters[END_REF][START_REF] Oppenheim | Discrete-Time Signal Processing[END_REF] for a systematic and complete presentation of the topic.

Digital Signal Processing gives us tools to analyze, modify or otherwise manipulate information regarding phenomena evolving over time or space. It operates on sequences of complex values called discrete-time signals. In a one dimensional setting, such a signal, let us call it x, is usually denoted in signal processing literature as

x = {x[n]} , x[n] ∈ C, -∞ < n < ∞,
where the integer index n is viewed as a measure of dimensionless time, imposing a chronological order on the values of the sequence. One signal that is central to describing digital systems is the impulse (or unit sample sequence). It is defined as

δ[n] = 1, n = 0, 0, n = 0.
Its importance stems from the fact that it can be used to capture the structure of an arbitrary signal x.

Generally speaking, any sequence can be expressed as

x[n] = ∞ k=-∞ x[k]δ[n -k], (2.5)
a convolution operation between the sequence and the impulse, called the reproducing formula.

When working with signals, we have to take into account that, from a physical point of view, they are characterized as having finite energy. The energy of a signal x is given as

E x = x 2 2 = ∞ n=-∞ |x[n]| 2 .
Two spaces of sequences satisfying this property are of interest in practice:

• absolutely summable sequences (the space 1 (Z)), which are the sequences satisfying:

x 1 = n∈Z |x[n]| < ∞;
• square-summable sequences (the space 2 (Z)), which have:

x 2 2 = n∈Z |x[n]| 2 < ∞.
The reader can verify that 1 (Z) ⊂ 2 (Z). In the following we will deal only with these types of discrete time signals.

Frequency domain representation

Another important remark regarding real-world signals is that they are often characterized by some sort of oscillatory behavior. In most cases it is very hard to analyze it by studying the sequence representation we used to denote signals. This information can be captured by using Fourier analysis to transform the signal in its frequency domain representation. The Discrete-Time Fourier Transform (DTFT) maps 1 (Z) sequences into the space of 2π-periodic functions of a real-valued argument.

Definition 2.11 (DTFT and IDTFT). The Discrete-Time Fourier Transform of a signal x belonging to 1 (Z) is defined as the 2π-periodic function

X(ω) = ∞ n=-∞ x[n]e -iωn , i ∈ C, i 2 = -1 and w ∈ R. (2.6)
The inverse operation, called the Inverse Discrete-Time Fourier Transform (IDTFT) satisfies

x[n] = 1 2π π -π X(ω)e iωn dω.
Some changes are needed to make Definition 2.11 work in the 2 (Z) setting. Since we will only be using the DTFT on 1 (Z) sequences in Ch. 3-5, we refer the reader to [START_REF] Vetterli | Foundations of signal processing[END_REF]Ch. 3.4] for details on the 2 (Z) specifics.

In the following, unless specified otherwise, we will usually denote the DTFT of a lowercase letter signal with its capital case equivalent. The usual interval chosen to represent the frequency content (called the spectrum) of a signal is [-π, π], with low frequencies centered around 0 and high ones around -π and π.

Energy conservation between the two representations is ensured by means of Parseval's theorem, which states the following equality:

∞ n=-∞ |x[n]| 2 = 1 2π π -π |X(ω)| 2 dω.
We can think of the magnitude of the DTFT at a certain frequency ω ∈ [-π, π] (the value |X(ω)|) as the energy concentration of the signal at that particular frequency. Thus, by analyzing a signal's spectral magnitude we can decompose discrete-time signals into three broad categories:

• lowpass signals: the magnitude spectrum is concentrated around 0 and negligible elsewhere. We say that the passband for the signal is centered around 0, while the stopbands correspond to the remaining regions of [-π, π];

• highpass signals: spectrum concentrated around ±π and negligible elsewhere;

• bandpass signals: spectrum concentrated around ω = ±ω p , ω p ∈ (-π, π), and negligible elsewhere (around ω = 0 and ω = ±π).

Discrete-time systems

We said that signal processing is interested in manipulating information stored in signals. The tool to do so is the discrete-time system. Mathematically, we define it as a transformation (or operator) that maps an input sequence with values x[n] into an output sequence with values y

[n] (y[n] = T {x[n]}).
A simple example consists of the ideal delay system, expressed using the equation

y[n] = x[n -n d ], -∞ < n < ∞,
where n d is a fixed positive integer representing the delay of the system. The ideal delay operator falls under the category of linear-time invariant(LTI) systems (also called filters) and they are a core topic in digital signal processing. Consider an arbitrary LTI discrete-time system H. Its linearity is expressed by

H {αx 1 [n] + βx 2 [n]} = αH {x 1 [n]} + βH {x 2 [n]}
for any two sequences x 1 [n] and x 2 [n] and any two scalars α, β ∈ C, while time-invariance implies the equivalence y

[n] = H {x[n]} ⇔ H {x[n -n 0 ]} = y[n -n 0 ], ∀n 0 ∈ Z.
Taken together, these two properties have a very powerful consequence on the system's behavior: it can be completely characterized by its response to the signal

x[n] = δ[n]. The sequence h[n] = H {δ[n]
} is called the impulse response of the system and it is all we need to know in order to determine the system's response for any other input signal. Indeed, by using the reproducing formula (2.5) and the linearity and time-invariance properties, we have

y[n] = H {x[n]} = H ∞ k=-∞ x[k]δ[n -k] = ∞ k=-∞ x[k]H {δ[n -k]} = ∞ k=-∞ x[k]h[n -k], (2.7)
or, equivalently, in terms of the convolution operator, y

[n] = x[n] * h[n].
LTI systems also make it easy to work with signals in the frequency domain by means of the convolution theorem: if x and h are in 1 (Z), then the corresponding DTFTs are linked by Y (ω) = X(ω)H(ω). We call H(ω) the frequency response. By looking at the magnitude of the frequency response, we can split filters in the same lowpass, highpass and bandpass categories as before. Depending on the type of filter used, the outputs only contain those frequency components that are not eliminated by the filter via the convolution theorem. For example, in the case of highpass filters, only the frequency components centered around ±π are preserved from input to output. The phase content of H(ω) is also important, especially in data transmission applications. Linear phase in the frequency domain corresponds to a delay in the time domain, which ensures a predictable behavior (time-wise) for the output.

Other properties which are needed in practice, but not necessarily valid for an LTI system, are: causality and stability. A causal system is one whose output does not depend on future input values. This is a crucial aspect, especially for systems that work in real time, for which the inputs are not known in advance. Stability, in this setting, states the fact that for any bounded filter input, the output should also be bounded. A necessary and sufficient condition for stability (see [START_REF] Oppenheim | Discrete-Time Signal Processing[END_REF]Ch. 2.4]) is that the impulse response be absolutely summable.

For realizable filters (i.e., each value of the output can be computed using a finite number of arithmetic operations), equation (2.7) can be reworked into a constant-coefficient difference equation (CCDE) like so:

y[n] = N -1 k=0 b k x[n -k] - M -1 k=1 a k y[n -k], (2.8)
where the a k and b k coefficients are taken to be real (or complex) numbers. Without going into much detail, equations like (2.8) can be analyzed in an algebraic manner by using the z-transform, which, for a sequence x, is defined as

X(z) = Z {x[n]} = ∞ n=-∞ x[n]z -n , z ∈ C.
(2.9)

Applying it to (2.8), we get

Y (z) = N -1 k=0 b k z -k X(z) - M -1 k=1 a k z -k Y (z) = N -1 k=0 b k z -k 1 + M -1 k=1 a k z -k X(z) = H(z)X(z).
H(z) is called the transfer function of the system described by equation (2.8).

Remark 2.12. The denominator of H(z) is invertible as a power series expansion of z; this allows us to retrieve the h[k] coefficients of (2.7).

A realizable filter is always defined in terms of a rational transfer function. Also, we can see that using z = e iω in (2.9) gives us the discrete-time Fourier transform (2.6) of x. The use of the letter z and ω for the variable should make it clear to which of the two transforms we are referring to. There are also different ways of rewriting the transfer function H(z) and this translates to different hardware and software implementations [START_REF] Diniz | Digital signal processing: system analysis and design[END_REF].

Based on the number of nonzero values of h[n] (called taps), filters can be of two types:

• FIR (finite impulse response) filters: the number of taps is finite;

• IIR (infinite impulse response) filters: infinite number of taps.

There are different reasons as to why one should use a type of filter over the other (see for instance [START_REF] Prandoni | Signal processing for communications[END_REF]Ch. 7.1.1]). In essence, the choice comes down to the following observations:

• FIR filters are unconditionally stable, while stability is not guaranteed in the IIR case;

• FIR filters offer precise control over their phase response (i.e., can be easily designed to offer linear phase, as we shall see) whereas IIR filters are more difficult to control;

• IIR filters are computationally less intensive than FIR filters that are designed to have similar behavior.

Minimax FIR filter design

Many FIR filters with real-valued taps (or coefficients) {h[k]}

N -1 k=0 used in practice have a frequency response of the form

G(ω) = N -1 k=0 h[k]e -ikω = H(ω)e i( Lπ 2 -N -1 2 ω) , (2.10)
where H(ω) is a real valued function and L is 0 or 1. The h[k] values are usually required to be positive (L = 0) or negative (L = 1) symmetric around the middle tap(s), giving rise to so-called linear-phase filters.

Depending on the type of symmetry and number of non-zero taps, there are 4 major types (I to IV) of such filters [START_REF] Oppenheim | Discrete-Time Signal Processing[END_REF]Ch. 5.7.3]. We state some important formulas without proof (they can be easily verified) which will show that from a design point of view, all four types can generally be treated in the same way [START_REF] Antoniou | Digital Signal Processing: Signals, Systems, and Filters[END_REF], which is why we will usually focus our attention, without loss of generality, on type I FIR filters.

Type I -positive symmetry and odd number of taps

H(ω) = n k=0 a k cos(kω), (2.11
)

n = (N -1)/2, a 0 = h[n] and a k = 2h[n -k], 1 k n.
Type II -positive symmetry and even number of taps

H(ω) = n k=1 b k cos k - 1 2 ω , (2.12
)

n = N/2 and b k = 2h[n -k], k = 1, . . . , n. It can be shown that H(ω) = cos ω 2 H (ω)
, where

H (ω) = n-1 k=0 bk cos(kω), b 1 = b0 + 1 2 b1 , b k = 1 2 bk-1 + bk , k = 2, . . . , n -1, b n = 1 2 bn-1 .
Type III -negative symmetry and odd number of taps

H(ω) = n k=1 c k sin(kω), (2.13
)

n = (N -1)/2, c k = 2h[n -k], k = 1, .
. . , n and h[n] = 0. Similarly to before, we have H(ω) = sin ωH (ω), where

H (ω) = n-1 k=0
ck cos(kω),

c 1 = c0 -1 2 c1 , c k = 1 2 (c k-1 -ck+1 ) , k = 2, . . . , n -2, c n-1 = 1 2 cn-2 , c n = 1 2 cn-1 .
Type IV -negative symmetry and even number of taps

H(ω) = n k=1 d k sin k - 1 2 ω , (2.14
)

n = N/2, d k = 2h[n -k], k = 1, . . . , n. We also have H(ω) = sin ω 2 H (ω)
, where

H (ω) = n-1 k=0
dk cos(kω),

d 1 = d0 -1 2 d1 , b k = 1 2 dk-1 -bk , k = 2, . . . , n -1, d n = 1 2 dn-1 .
The filter design question for type I filters which will be central to the next two chapters can be stated as: Problem 2.13 (Equiripple (or minimax) FIR filter design). Let Ω be a compact subset of [0, π] and D(ω) an ideal frequency response, continuous on Ω. For a given filter degree n ∈ N, we want to determine H(ω) = n k=0 a k cos(kω) such that the weighted error function

E(ω) = W (ω)(D(ω) -H(ω)) has minimum uniform norm E(ω) ∞,Ω = sup ω∈Ω |E(ω)| ,
where the weight function W is continuous and positive over Ω.

Once a suitable solution is found, the filter taps can be determined directly from the a i coefficients inside (2.11). Based on the previous formulas, type II to IV problems where H(ω) has a different expression can also be cast in this way, by optimizing for H (ω) instead. The error function becomes

E(ω) = W (ω)Q(ω) W (ω)      D(ω) Q(ω) D (ω) -H (ω)      ,
where Q(ω) is either cos ω 2 , sin(ω) or sin( ω 2 ), depending on the filter type, with the remark that for type II problems Ω ⊆ [0, π), for type III problems Ω ⊆ (0, π) and for type IV problems Ω ⊆ (0, π] so that Q(ω) is always nonzero.

Computer arithmetic

Representing and working with real numbers inside a computer is very much restricted by the finite nature of electronic memory elements. This has led over the years to many different alternatives for representing/approximating a infinite set of real values with a finite set of so-called machine numbers. Among the most well known ones we mention: floating-point arithmetic, fixed-point arithmetic, logarithmic number systems, continued fractions and rational numbers. In choosing the most adequate format for a given situation, many constraints, such as accuracy, speed, dynamic range, memory cost, ease of use and implementation, factor in. Floating-point arithmetic is by far the most popular alternative, since it provides a good compromise for all these constraints. Still, in the embedded circuit world, fixed-point arithmetic is still very much the dominant format, due to its simplicity, speed and ease of use (but which usually comes with a diminished range of values, when compared to floating-point arithmetic).

These two formats play an important role in this manuscript, which is why over the next few paragraphs, we will give a brief overview of them, so as to establish some key concepts and notation. For floating-point arithmetic in particular, we refer the reader to [START_REF] Muller | Handbook of Floating-Point Arithmetic[END_REF] for a much more in-depth treatment of the subject. Our exposition is heavily based on [153, Ch. 1-3].

Floating-point arithmetic

A general purpose definition of what a floating-point value is, can be given as: Definition 2.14 (Floating-point number). A floating-point number belonging to a radix-β (β ∈ N, n 2), precision-p (p ∈ N, p 2) format, is a number of the form

x = (-1) s • m • β e ,

where

• s ∈ {0, 1} is the sign bit of x; This way of representing floating-point numbers does not preclude some values from having several representations in the same format. In order to prevent this, we normalize finite nonzero floating-point values by choosing the representation for which the exponent is minimum (but still larger than e min ), giving rise to two kinds of floating-point numbers:

• normal numbers: 1 |m| < β, or, equivalently β p-1 |M | < β p ;
• subnormal numbers: e = e min and |m| < 1, or, equivalently, |M | β p-1 -1. Zero is a special case, treated separately [START_REF] Muller | Handbook of Floating-Point Arithmetic[END_REF]Ch. 3].

The presence of subnormal numbers is important in practice, since it allows for gradual overflow, which, according to [START_REF] Muller | Handbook of Floating-Point Arithmetic[END_REF]Ch. 2] aids significantly in the writing of stable numerical software. In terms of radix β, based on the fact that most computers use two-state logic, radix 2 systems (and more generally, power of 2 radixes) are most common. However, due to our familiarity with decimal arithmetic, radix 10 systems are often used in financial computations and in pocket calculators.

In order to ensure a setting for performing reliable, accurate and portable floating-point computations, in 1985, the IEEE754-1985 Standard for Binary Floating-Point Arithmetic was introduced [START_REF]ANSI/IEEE 754-1985, Standard for Binary Floating-Point Arithmetic[END_REF], which is nowadays implemented by basically all commercially significant computing systems. Its most recent revision, called IEEE754-2008 (which also includes specifications for decimal floating-point arithmetic), was adopted in June 2008 [START_REF]IEEE 754-2008, Standard for Floating-Point Arithmetic[END_REF]. The IEEE floating-point standard specifies various formats, the behavior of basic arithmetic operations (such as +, -, ×, ÷ and √ ), conversions and exceptional conditions. The parameters for the binary formats specified in the 2008 version of the standard are given in Table 2.1.

An interesting concept brought about by the standardization effort is the idea of rounding mode, which helps define what value an operation (or a function) involving floating-point operands outputs, when the result is not exactly representable in the floating-point system being used. There are four such modes defined by the IEEE754-2008 standard:

• round toward -∞: RD(x) is the largest floating-point number (or -∞) less than or equal to x;

• round toward +∞: RU(x) is the smallest floating-point number (or +∞) larger than or equal to x;

• round toward zero: RZ(x) is the closest floating-point number to x that is no greater in magnitude than x (it is equal to RD(x) if x 0, and to RU(x) if x 0);

• round to nearest: RN(x) is the floating-point number closest to x. A tie-breaking rule is applied when x falls exactly halfway between two consecutive floating-point numbers. A frequently chosen rule is round to nearest even: x is rounded to the only one of these two competing floating-point values whose integral significand is even. This is the default mode of the IEEE754-2008 standard.

Unless otherwise stated, in the sequel we will consider the round to nearest setting when talking about floating-point computations. To measure rounding errors in floating-point arithmetic, it is often convenient to express them in what would intuitively be defined as "weight of the last bit of the significand" or unit in the last place (ulp) (see [START_REF] Muller | Handbook of Floating-Point Arithmetic[END_REF]Ch. 2.6] for a detailed account). In a loose manner, ulp(x) is the distance between the two consecutive floating-point bounding x. Ambiguity ensues when x is close to a power of the radix 2, and there are several slightly different definitions one can use (due for instance to W. Kahan, J. Harrison and D. Goldberg). For instance, we have Definition 2.15 (Goldberg's ulp). If x ∈ [2 e , 2 e+1 ), then ulp(x) = 2 e-p+1 .

Closely related to the notion of ulp is the unit roundoff, also called machine epsilon: Definition 2.16 (Unit roundoff). The unit roundoff u of a radix-β, precision-p, floating point system is defined as

u =    1 2 ulp(1) = 1 2 β 1-p in round-to-nearest mode, ulp (1)
= β 1-p in directed rounding modes.

The unit roundoff is widely used in the analysis of numerical algorithms. For any basic arithmetic operation T ∈ {+, -, ×, ÷}, any rounding mode • ∈ {RN,RD,RU,RZ} and for all floating point values x, y such that xT y does not underflow or overflow, we get

• (xT y) = (xT y)(1 + ε 1 ) = (xT y)/(1 + ε 2 ), with |ε 1 | , |ε 2 | u.
This formula is very useful in the computation of error bounds [START_REF] Higham | Accuracy and stability of numerical algorithms[END_REF]. We will sometimes use the unit roundoff as well, when discussing numerical stability issues in Chapter 3.

Fixed-point arithmetic

Fixed-point values play an important role in Chapter 4 and are in general simpler to work with than floating-point values, essentially because they are just scaled integers. Because of this, fixed-point arithmetic does not need specialized arithmetic circuits (as is the case for floating-point formats), apart from a usual integer arithmetic unit. They are mainly used in embedded circuits for signal processing tasks, where power consumption constraints make floating-point formats a less attractive proposition.

There is no standard formalization of fixed-point values (in the same vein of the IEEE754 standard for floating-point arithmetic). Hence, there are numerous definitions and notations for fixed-point values, but they can generally be described by: Definition 2.17 (Fixed-point number). For a given real scaling factor s > 0 and integer mantissa bounds m -< m + , a fixed-point value is any number

x = M • s, where M ∈ [m -, m + ] ∩ Z is called the integer mantissa of x.
In many cases, s = 2 -, ∈ Z, meaningdesignates the position of the least significant bit (lsb) in the binary encoding of x. The mantissa M is also representable on a finite number of bits. If, for instance M ∈ [-2 b + 1, 2 b -1] ∩ Z, then b + 1 will be the width of the format (i.e., the number of bits necessary to encode a value belonging to this fixed-point format), with b --1 representing the position of the most significant bit in the signed binary encoding of x, meaning

x = s b--1 i=- x i 2 i , (2.15)
where s ∈ {-1, 0, 1} (s = 0 when x = 0) and x i ∈ {±1}.

The name fixed-point comes from the fact that the scaling factor s is a fixed quantity, whereas if we look at floating-point values in Definition 2.14, the equivalent to s is β e+1-p , which varies with e.

Besides (2.15), there are many other encodings one can use to represent x, like one and two's complement, which affect the actual range of M . Another useful rewriting used in practice is the canonic signed digit (CSD) representation, which consists of rewriting (2.15) such that s = 1 and x i ∈ {-1, 0, 1} with x i x i+1 = 0, for i = -, . . . , b --2. It can be derived recursively from (2.15) by noting the k ones in succession in the binary representation of equals 2 k -1, which can be rewritten using two nonzero digits and k -1 zeros in a CSD form. Because they often lead to very compact encodings, CSD representations are mainly used in hardwired signal processing operations which lack specialized circuits for performing integer multiplication. Since the specifics of the fixed-point representations mentioned here are not important in the sequel, we will not go into further details.

In contrast to the floating-point setting, there is no real standard for fixed-point arithmetic. The notion of ulp however, can be carried over from floating-point arithmetic very easily; it is the scaling factor s. In terms of rounding as well, we can similarly define rounding towards ±∞ and round to nearest operations. For our purposes, we will only be considering rounding to nearest explicitly (which we will sometimes call naive rounding). For a given x we adopt the convention that its rounding to nearest in the fixed-point format introduced by Definition 2.17 is

RN(x) = x s • s, (2.16)
which makes sense only when x s ∈ [m -, m + ] ∩ Z.

Efficient tools for weighted minimax approximation

In a subject like approximation theory which is very strongly influenced by our need to solve practical problems of computation it seems appropriate to begin by considering some concrete examples of such problems.

E. W. Cheney, Introduction to Approximation Theory

Chebyshev approximation problems are one of the pillars of Approximation Theory and are routinely at the heart of many engineering applications. As discussed in the previous chapters, one of the most telling such use cases is digital filter design, which serves as the catalyst for the contributions of this thesis.

Algorithmically, it was Remez, in the 1930s [START_REF] Remes | Sur le calcul effectif des polynômes d'approximation de Tchebichef[END_REF][START_REF] Remes | Sur un procédé convergent d'approximations successives pour déterminer les polynômes d'approximation[END_REF], that spearheaded the great deal of research on the computational aspects of minimax approximation problems in the decades that followed. A pivotal development in this story occurred in the beginning of the 1970s, when Parks and McClellan [START_REF] Parks | Chebyshev Approximation for Nonrecursive Digital Filters with Linear Phase[END_REF] adapted one of Remez's algorithms for the design of finite impulse response filters. Today, their approach is a standard routine in many Signal Processing packages. Despite this, it is possible to find practical design specifications where existing codes fail to work or they produce incorrect results.

Our goal in this chapter is twofold. We first examine and present novel solutions for the practical difficulties related to weighted minimax polynomial approximation problems on multi-interval domains (i.e., the general setting under which the Parks and McClellan approach operates). Using these ideas, we then describe a robust implementation of one of Remez's algorithms, which, in particular, routinely outperforms existing minimax filter design routines.

At this point in time, the result is an effective, standalone C++ library, available under an open source license. The contents presented in this chapter are an extended version of our published work [START_REF] Filip | A robust and scalable implementation of the Parks-McClellan algorithm for designing FIR filters[END_REF].

Introduction

Current implementations of the Parks-McClellan algorithm suffer from robustness issues. A typical instance where codes such as those found in MATLAB's Signal Processing toolbox, GNURadio or Scipy fail to work, is when computing a minimax filter of degree n = 100 adhering to the specification from Example 3.19. Such a degree is plausible in practice, yet it proves difficult to design. This unsatisfactory situation was the initial motivation of the present study. Together with the three other examples from Section 3.4.2, it will be used extensively to highlight the various contributions of this chapter.

The starting point of our work is [START_REF] Pachón | Barycentric-Remez algorithms for best polynomial approximation in the Chebfun system[END_REF], which describes a robust double-precision implementation of the second Remez exchange algorithm for computing best polynomial approximations on a single compact interval, as part of Chebfun (the remez command). The main elements that allow Chebfun remez to perform well in practice are: CHAPTER 3. EFFICIENT TOOLS FOR WEIGHTED MINIMAX APPROXIMATION (1) the use of Chebyshev nodes as starting reference;

(2) barycentric Lagrange interpolation [START_REF] Berrut | Barycentric Lagrange Interpolation[END_REF];

(3) a root-finding method [START_REF] Boyd | Finding the Zeros of a Univariate Equation: Proxy Rootfinders, Chebyshev Interpolation, and the Companion Matrix[END_REF][START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF] based on the recursive subdivision of the approximation domain.

The Parks-McClellan variant computes minimax approximations in a weighted multi-interval context and can therefore be viewed as an extension of the case addressed by [START_REF] Pachón | Barycentric-Remez algorithms for best polynomial approximation in the Chebfun system[END_REF]. Unfortunately, adapting this implementation to our context is not at all straightforward and raises several significant issues. The present work addresses all of them and, to the best of our knowledge, it describes the first fast, robust and scalable implementation of the Parks-McClellan algorithm. Note also that, despite the fact that most of our examples come from filtering applications (the traditional setting for the Parks-McClellan algorithm), our code can compute more general weighted minimax polynomial approximations over a multi-interval compact subset of R.

We begin with an overview of linear Chebyshev approximation problems (Section 3.2), the algorithmic approaches devised to solve them (Section 3.3) and the practical difficulties in using them (Sections 3.4 and 3.5). The main problem we faced is finding a suitable initial reference. In particular, we do not know of any simple, closed-form equivalent for Chebyshev nodes in this setting (in the sense that interpolation at those points is close to the optimal approximation). Fast practical convergence of the exchange algorithm is very much dependent on placing the right number of reference points inside each interval of the domain. In Section 3.6, we describe two complementary heuristic solutions to this initialization problem. Our experiments show that they are quite satisfactory in practice. Section 3.7 looks at how initialization choices affect execution. We also identify possible sources of numerical instability at runtime, argue how they are related to each other and how to counter them. Central to our study is the Lebesgue constant (see Section 3.6.1 for a definition) that we use, in an apparently novel way, as a tool for detecting numerical problems. Another important difference with the Chebfun remez code is the fact that we eliminate recursion during root-finding by using problem-specific information about the root positions. Major advantages are a smaller number of computations compared to a recursive search and the possibility of introducing parallelism (see Sections 3.8 and 3.9), further speeding up execution on multicore systems.

The resulting code1 allows one to successfully address problematic instances in a scalable manner (see the examples from Sections 3.4.1 and 3.9.2). We offer three versions of our implementation. The first one uses IEEE-754 double-precision floating-point arithmetic, while the second one requires long double operations. On x86 machines and compilers, this format corresponds to 80-bit floating-point numbers. The other version uses MPFR [START_REF] Fousse | MPFR: A Multipleprecision Binary Floating-point Library with Correct Rounding[END_REF] multiple precision formats and serves mostly as a verification tool for our double and long double versions. All of the numerical tests in the sequel (and many others) are included with the source code. The double-precision version is sufficient for most practical uses.

Properties of best approximations

Polynomials are attractive to use in practice because of their simple structure which can be implemented on a computer using only a linear number (in the degree of the polynomial) of additions and multiplications, the two fastest and most optimized arithmetic operations on modern processors. Another major reason for using polynomials to approximate continuous real-valued functions is due to the Stone-Weierstrass theorem:

Theorem 3.1 (Stone-Weierstrass). A continuous function f (x), defined on a compact subset X of R d , is uniformly approximable over X by polynomials in x ∈ R d .
Proof. See [START_REF] Devore | Constructive Approximation[END_REF]] for a proof and further extensions. This result basically tells us that we can approach f uniformly using a polynomial p ∈ R[x 1 , . . . , x d ] arbitrarily well, provided the degree of p is sufficiently large.

We will mostly focus on univariate problems (d = 1) in what follows, where X is compact subset of an interval [a, b]. Using weight functions when performing the approximation (as is frequently the case with the problems we are considering) can invalidate the result of Theorem 3.1. This is not generally an issue, since our weight functions w ∈ C(X) satisfy w(x) > 0, ∀x ∈ X, for which it is immediate to see the result still holds.

Weights can be taken into account more easily if we replace, for a degree n ∈ N problem, the space of polynomials, given for instance in the monomial basis 1, x, . . . , x n , by a set of n + 1 linearly independent functions ϕ 0 , ϕ 1 , . . . , ϕ n from C([a, b]). Following [START_REF] Cheney | Introduction to Approximation Theory[END_REF]Ch. 3.4], we will call any linear combination of ϕ i (the finite-dimensional linear space S n = span R (ϕ i ) 0 i n ) a generalized polynomial (or even simply polynomial when we see no risk of confusion). The existence of an element p ∈ S n which best approximates f in a L ∞ sense is guaranteed by: Theorem 3.2 (Existence of best approximations). For any f ∈ C(X), there exists a generalized polynomial

p ∈ S n such that f -p ∞,X f -p ∞,X ,
for all p ∈ S n . This is frequently called a best, uniform, Chebyshev or minimax approximation.

Proof. This is a classic result. For a proof, see for instance [START_REF] Cheney | Introduction to Approximation Theory[END_REF]Ch. 1.6] or [168, Thm. 1.2].

Unique best approximations: the Haar condition

The space of polynomials with real coefficients R[x] plays a central role in Approximation Theory and many of their properties can be extended to more general settings. We shall thus start our discussion by introducing the concept of Chebyshev system, that is, a family of functions which satisfy the following condition: (iii) if x 0 , x 1 , . . . , x n are n + 1 arbitrary distinct points from [a, b], then the matrix

   ϕ 0 (x 0 ) • • • ϕ n (x 0 ) . . . . . . . . . ϕ 0 (x n ) • • • ϕ n (x n )    is non-singular.
A proof of the equivalence of (i)-(iii) can be found in [168, Appx. A].

As hinted, the prototypical example of a system satisfying the Haar condition is the set of polynomials P n (R) of degree at most n. The following basic result allows us to build other examples very quickly:

Lemma 3.4. If (ϕ 0 , . . . , ϕ n ) is a Chebyshev system on [a, b] and w ∈ C([a, b]) is positive on [a, b], then (wϕ 0 , . . . , wϕ n ) is also a Chebyshev system on [a, b].
Proof. Consider q ∈ span R (wϕ i ) 0 i n , q = 0. We can write q = wp, with p ∈ span R (ϕ i ) 0 i n , p = 0. Since (ϕ 0 , . . . , ϕ n ) satisfies the Haar condition, p has at most n distinct roots on [a, b]. Because w is positive on [a, b], this property is true for q as well, meaning the Haar condition also holds for (wϕ 0 , . . . , wϕ n ).

(x) = 1 on X using the basis (1/f (x), x/f (x), . . . , x n /f (x)). Example 3.6. If f has a unique zero x 0 ∈ [a, b] of order k, then the system (x-x0) k f (x) , . . . , (x-x0) n f (x)
satisfies the Haar condition. What is noteworthy about polynomial systems which satisfy the Haar condition is that they ensure uniqueness of the solution to the Chebyshev approximation problem. Indeed, the following qualitative description holds:

Theorem 3.9 (Equioscillation of best approximations). Let (ϕ 0 , . . . , ϕ n ) be a Chebyshev system on [a, b] with X ⊆ [a, b] a closed set containing at least n + 2 points. If f ∈ C(X), then p ∈ S n is the unique best approximation of f on X if and only if there are n + 2 values x 0 < . . . < x n+1 inside X and λ ∈ {±1} for which f (x i ) -p (x i ) = λ(-1) i δ X , i = 0, . . . , n + 1 (3.1)
and

δ X = f -p ∞,X .
Proof. For this particular formulation, see for instance [START_REF] Cheney | Introduction to Approximation Theory[END_REF]Ch. 3.4] or [START_REF] Devore | Constructive Approximation[END_REF]Ch. 3.5].

Traditionally known as the Chebyshev theorem, this result was in fact not proven by Chebyshev himself, although some of the underlying ideas are present in his text [START_REF] Tchebycheff | Sur les questions de minima qui se rattachent à la représentation aproximative des fonctions[END_REF]. Such work was done in the beginning of the 20th century by Blichfeldt [START_REF] Blichfeldt | Note on the Functions of the Form f (x) ≡ ϕ(x)+a 1 x n-1 +a 2 x n-2 +• • •+a n Which in a Given Interval Differ the Least Possible From Zero[END_REF], Kirchberger [START_REF] Kirchberger | Ueber Tchebychefsche Annäherungsmethoden[END_REF] and Borel [START_REF] Borel | Leçons sur les fonctions de variables réelles et les développements en séries de polynomes[END_REF] in the context of best polynomial approximations on a closed interval [a, b]. See also [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 10] for a very interesting exposition on this result.

The points x i in (3.1) are known as alternation points of the minimax result p and are characterized by the fact that error function fp attains its global extremum there. In a more general setting where a polynomial p ∈ S n has n + 2 alternating points which do not oscillate with equal amplitude, de la Vallée Poussin [START_REF] De | Leçons sur l'approximation des fonctions d'une variable réelle[END_REF] showed how p can be used to provide a lower bound on the value of δ X : Theorem 3.10 (de La Vallée Poussin). Under the same conditions as Theorem 3.9, if for a generalized polynomial p ∈ S n there is an ordered set of n+2 distinct nodes

(x i ) 0 i n+1 from X such that f (x i )-p(x i ) = λ(-1) i µ i , with λ = ±1 and µ i > 0, i = 0, . . . , n + 1, then f -p ∞,X min i µ i . Proof. Assume f -p ∞,X < min i µ i . Then, sgn[p (x i ) -p(x i )] = sgn[(f (x i ) -p(x i )) -(f (x i ) -p (x i ))] = λ(-1) i , meaning p -p has n + 1 sign changes in [a, b],
which, according to the Haar condition, gives p = p , a contradiction.

As an immediate consequence, we have the following: Corollary 3.11. If in Theorem 3.10, all µ i are equal to each other (call this value µ), then

µ f -p ∞,X f -p ∞,X .
Proof. The first inequality is derived from Theorem 3.10, whereas the optimality of p gives the second.

These last results are very important in the design of numerical algorithms for minimax approximation (as will be detailed in Section 3.3). Indeed, if p and µ are given, we can generally compute very accurate approximations of fp ∞,X (see Section 3.8 and the references therein). If this value is sufficiently close to µ, then, for all practical purposes, we can consider p to be optimal.

When uniqueness is no longer guaranteed

The Haar condition is quite general, in the sense that it holds for many situations arising in practice. For FIR filter design, by looking at the existing Signal Processing literature, this seems to always be the case.

Because of this, its absence has not been a very active concern in the work detailed in this chapter. Nevertheless, as presented in [58, Ch. 2.2], the absence of the Haar condition in the context of function approximation is very much possible. For an in-depth presentation and several relevant practical examples we recommend [START_REF] Chevillard | Évaluation efficace de functions numériques[END_REF]Ch. 2.2].

Of note is the fact that, even when the Haar condition is not met, a certain generalization of de la Vallée Poussin's theorem which proves useful in a computational setting (an example of its use is in the Sollya [START_REF] Chevillard | An Environment for the Development of Numerical Codes[END_REF] software tool for the remez command), still holds: Corollary 3.12. Let X ⊆ [a, b] be a set containing at least n + 2 distinct points x 0 , . . . , x n+1 , S n the finite-dimensional space of generalized polynomials we have considered up to now and f ∈ C(X). Suppose only that the matrix V(x 0 , . . . ,

x n+1 ) = [v ij ] := [ϕ j (x i )], i = 0, . . . , n + 1, j = 0, . . . , n has full rank n + 1.
If p is a best approximation from S n on the given n + 2 points and µ = max 0 i n+1 |f (x i )p(x i )|, then for any polynomial p of best approximation to f on X, we have

µ f -p ∞,X f -p ∞,X .
Proof. See results and discussion from [58, Ch. 2.2.3-2.2.4].

Minimax exchange algorithms

The two main algorithmic approaches for solving linear Chebyshev problems have their origin in the 1930s with the work of Remez [START_REF] Remes | Sur le calcul effectif des polynômes d'approximation de Tchebichef[END_REF][START_REF] Remes | Sur un procédé convergent d'approximations successives pour déterminer les polynômes d'approximation[END_REF] and are traditionally known as the "first" and "second" algorithms of Remez. Out of the two, the second one has garnered more notoriety over the years, in particular due to its wide adoption in Signal Processing, where it is more commonly known as the Parks-McClellan algorithm [START_REF] Parks | Chebyshev Approximation for Nonrecursive Digital Filters with Linear Phase[END_REF].

For completeness, we will present both methods, although our focus will be on the second Remez algorithm.

The second Remez algorithm

Let us give a broad overview of the inner workings of these iterative methods. The second Remez algorithm applies to Chebyshev families of functions and thus exploits the alternation property of the de La Vallée Poussin theorem. Essentially, it consists of retrieving a sequence of approximations with alternating error functions, that ultimately converge to the target minimax solution.

Consider the listing of Algorithm 2. To initialize the procedure, we can take n + 2 arbitrary distinct points x 1 i n+1 i=0 from X which will be used to determine the starting approximation p 1 ∈ S n to f (Step 1). Each collection of n + 2 such points appearing during the course of the algorithm is called a reference. At every iteration k, the current approximant p k is the solution of the minimax approximation problem on the current reference x k i n+1 i=0 (Step 2). Because of Theorem 3.9, fp k will alternate, with equal modulus |h k |, according to (3.2). Provided we are not already very close to the minimax result, we construct a new reference x k+1 i n+1 i=0 from the old one by a so-called exchange procedure. If this exchange satisfies (3.3) (i.e., one of the new reference points

x k+1 i has error of amplitude f -p k X,∞ and |h k | < f -p k X,∞ ), then we are certain to have |h k | < |h k+1 |.
To show this, we need the following:

Lemma 3.13. Let e ∈ C([a, b]) and {x i } n+1 i=0 a reference, such that (-1) i e(x i ) 0, i = 0, . . . , n + 1.
Then e has at least n + 1 zeros in [a, b], provided that any double zero is counted twice. A double zero is any zero strictly inside [a, b] where e does not change sign.

Proof. See [START_REF] Powell | Approximation Theory and Methods[END_REF]Thm. 7.5].

Algorithm 2: Second Remez algorithm Input: degree n ∈ N, compact subset X of [a, b], f ∈ C(X), a Chebyshev system S n = span R (ϕ i ) 0 i n over [a, b], convergence parameter threshold ε t > 0 Output: an element p(α, x) = n k=0 α k ϕ k (x) ∈ S n , where α ∈ R n+1 ,

close to optimal

Step 1 (Initialization) Set k = 1 and choose the starting reference set

x 1 i n+1 i=0 from X such that a x 1 0 < x 1 1 < . . . < x 1 n+1 b.
Step 2 Determine p k ∈ S n and h k ∈ R (the levelled error at iteration k), satisfying

e k (x k i ) = f (x k i ) -p k (x k i ) = (-1) i h k , i = 0, . . . , n + 1. (3.2)
Step 3 Construct the next reference a x k+1

0 < x k+1 1 < . . . < x k+1 n+1 b from X, such that λ(-1) i (f (x k+1 i ) -p k (x k+1 i )) |h k | , i = 0, . . . , n + 1, (3.3)
where λ ∈ {±1}, and for one i ∈ {0, . . . , n + 1}, the left hand side of (3.3) equals fp k ∞,X .

Step 4 By Theorem 3.10,

|h k | f -p ∞,X f -p k ∞,X . Unless the approximation is good enough (i.e., f -p k ∞,X -|h k | f -p k ∞,X ε t , in which case return p k (x) = p(α, x) = n i=0 α i ϕ i (x)), increment k and go to Step 2.
We thus have: Theorem 3.14. During the execution of Algorithm 2, if at a certain iteration, p k ∈ S n is not the best approximation to f on X, then there is a strict increase of the levelled reference error at the next iteration:

|h k | < |h k+1 | . Proof. Suppose that |h k | |h k+1 |.
Because of how the new reference is chosen, we have

e k+1 (x k+1 i ) e k (x k+1 i ) , i = 0, . . . , n + 1, (3.4)
with at least one of the inequalities being strict. Looking at the set

e k (x k+1 i ) -e k+1 (x k+1 i ) n+1 i=0 = p k+1 (x k+1 i ) -p k (x k+1 i ) n+1 i=0 ,
we see from expression (3.4) that ) for i = 0, . . . , n + 1, but since one of the inequalities of (3.4) is strict, we have a contradiction.

(-1) i+ (p k+1 (x k+1 i ) -p k (x k+1 i )) 0, ∈ {0, 1} , i = 0, . . . , n + 1,
Remark 3.15. The condition for the error of one of the new reference values to have magnitude fp k X,∞ in (3.3) can be relaxed for the previous result. Indeed, it is sufficient that there is at least one new reference element

x k+1 i satisfying f (x k+1 i ) -p k (x k+1 i ) > |h k | for Theorem 3.14 to hold.
Theorem 3.14 by itself is sufficient to show that Algorithm 2 converges. But to ensure that it converges to the minimax result (i.e., lim

k→∞ |h k | = f -p ∞,X
), two exchange strategies are widely considered in the literature for Step 3. The first one, a one-point exchange approach, changes at each iteration one appropriate reference point by bringing in one where the norm of the error is attained. A nice proof of its effectiveness is given by Powell in [168, Ch. 9.1-9.2] when X = [a, b], and we leave it to the interested reader to check that the reasoning used there works identically when we more generally have a compact

X ⊆ [a, b].
Traditionally, most of the computational work done during an iteration of Algorithm 2 goes into finding the global maximum of |e k (x)| over X. This normally involves computing all the local extrema of e k in X. Thus, it makes sense to consider a multi-point exchange strategy: swap all n + 2 current reference points by n + 2 local extrema of e k with sign alternating error values, where, for one of the new points, the modulus of the error attains its global maximum over X (see for instance [START_REF] Veidinger | On the numerical determination of the best approximation in the Chebyshev sense[END_REF] or [START_REF] Cheney | Introduction to Approximation Theory[END_REF]Ch. 3.8] for the precise exchange rules when X = [a, b], but also Section 3.8.3). A proof of convergence to the minimax result, again when X = [a, b], is given by Cheney [START_REF] Cheney | Introduction to Approximation Theory[END_REF]Ch. 3.8]. In terms of speed of convergence, his proof establishes a linear convergence to the minimax result. Veidinger [START_REF] Veidinger | On the numerical determination of the best approximation in the Chebyshev sense[END_REF] shows it to be in fact quadratic, provided that f and ϕ 0 , . . . , ϕ n+1 are twice differentiable and that the minimax error function e (x) = f (x)p (x) equioscillates between its extrema values exactly n + 2 times on [a, b]. This leads, at successive iterations k and k + 1, to:

e k+1 ∞,[a,b] -e ∞,[a,b] = O e k ∞,[a,b] -e ∞,[a,b] 2 . (3.5)
Based on our experiments, this quadratic behavior of a multi-point exchange rule generally holds for multi-interval domains X as well. Also, under the same regularity assumptions from [START_REF] Veidinger | On the numerical determination of the best approximation in the Chebyshev sense[END_REF] for the one point exchange strategy, Powell [START_REF] Powell | Approximation Theory and Methods[END_REF]] also shows a (n + 2)-step quadratic rate of convergence to p .

Remark 3.16. In terms of numerical implementations, it is perhaps fair to say that the topic has garnered more interest in the Signal Processing literature over the years than from numerical mathematicians. Not long after the publication of the article by Parks and McClellan [START_REF] Parks | Chebyshev Approximation for Nonrecursive Digital Filters with Linear Phase[END_REF], a first Fortran implementation of their ideas was presented in [START_REF] Mcclellan | A computer program for designing optimum FIR linear phase digital filters[END_REF]. It explicitly works on a discretized version of the design problem; at each iteration, the new reference set from Step 3 is chosen from a dense grid X d of points from X ⊆ [-1, 1], still a compact subset of [-1, 1]. The size of X d is taken to be large enough (the initial value advocated in [START_REF] Parks | Chebyshev Approximation for Nonrecursive Digital Filters with Linear Phase[END_REF] was 20n), with the hope that the solution will be close to the one over X. Computing the reference set for the next iteration is done using a multi-point exchange strategy and an exhaustive evaluation of e k (x) over X d . This early Fortran program is a starting point for current codes, like the firpm function from MATLAB's Signal Processing toolbox and the variations from [START_REF] Ahsan | Two Novel Implementations of the Remez Multiple Exchange Algorithm for Optimum FIR Filter Design[END_REF], or similar routines from Scilab, SciPy and GNURadio. We will explore more of this literature in Section 3.5.

The main elements which distinguish minimax FIR filter design approaches from most other function approximation-specific codes (some of which we introduce in the next paragraph) are:

• multi-interval domains and weighting functions versus working on X = [a, b];

• using the basis of Chebyshev polynomials (T k (x)) 0 i n over the monomial basis (x i ) 0 i n .

Besides the minimax routines available in well-known numerical and Computer Algebra software packages like Mathematica and Maple, which have been around for many years now, we would like to signal out two other recent efforts which greatly inspired and motivated our own work. The first one is the Sollya code we mentioned in Section 3.2.2, a fast C/C++ multiple-precision implementation of the second Remez algorithm, highly suitable for polynomial approximation of functions to be used in the development of mathematical libraries [START_REF] Lauter | Optimising polynomials for floating-point implementation[END_REF]. It can work with arbitrary finite-dimensional spaces S n of linearly independent continuous functions ϕ 0 , . . . , ϕ n , to approximate functions over [a, b]. The other is, reiterating Section 3.1, Chebfun remez. More recently, with the extension of Chebfun to handle periodic function approximation by using trigonometric polynomials [START_REF] Wright | Extension of Chebfun to periodic functions[END_REF] (see the basis from Example 3.7(a)), the trigremez command [START_REF] Javed | The Remez algorithm for trigonometric approximation of periodic functions[END_REF] was introduced; it computes best approximations with real coefficients to periodic functions on a closed interval.

The first Remez algorithm

The first Remez algorithm (summarized in the listing for Algorithm 3) is applicable to more general problems and also consists of solving a sequence of discrete problems, but this time of increasing size. It does not assume we are working with a Chebyshev system, only that the system matrix generated by the initial reference X 1 ⊆ X has full rank (Step 1). At each iteration k, the Chebyshev approximation problem on the finite set X k is solved and a point where the error function modulus reaches its norm is added to the new reference X k+1 (Step 2). The process continues until we are close enough to a best approximation over X (Step 3). A proof of convergence of h k to fp ∞,X for this procedure can be consulted in [START_REF] Cheney | Introduction to Approximation Theory[END_REF]Ch. 3.8]. Similarly to the second Remez algorithm, multiple exchange strategies can also be introduced in the hope of accelerating convergence [START_REF] Blatt | Exchange algorithms, error estimations and strong unicity in convex programming and Chebyshev approximation[END_REF][START_REF] Laurent | An algorithm of successive minimization in convex programming[END_REF].

Algorithm 3: First Remez algorithm Input: degree n ∈ N, compact subset X of [a, b], f ∈ C(X), a finite-dimensional space S n = span R (ϕ i ) 0 i n of linearly independent functions from C(X), convergence parameter threshold ε t > 0 Output: an element p(α, x) = n k=0 α k ϕ k (x) ∈ S n , where α ∈ R n+1 , close to optimal Step 1 (Initialization) Set k = 1 and choose a starting reference set X 1 ⊆ X containing n + 2 points {x i } n+1 i=0
such that the Vandermonde-like system matrix

V = [v ij ] := [ϕ j (x i )], i = 0, . . . , n + 1, j = 0, . . . , n has rank n + 1.
Step 2 Select a coefficient vector

α k ∈ R n+1 for which the error function e(α k , x) = f (x) -p(α k , x) is such that h k = e(α k , x) ∞,X k is minimal. Step 3 Pick x k ∈ X, a point where e(α k , x) ∞,X is attained. If e(α k , x) ∞,X -h k e(α k , x) ∞,X
ε t , then we are done and return p(α k , x). Otherwise, let X k+1 = X k ∪ x k , increment k and go to

Step 2.

It is worth discussing in a bit more detail the discrete linear Chebyshev approximation problem appearing in Step 2. A very interesting historical account of it is given by Watson [223,Sec. 2.4]. We will retread some of his notes in the following paragraphs.

Let us thus assume that X is a finite set containing at least n + 2 points. If the Haar condition is satisfied over X (i.e., for any choice of n + 1 distinct points from X, the determinant appearing in Definition 3.3 is different from zero), then, an exchange algorithm approach due to Stiefel [START_REF] Stiefel | Über diskrete und lineare Tschebyscheff-Approximationen[END_REF] can be used to determine p ∈ S n for which fp ∞,X is minimal. This ascent procedure is an extension of the one-point exchange version of Algorithm 2 and is characterized by the same behavior: the levelled error modulus is strictly increasing at successive iterations. Because there is only a finite number of (n + 2)-element references in X, the algorithm is guaranteed to finish in a finite number of steps. Descloux showed that the algorithm can also be made to work in the absence of the Haar condition, provided some appropriate changes [START_REF] Descloux | Dégénérescence dans les approximations de Tschebyscheff linéaires et discrètes[END_REF] are made.

Interestingly, but perhaps not that surprisingly, there is a strong link between the Stiefel exchange method and the simplex algorithm applied to the dual of the linear programming formulation of the discrete Chebyshev approximation problem. This was discussed by Stiefel in [START_REF] Stiefel | Note on Jordan elimination, linear programming and Tchebycheff approximation[END_REF], but the precise equivalence between a step of the dual simplex method and a step of the Stiefel exchange method was apparently only later given by Osborne and Watson [START_REF] Osborne | On the best linear Chebyshev approximation[END_REF]. An argument for preferring the Stiefel exchange algorithm is related to the fact that it seems to be more concise and efficient to implement than applying a general purpose simplex implementation. A series of articles [START_REF] Armstrong | A dual method for discrete Chebychev curve fitting[END_REF][START_REF] Barrodale | Algorithm 495: Solution of an Overdetermined System of Linear Equations in the Chebychev Norm[END_REF][START_REF] Barrodale | Algorithms for Best L 1 and L ∞ Linear Approximations on a Discrete Set[END_REF][START_REF] Bartels | Numerical Analysis: Stable numerical methods for obtaining the Chebyshev solution to an overdetermined system of equations[END_REF][START_REF] Hopper | A technique that gains speed and accuracy in the minimax solution of overdetermined linear equations[END_REF] discuss different approaches (in terms of efficiency and numerical results) for implementing such exchange/simplex-based methods. There is also a rich literature on descent methods which are related to the primal formulation of the discrete linear Chebyshev approximation problem. We will not go into them here, but refer the reader to [START_REF] Watson | Approximation in normed linear spaces[END_REF]Sec. 2.4] for some details and further references.

At the time of writing this thesis, we are not aware of any widely available implementations of the first Remez algorithm for univariate linear Chebyshev approximation. Even the Sollya remez routine, when dealing with systems S n which do not satisfy the Haar condition, uses a heuristic hybrid approach of the multi-point exchange version of Algorithm 2 and the one-point Stiefel exchange algorithm (see [START_REF] Chevillard | Évaluation efficace de functions numériques[END_REF]Ch. 2.2.7] for more details). Even though it offers no guarantee of theoretical convergence, the Sollya implementation works quite well in many situations when the Haar condition is not satisfied. In particular, if the routine terminates successfully, then Corollary 3.12 can be used to validate the quality of the result. Remark 3.17. A general and robust implementation of the first Remez algorithm needs an effective way of addressing singular problems, that is, instances where the solution on a continuum X has fewer that n + 2 points where the error modulus attains its norm. Note that for finite X, this situation does not occur; it is a feature of the fact that the corresponding system matrix has full rank [START_REF] Osborne | On the best linear Chebyshev approximation[END_REF]. The issue is explored by Osborne and Watson in [START_REF] Osborne | A note on singular minimax approximation problems[END_REF], where they argue that some of the reference points can coalesce, slowing down convergence and giving rise to ill-conditioned simplex bases. This is most likely to happen when the singular problem solution is unique. They exhibit this for the uniform approximation of f (x) = x 2 over [0, 2] using the basis (x, e x ), which has the solution

p (x) 0.18423256x + 0.41863122e x ,
and only two points of maximum deviation from f exist (as visible in Figure 3.1). A possible way of dealing with such problems might be the use of extended-precision and/or exact arithmetic linear programming solvers, in the vein of [START_REF] Gleixner | Improving the accuracy of linear programming solvers with iterative refinement[END_REF][START_REF] Gleixner | Iterative Refinement for Linear Programming[END_REF].

Our setting

In the rest of this chapter, we will mostly concentrate on describing an efficient approach for implementing the second Remez algorithm, with particular attention to multi-interval weighted polynomial approximation problems. Without any loss of generality, we take the domain X to be a subset of [-1, 1]. The bases we will be considering are of the form (w(x)T i (x)) 0 i n , where w ∈ C(X) is a positive function. Since a large motivation for this work is applications to digital filter design, we will frequently be switching between the frequency domain formulation we introduced in Section 2.2.3 and the notation we

Ω ⊆ [0, π] X ⊆ [-1, 1] ω x = cos(ω) cos(kω) T k (x) W (ω) w(x) = W (ω) W (ω)D(ω) f (x) = w(x)D(ω) W (ω)H(ω) p (x) = w(x)H(ω) p ∈ wP n (R) = span R (wx i ) 0 i n δ Ω = δ X = W (D -H) ∞,Ω = f -p ∞,X
used in Sections 3.2 and 3.3. The two main reasons for this is that the frequency domain setting is much more convenient to use when discussing the examples and references from the Signal Processing literature, whereas working with the change of variable x = cos(ω) is much better suited for presenting theoretical and implementation details related to the exchange algorithm. For convenience, the link between the two is summarized in Table 3.1. A typical use case for the exchange method is the design of lowpass filters, like the one in Figure 3

The role of multi-interval domains

.2, with Ω = [0, ω p ] ∪ [ω s , π], D(ω) = 1, 0 ω ω p , 0, ω s ω π, and
W (ω) = δs δp , 0 ω ω p , 1, ω s ω π,
where δ p and δ s denote the maximum errors allowed over [0, ω p ] (the passband ) and [ω s , π] (the stopband ).

Between pass and stopbands, we find transition bands. They are crucial here because their absence incurs jump discontinuities in the functions to approximate (at ω = ω p = ω s ), giving rise to the unwanted Gibbs-Wilbraham phenomenon (see [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 9] for a detailed description).

Some difficulties

In many situations arising in practice, the frequency response of a minimax filter inside transition regions is required to be monotonic or at least not present overshoots [START_REF] Oppenheim | Discrete-Time Signal Processing[END_REF][START_REF] Rabiner | Some Considerations in the Design of Multiband Finite-Impulse-Response Digital Filters[END_REF]: that is, on a transition band, H(ω) can only take values which are inside the interval determined by its minimum and maximum on the neighboring passband and stopband. Such restrictions are implicitly assured in most practical cases, even though they do not hold in general [START_REF] Rabiner | Some Considerations in the Design of Multiband Finite-Impulse-Response Digital Filters[END_REF].

-0.5 A huge unwanted spike is clearly visible in the transition region between the stopband and the second passband. Such a scenario is possible because, in the case of multi-band filters, the minimax problem results in a so-called underdetermined approximation polynomial H(ω) over Ω, meaning that some of the local extrema of H(ω) over [0, π] can occur inside transition regions (see the discussion from [START_REF] Shpak | A generalized Remez method for the design of FIR digital filters[END_REF]).

Such issues have been approached in different ways over the years. The most satisfactory solution seems to be the one advocated by Shpak and Antoniou [START_REF] Shpak | A generalized Remez method for the design of FIR digital filters[END_REF]. They propose extensions of Algorithm 2 for the design of maximal-ripple (MR) and extra-ripple (ER) filters. MR filters are those filters that have the maximum possible number of ripples in the magnitude response, while ER filters are those that have fewer ripples than the maximum, but more than the minimum n + 2 required by the equioscillation theorem. We will not go into details since such approaches are very similar to the classic multi-point exchange algorithm.

The methods of Shpak and Antoniou completely eliminate or significantly reduce the underdetermined nature of H(ω) that affects multi-band designs obtained using the exchange algorithm, thus ensuring monotonicity of H inside transition regions. This desirable behavior on the transition bands comes at the cost of not having explicit control on the value of the approximation error inside the pass and stop bands.

If we only need to contain the frequency response, we can adapt the initial specification using mild constraints on the problematic transition region [START_REF] Ahsan | Two Novel Implementations of the Remez Multiple Exchange Algorithm for Optimum FIR Filter Design[END_REF]Sec. 3]. For instance, by adding [0.51π, 0.59π] to Ω and extending D and W to take the values 0.5 and 0.25 on [0.51π, 0.59π], we obtain the second minimax filter from Figure 3.3, where the transition region response is now between 0 and 1. There is only a minor loss in quality with respect to the initial design (the minimax error δ Ω grows from 0.1172 to 0.1205). Another more involved approach of a similar nature (i.e., forcing a design problem on [0, π] instead of Ω) is described in [START_REF] Cortelazzo | An alternate technique for min-max design of multiband finite impulse response digital filters[END_REF]. Grenez [START_REF] Grenez | Design of linear or minimum-phase FIR filters by constrained Chebyshev approximation[END_REF] describes a version of the exchange algorithm which can also take into account lower and upper bound functions on the approximant to be computed. This constraint barrier method can limit the size of any ripples that might appear in the frequency response, which means it can be used to eliminate transition band anomalies by forcing suitable bounds. The downside is that in this setting as well, the resulting filter is under-determined. A similar approach is given in [START_REF] Mccallig | Constrained ripple design of FIR digital filters[END_REF].

Despite the focus on filter design problems, the routines we provide are more general. They can be used for arbitrary weighted minimax polynomial approximation problems involving multi-interval domains. Such a scenario arises, for instance, when minimizing the relative error of approximation for a function with zero(s).

As an example, consider the function f (x) = ln(x)e sin(x) . We want to find the polynomial p of degree at most n = 10, which best approximates f over [1 -2 -3 , 1 + 2 -3 ] in terms of relative error, implying the weight function w(x) = 1/ |f (x)| (the minimax result is then p = wp). Since f has a zero at x = 1, in a double-precision context, we can split the domain into two parts:

[1 -2 -3 , 0.99999999999999988897769753748434595763683319091796875] and [1.0000000000000002220446049250313080847263336181640625, 1 + 2 -3 ],
that is, remove all the values between the largest double-precision value smaller than 1 and the smallest double-precision value greater than 1.

Four key examples

We will be frequently using four filter design problems to highlight our approach. They are taken and/or adapted from the literature and prove to be hard or impossible to solve using current de facto minimax implementations.

The first two examples come from [START_REF] Psarakis | A robust initialization scheme for the Remez exchange algorithm[END_REF]. The next problem comes from [START_REF] Zahradnik | Robust analytical design of equiripple comb FIR filters[END_REF] and is related to the design of equiripple comb FIR filters.

Example 3.20. A unit weight type I linear phase filter with passband [0, 0.99π], stopband centered at π and degree n = 520.

Our last example is derived from [START_REF] Abu-Al-Saud | Efficient wideband channelizer for software radio systems using modulated PR filterbanks[END_REF]. There, the exchange algorithm acts as an intermediary step in designing efficient wideband channelizers. The lengths of the filters they use are proportional to the number of desired channels. In order to design a 8192-subchannel system, we can use: Example 3.21. A degree n = 13 • 4096 = 53248 unit weight type II lowpass filter with passband 0, 1 8192 π and stopband 3 8192 π, π .

Practical problems

Over the years, certain problems with implementing multi-interval exchange methods have been discussed in the literature. We give short accounts on the most important ones, previous solutions and how we address them in the sequel.

Robustness issues: initialization is a key step

During the 1980s, the need for obtaining high-order filters, with n = 200 . . . 500 or even larger became a concern. Examples of such application scenarios (along with references) are given in [START_REF] Ebert | Accelerated design of linear or minimum phase FIR filters with a Chebyshev magnitude response[END_REF][START_REF] Pelloni | On the design of high-order linear phase FIR filters[END_REF] and include the design of transmultiplexers and filter banks for high resolution spectral analysis.

The default strategy: uniform initialization

A good choice for the starting reference vector x 1 = (x 1 i ) 0 i n+1 becomes critical for practical convergence of the exchange algorithm for large degrees, even though theoretically, their placement inside X is not important. There are two main reasons for picking a good starting reference:

• reasonable execution time: a small number of iterations required for convergence;

• some starting references are much better conditioned numerically than others.

Historically, initialization for FIR filter design is carried out in the Ω setting. According to [11, p. 679], the basic idea is to take the references in a uniform way inside Ω. If this domain is formed from m distinct non-degenerate bands of widths W 1 , . . . , W m and we allocate an extrema at the left and right edge of each band, then the total bandwidth m i=1 W i of Ω should be divided into n + 2m intervals. This gives us an average distance between adjacent reference points of

d 0 = 1 n + 2 -m I i=1 W i .
Computing the number of intervals (n i ) 1 i m located in each band can now be accomplished if we round the quantities W i /d 0 to integers. This also allows us to readjust the distance between consecutive extrema inside each band, which we denote by (d i ) 1 i I . We get the following formulas

n i = W i d 0 + 1 , i = 1, . . . , m -1, n m = n + 1 - m-1 i=1
(n i + 1),

d i = W i n i , i = 1, . . . , n,
which allow us to compute the exact position of each initial ω 1 i . Recall that x 1 i = cos(ω 1 i ), i = 0, . . . n + 1. The approach when Ω is replaced by a discretization Ω d of equidistant points from Ω is even more simple. If the points of Ω d are ordered, the reference values are taken uniformly.

An empirical justification comes from a parallel with how one initializes the Remez algorithm on X = [-1, 1]. There, good choices are usually Chebyshev nodes of the second kind (see Section 2.1.1), which, in the Ω = [0, π] setting, map to a uniform grid.

Least-squares approximations

The problem with the uniform initialization approach of the previous paragraphs is that, for a large number of high-degree problems, it does not behave very well. An alternative strategy is presented in [START_REF] Psarakis | A robust initialization scheme for the Remez exchange algorithm[END_REF]. It seems to greatly reduce the number of iterations required for convergence compared to the classical initialization scheme. The idea is to first compute a certain optimal L 2 approximation with the same design constraints and take the local extrema of its approximation error as the initial reference set. Problem 3.22 (Least-squares FIR filter design). Let D(ω) and W (ω) be real valued functions, continuous on Ω and assume W to be positive over Ω and zero everywhere else. We want to determine the filter H(ω) = n k=0 h n cos(ωk), with corresponding weighted approximation error E(ω) = W (ω) (D(ω) -H(ω)), which minimizes the following least-squares measure

∆(h) = E(ω) 2,W = π 0 W (ω) (D(ω) -H(ω)) 2 dω,
where we denoted with h the coefficient vector

[h 0 • • • h n ] of H(ω).
We notice that this function is differentiable in each h k coefficient, thus at any extrema of ∆ the conditions ∂∆/∂h k = 0, k = 0, . . . , n must hold. Performing the differentiations, we obtain a linear system in h, defined by the equations

π 0 W (ω) (D(ω) -H(ω)) cos(ωk)dω = 0, k = 0, . . . , n.
The corresponding system matrix is invertible (see [START_REF] Cheney | Introduction to Approximation Theory[END_REF]Ch. 4.1] for a proof), and as such, the problem has a unique solution. Also, solving it can be done efficiently in O(n2 ) operations or less, by taking advantage of the special Toeplitz-plus-Hankel structure of the system (see [START_REF] Chandrasekaran | A Superfast Algorithm for Toeplitz Systems of Linear Equations[END_REF][START_REF] Merchant | Efficient solution of a Toeplitz-plus-Hankel coefficient matrix system of equations[END_REF] for more information), compared to the O(n 3 ) operation count we would get from using Gaussian elimination. One of the reasons to use the result of Problem 3.22 for choosing the starting reference values (ω 1 i ) 0 i n+1 is due to Theorem 2 from [START_REF] Psarakis | A robust initialization scheme for the Remez exchange algorithm[END_REF], which states that the least-squares solution exhibits at least n + 2 local extrema inside Ω. Equally important is the fact that L 2 designs such as these tend to behave well with respect to the minimax error measure (see [START_REF] Burrus | Multiband least squares FIR filter design[END_REF][START_REF] Burrus | Least squared error FIR filter design with transition bands[END_REF] for corresponding FIR filter design methodologies). Examples 3.18 and 3.19 with degrees ranging from 25 to 100 are used to highlight this approach. The results are compared to those obtained using the MATLAB firpm routine. In particular, designs where the firpm code requires a lot of iterations or does not even achieve convergence are handled without problem by using this initialization approach. Based on our own tests, this remains true even for more recent versions (R2014b) of MATLAB.

Other choices for the initial reference

Based on experimental observations for filter design (see [START_REF] Ebert | Accelerated design of linear or minimum phase FIR filters with a Chebyshev magnitude response[END_REF] for example), good initialization choices seem to be those where the final references in Ω are taken to be more densely packed near the interior edges of the pass and stop bands. Articles like [START_REF] Adams | On the fast design of high-order FIR digital filters[END_REF][START_REF] Pelloni | On the design of high-order linear phase FIR filters[END_REF][START_REF] Shpak | A generalized Remez method for the design of FIR digital filters[END_REF] try to compute some empiric distributions that fit this behavior. Using Carathéodory-Fejér (CF) near-best approximations [START_REF] Pachón | Barycentric-Remez algorithms for best polynomial approximation in the Chebfun system[END_REF]Sec. 3.6] is also an option 2 .

Potential shortcomings of the solutions we mentioned here is the fact that some are not general enough (only uniform weighted filters seem more appropriate for CF approximation) or that they prove to be too expensive when compared to uniform initialization. For the L 2 approach, its effectiveness for very large degrees rests on the numerical (in)stability of the Toeplitz-plus-Hankel solver used for dealing with Problem 3.22.

Our approach: In Section 3.6 we introduce two new heuristics for initializing the exchange algorithm. They are quite general and effective in practice, often leading to significant speedups when compared to existing implementations. Moreover, Section 3.7.2 introduces useful analysis tools for debugging numerical problems, which are, in particular, common for high-degree designs.

Scalability issues: speeding up the extrema search

The most computationally intensive part of Algorithm 2 is traditionally considered to be the search for potential extrema. For filter design, articles that concentrate on this aspect are [START_REF] Antoniou | Accelerated procedure for the design of equiripple nonrecursive digital filters[END_REF][START_REF] Antoniou | New Improved Method for the Design of Weighted-Chebyshev, Nonrecursive, Digital Filters[END_REF][START_REF] Bonzanigo | Some improvements to the design programs for equiripple FIR filters[END_REF]. The common denominator of all three approaches is that they use information pertaining to the first and/or second derivative of the error function e k (x).

In [START_REF] Antoniou | Accelerated procedure for the design of equiripple nonrecursive digital filters[END_REF], the strategy is to start at the elements of the current reference vector (x k i ) 0 i n+1 and evaluate the error only at those grid points of X d that tend to approach a potential extrema. The search direction for a given x k i is determined based on the sign of the first derivative of e k at that particular point. As the algorithm converges and the values of (x k i ) 0 i n+1 get closer to the actual extrema of the error function, this allows for a gradual reduction of the number of evaluations of e k and its derivatives. The author specifies that this leads on average to a reduction of about 50% in the number of error related evaluations compared to the FORTRAN implementation from [START_REF] Mcclellan | A computer program for designing optimum FIR linear phase digital filters[END_REF]. Examples for the design of two and three band filters are provided.

A similar strategy is presented inside [START_REF] Bonzanigo | Some improvements to the design programs for equiripple FIR filters[END_REF]. The extrema search consists of determining an analytic formula for e k (x) and locating its zeros, which will correspond to extrema of e k (x). It uses Brent's method (see [START_REF] Brent | Algorithms for Minimization Without Derivatives[END_REF]Ch. 4]) for computing the zeros of a nonlinear function. The average results provided seem to suggest a decrease in the computation time and in the number of required iterations.

The key remark of [START_REF] Antoniou | New Improved Method for the Design of Weighted-Chebyshev, Nonrecursive, Digital Filters[END_REF] is that, during the initial iterations of exchange algorithm, using one of the aforementioned methods might still require a considerable number of computations. Without concentrating here on the details, this is due to the fact that the actual extrema values to be determined are assumed not to be close to the starting points x 1

i . In such cases, the use of piecewise cubic or quadratic polynomial interpolation for approximating the error is proposed.

Again, it is argued that this solution works well for the design of FIR filters of up to three bands, with on average, 50% savings in computation time compared to just using the selective search from [START_REF] Antoniou | Accelerated procedure for the design of equiripple nonrecursive digital filters[END_REF]. Still, for multi-band designs, such a search strategy can fail to find all potential extrema, especially for large (n > 200) filter degrees. One possible reason is that the interpolation intervals might contain more extrema than the cubic or quadratic polynomial can accurately capture.

Our approach: The author of [START_REF] Antoniou | Accelerated procedure for the design of equiripple nonrecursive digital filters[END_REF][START_REF] Antoniou | New Improved Method for the Design of Weighted-Chebyshev, Nonrecursive, Digital Filters[END_REF] also admits that, although being fast, the approaches described in those papers come at the cost of slightly more convergence failures to the minimax result, than when using the code from [START_REF] Mcclellan | A computer program for designing optimum FIR linear phase digital filters[END_REF]. We will come back to the idea of using small degree interpolation polynomials for the error in Section 3.8 and describe a search strategy based on Chebyshev root-finding. Compared to [START_REF] Pachón | Barycentric-Remez algorithms for best polynomial approximation in the Chebfun system[END_REF], our domain subdivision routine is not recursive, making it very easy to introduce parallelism.

Initialization: two new heuristic approaches

We already hinted at the importance of starting an exchange method (of both the first and second Remez algorithm type) with an appropriate reference vector x 1 . Over the course of this section, we are going to consider two different, but closely connected, ways of looking at this problem in the (weighted) polynomial setting wR[x]. Both point to extremely important and classic issues in Approximation Theory.

The first one is interpolation. Consider Eq. (3.2) and treat h k as a constant. Then p k is a weighted polynomial of degree at most n which takes the values f (x k i ) + (-1) i+1 h k at the elements of the reference vector x k . Since it is generally expected for |h k | to be a small error value, we can see this as a perturbed interpolation of f at x k . What sets x k are good for interpolation?

The second idea is of an asymptotic nature. Do the equialternating sets to which the reference vectors x k converge follow a certain distribution over X as n tends to infinity? If the answer is yes, can this information be used in a numerical setting, as a robust way of starting the exchange algorithm?

Lagrange interpolation problems

The exposition and ideas of the next pages are based on [30-32, 47, 73, 195, 196]. We place ourselves in the general (multivariate) setting where

X ⊂ R d (or C d ) is a compact set, S n = span R (ϕ i ) 0 i n is a
finite-dimensional space of continuous functions over X and {x 0 , . . . , x n } ⊂ X is a finite set (we also use the vector x = (x i ) 0 i n ). Then, we can construct the Vandermonde-like matrix

V(x 0 , . . . , x n ) = [v ij ] := [ϕ j (x i )].
If det V(x 0 , . . . , x n ) = 0, then the set {x 0 , . . . , x n } is called unisolvent for interpolation in S n , which allows us to introduce the notion of Lagrange interpolation operator. It is defined as

L Sn,x f (x) = n i=0 f (x i ) i (x), (3.6)
where

i (x) = det V(x 0 , . . . , x i-1 , x, x i+1 , . . . , x n ) det V(x 0 , . . . , x i-1 , x i , x i+1 , . . . , x n ) , i = 0, . . . , n (3.7)
is called a Lagrange or cardinal basis (i.e., i (x k ) = δ ik ). L Sn,x f interpolates any function f at {x 0 , . . . , x n }. The norm of the interpolation operator L Sn,x :

C(X) → S n (also called Lebesgue constant) satisfies Λ Sn,X (x) := L Sn,x = max x∈X n i=0 | i (x)| . (3.8)
The Lebesgue constant provides us with a quantitative way of measuring the quality of the interpolation operator. Indeed, if L Sn,x is a linear projection operator, meaning

L Sn,x [L Sn,x f ] = L Sn,x f, ∀f ∈ C(X), L Sn,x (λf ) = λL Sn,x f, ∀f ∈ C(X), λ ∈ R, L Sn,x (f + g) = L Sn,x f + L Sn,x g, ∀f, g ∈ C(X),
then the following holds:

Theorem 3.23. For all f ∈ C(X), we have

f -L Sn,x f ∞,X (1 + Λ Sn,X (x))dist X (f, S n ), (3.9)
where the distance is taken with respect to the uniform norm over X.

Proof. The operator norm of L Sn is the smallest real number such that

L Sn,x f ∞,X Λ Sn,X (x) f ∞,X . Since S n is a finite-dimensional linear subspace of C(X), there exists a p ∈ S n such that f -p ∞,X = dist X (f, S n ) (see [168, Thm. 1.2], for instance). We have L Sn,x (f -p ) = L Sn,x f -p .
From the triangle inequality it then follows that

f -L Sn,x f ∞,X -f -p ∞,X L Sn,x f -p ∞,X = L Sn,x (f -p ) ∞,X Λ Sn,X (x) f -p ∞,X .
Remark 3.24. For an arbitrary family of nodes x ∈ X n+1 , its associated Lebesgue constant is independent of which basis S n is represented in. Indeed, all the determinants appearing in the previous computations are scaled by a factor given by the change of basis matrix, independent of the point set under consideration.

Because of Theorem 3.23, a question worth asking at this point is, how small can the Lebesgue constant of a family of points be? In case of polynomial approximation, the general conclusion is nicely summed up by the Hungarian mathematician Pál Turán, who says [208, p. 25]: "After ... the approximation theorem of Karl Weierstrass, it was hoped that there exists a (non-equidistant) system of nodes for which the Lagrange interpolation polynomials converge uniformly for every continuous function in [-1, 1]. The mathematical world was awakened from this dream in 1914 by Georg Faber who showed that there is no such system."

In practice, the situation is not as dire as Faber's result (see for instance [START_REF] Cheney | Introduction to Approximation Theory[END_REF]Ch. 6.5] for a precise statement and proof) might lead us to believe. If f is ν 0 times differentiable, then it is usually the case that the degree n Lagrange interpolant at Chebyshev nodes of the second kind (a Chebyshev interpolant, as defined in Section 2.1.2) achieves an accuracy of O(n -ν ). When f is analytic on [-1, 1] (for every x ∈ [-1, 1] f has a Taylor series expansion at that point and which converges to f in a neighborhood of x), the work of Bernstein [START_REF] Bernstein | Sur l'ordre de la meilleure approximation des fonctions continues par des polynômes de degré donné[END_REF] helps show that the rate of convergence for Chebyshev interpolants is even better, becoming O(C -n ), for some constant C > 1. For the precise details of these results (which also hold for the truncated Chebyshev series of f ) and further references, we recommend [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF].

The usefulness of Chebyshev nodes inside X = [-1, 1] is further supported by the fact that their associated Lebesgue constants grow at an extremely low rate as n → ∞: Theorem 3.25. The Lebesgue constants Λ Rn[x],[-1,1] associated to the mapping defined by a degree n 0 polynomial interpolation using any set of n + 1 distinct points from [-1, 1] satisfy

Λ Rn[x],[-1,1] 2 π log(n + 1) + γ + log 4 π ,
where γ ≈ 0.577 . . . is Euler's constant. Also,

• for Chebyshev nodes (of the first and second kind), we have an upper bound

Λ Rn[x],[-1,1] 2 π log(n + 1) + 1 and Λ Rn[x],[-1,1] ∼ 2 π log(n) as n → ∞
• for equispaced points,

Λ Rn[x],[-1,1] > 2 n-2 n 2 and Λ Rn[x],[-1,1] ∼ 2 n+1 en log(n)
as n → ∞.

Proof. See for instance [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 15] and the references therein.

Even in the weaker context where f is only Lipschitz continuous over [-1, 1], meaning that there exists a constant C > 0 such that |f (x)f (y)| < C |x -y| for all x, y ∈ [-1, 1], one of Jackson's theorems [START_REF] Jackson | Über die Genauigkeit der Annäherung stetiger Funktionen durch ganze rationale Funktionen gegebenen Grades und trigonometrische Summen gegebener Ordnung[END_REF] states that the minimax approximation

p ∈ R n [x] to f satisfies f -p ∞,[-1,1] πC n + 2 .
Based on Theorems 3.23 and 3.25, it means that even in this setting, Chebyshev interpolants will have at least an O log n n (uniform) rate of convergence. Thus, for practical purposes, Chebyshev nodes are essentially optimal when performing polynomial interpolation in [-1, 1], whereas equidistant nodes are usually a bad idea. But what about more intricate domains X?

More generally, a natural way to bound the value of the Lebesgue constant is by taking a set of points which minimize the absolute value of the denominator of (3.7) over X n+1 (so-called Fekete points), leading to i ∞,X 1 for every i and consequently Λ Sn,X (x) n + 1 in (3.8). The difficulty with computing Fekete points is that they require the solution of a (complicated) nonlinear optimization problem with d(n + 1) real (or complex) unknowns. In our setting, maybe the only truly satisfactory case where their analytical properties are well understood is the interval (i.e., it is known that for a degree n interpolation problem on [-1, 1], Fekete points correspond to the extrema of the n + 1 degree Legendre polynomial [START_REF] Stieltjes | Sur les polynômes de Jacobi[END_REF] and grow like O(log n)).

A reasonable idea worth considering is to simplify the problem by taking a suitable discretization Y of X,

Y = {y 0 , . . . , y m } ⊆ X, m > n,
construct the rectangular (m + 1) × (n + 1) Vandermonde-like matrix

V(y 0 , . . . , y m ) = [v ij ] := [ϕ j (y i )]
and extract from it a maximum volume (n + 1) × (n + 1) submatrix. Even in this discrete Fekete points setting, the problem we are trying to solve is NP-hard [START_REF] Magdon-Ismail | On selecting a maximum volume sub-matrix of a matrix and related problems[END_REF] in general. Despite this, we briefly present two heuristic greedy algorithms found in the literature, which tend to behave quite well in practice [START_REF] Bos | Computing multivariate Fekete and Leja points by numerical linear algebra[END_REF].

Approximate Fekete points

Suppose A = V(y 0 , . . . , y m ) t ∈ R (n+1)×(m+1) has full rank (true, if Y contains a subset of n + 1 elements satisfying the Haar condition for S n ). The idea behind the first alternative (implemented by Sommariva and Vianello [START_REF] Sommariva | Computing approximate Fekete points by QR factorizations of Vandermonde matrices[END_REF]) is to select the n + 1 columns a 0 , . . . , a n from A as follows: (1) a 0 is the column of maximum 2 norm and (2) having chosen a 0 , . . . , a k , the (k + 1) column is picked such that the volume generated by a 0 , . . . , a k , a k+1 is as large as possible.

The nodes from Y associated with the selected columns are called approximate Fekete points (AFPs). They can be computed quite efficiently using the well-established QR factorization with column pivoting of Businger and Golub [START_REF] Businger | Linear least squares solutions by Householder transformations[END_REF] as expressed in the listing for Algorithm 4. We refer the reader to [START_REF] Bos | On the calculation of approximate Fekete points: the univariate case[END_REF]Sec. 2] for the precise link between the two formulations.

Algorithm 4: AFP

Input: V(y 0 , . . . , y m ) full-rank matrix Output: a set X ⊂ Y containing n + 1 distinct elements that generates a large volume submatrix of

A = V(y 0 , . . . , y m ) t 1 (a) V 0 ← V(y 0 , . . . , y m ), P 0 ← I n+1 // initialization // successive orthogonalization 2 for k ← 0 to s -1 do 3 V k ← Q k R k , U k ← R -1 k 4 V k+1 ← V k U k , P k+1 ← P k U k // greedy algorithm for a maximum volume submatrix 5 (b) A ← V t s ; b ← (1, . . . , 1) t // any nonzero column vector b should work 6 w ← A -1 b // solve using column pivoting QR 7 (c) ind ← find(w = 0), X ← Y (ind)
// extraction of the AFPs 8 return X Remark 3.26. The greedy process for choosing the appropriate columns a k is in fact implemented by part (b) of Algorithm 4. Part (a) serves the purpose of managing rank-deficiency and ill-conditioning that might arise when working with nonorthogonal bases of S n , like the standard monomial basis for polynomial approximation. It performs a change of basis from (ϕ 0 , . . . , ϕ n ) to an (almost) discrete orthonormal basis (ϕ 0 , . . . , ϕ n ) = (ϕ 0 , . . . , ϕ n )P s , with respect to the inner product

f, g = m i=0
f (y i )g(y i ) using a sequence of QR decompositions [START_REF] Sommariva | Computing approximate Fekete points by QR factorizations of Vandermonde matrices[END_REF]Sec. 3]. About s = 1 or 2 iterations are generally sufficient in practice, provided the initial matrix V(y 0 , . . . , y m ) is not too ill-conditioned with respect to the numerical precision used for the computations. At the end of execution, part (c) outputs X as the set of elements from Y whose corresponding terms inside w are different from zero, that is, if y i ∈ Y and w i = 0, then y i ∈ X . Also, the computed AFPs will depend on the choice of basis.

Leja points

Let us consider (ϕ 0 , . . . , ϕ n ) to be an ordered basis of S n . We define a sequence of points ξ 0 , . . . , ξ n ∈ X to be Leja points for X, up to dimension n + 1 = dim S n , if they are constructed as follows.

In the beginning, ξ 0 is taken to be a max argument of |ϕ 0 | on X (each such point gives rise to a different Leja sequence). At a certain moment when the points ξ 0 , . . . , ξ k-1 have been chosen, ξ k ∈ X is taken as a max point of the function

x → |det V k (ξ 0 , . . . , ξ k-1 , x)| , where V k (x 0 , . . . , x k ) = [v ij ] := [ϕ j (x i )], i = 0, . . . , k, j = 0, . . . , k.
A first variant of this procedure was introduced by Leja [START_REF] Leja | Sur certaines suites liées aux ensembles plans et leur application à la représentation conforme[END_REF] (he called ξ 0 , . . . , ξ n extremal sequence), in the context of polynomial approximation over a compact X ⊂ C. The greedy aspect of the approach to obtain a set of points that generate a large volume matrix is easily noticeable. By definition, at each iteration, the running sequence ξ 0 , . . . , ξ k , are Leja points for the basis (ϕ 0 , . . . , ϕ k ).

Algorithm 5: DLP

Input: V(y 0 , . . . , y m ) full-rank matrix Output: X ⊂ Y with n + 1 distinct elements, generating a large volume submatrix of V(y 0 , . . . , y m )

1 A ← V(y 0 , . . . , y m ) 2 [L, U, σ] ← LU(A, 'vector')
// perform a partial (row) pivoting LU factorization of A // σ is the corresponding permutation vector of the rows of

A 3 ind ← (σ 0 , . . . , σ n ), X ← Y (ind) 4 return X
When X is infinite, determining a Leja sequence using the ideas of the preceding paragraphs can be impractical. That is why, just like for AFPs, it is generally preferable to work on a finite subset Y ⊂ X. Such discrete Leja points (DLPs) can also be computed using standard tools from numerical linear algebra, namely the LU decomposition with partial pivoting, as expressed in Algorithm 5. An explanation as to why this is possible can be consulted in [30, Sec. 6.1-6.2].

There is a large literature on Leja points, both on its theoretical and computational aspects (see for instance [START_REF] Bos | Computing multivariate Fekete and Leja points by numerical linear algebra[END_REF]Sec. 6] and the references therein). We remark, in particular, the use of the ordering they give to improve the conditioning in evaluating the Newton form of polynomial interpolation [START_REF] Reichel | Newton interpolation at Leja points[END_REF].

Polynomial meshes and an AFP-based approach

We want to use either Algorithm 4 or 5 to construct a suitable starting reference for the second Remez algorithm. To do so, we still need a constructive way of discretizing X ⊂ R d . Consider the polynomial space

R n [x 1 , . . . , x d ].
In a 2008 paper, Calvi and Levenberg [START_REF] Calvi | Uniform approximation by discrete least squares polynomials[END_REF] propose attacking the problem of finding particular families of points which prove to be efficient for doing Lagrange interpolation by means of discretization processes used in Numerical Analysis. Their approach is to focus beforehand on the following L 2 problem: Problem 3.27 (Least squares approximation). Given the values f (y), where y ∈ Y (Y ⊂ X), we want to find a polynomial p of given degree that minimizes y∈Y |f (y)p(y)| 2 .

Theorems 1 and 2 from [START_REF] Calvi | Uniform approximation by discrete least squares polynomials[END_REF] give a way to relate the least squares solution over Y with the uniform approximation error of p over X ( [47, Thm. 2] essentially gives a result for p which is similar to Theorem 3.23 for Lagrange interpolation). They show that the geometry of X plays an important role in picking a set Y of reasonable size for which p is a good approximation of f over X.

If X is a polynomially determining compact set (i.e., polynomials vanishing on X are identically zero), a weakly admissible mesh (WAM) is defined to be a sequence of discrete subsets Y n ⊂ X such that:

p ∞,X C(Y n ) p ∞,Yn , ∀p ∈ R n [x 1 , . . . , x d ], (3.10)
where both card In terms of their properties, we mention the following (adapted from [START_REF] Calvi | Uniform approximation by discrete least squares polynomials[END_REF]):

(Y n ) dim(R n [x 1 , . . . , x d ]) = n+d
P1 C(Y n ) is
f ∈ C(X) over Y n satisfies f -p n ∞,X 1 + C(Y n ) 1 + card(Y n ) dist X (f, R n [x 1 , . . . , x d ])
P7 Fekete points: the Lebesgue constant of Fekete points extracted from a WAM can be bounded like

Λ Rn[x1,...,x d ],X dim(R n [x 1 , . . . , x d ])C(Y n ).
Property P5 is a consequence of [START_REF] Calvi | Uniform approximation by discrete least squares polynomials[END_REF]Thm. 5]. It gives a constructive way of finding admissible meshes when Markov-like inequalities are available. For example, a classic instance is the following

p ∞,[-1,1] (deg p) 2 p ∞,[-1,1] , ∀p ∈ R[x]. (3.11)
In such cases, the conditions from the definition of an admissible mesh are guaranteed by virtue of metric properties. If Y n is such a set that for each x ∈ X there exists y ∈ Y n with xy ∞ ε n where ε n = O(1/n r ) as n → ∞, then the sequence Y n forms an AM (see proof of [START_REF] Calvi | Uniform approximation by discrete least squares polynomials[END_REF]Thm. 5]).

Property P7 is a consequence of (3.8) and (3.10). It tells us that taking as interpolation nodes Fekete points of WAMs, we generally get good quality Lagrange interpolants.

Even though the main interest in WAMs seems to be multivariate (d > 1) polynomial approximation, [START_REF] Sommariva | Approximate Fekete points for weighted polynomial interpolation[END_REF] shows their usefulness in the weighted univariate setting as well, which prompted us to consider them here. There are two families of meshes which are computationally easy to construct:

Example 3.28. Admissible meshes on X ⊂ R for S n = R n [x]
From (3.11), we have r = 2 in P5. Based on the previous paragraphs, if we take Y n composed of equispaced points inside [-1, 1], such that the distance between two consecutive ones is smaller than

2/n 2 (meaning card(Y n ) = O(n 2 ) > dim R n [x] = n + 1), then (Y n ) becomes an AM for [-1, 1]. When X = [a 1 , b 1 ] ∪ . . . ∪ [a k , b k ],
by the previous construction, P1 and P4, we can obtain an AM for X containing O(kn 2 ) points. If y n is a vector of Fekete points for such a mesh, P7 tells us that

Λ Rn[x],X (y n ) O(n). Example 3.29. Weakly admissible meshes on X ⊂ R for S n = R n [x]
The quadratic number of points for AMs obtained from Markov-like inequalities may be unappealing when dealing with high degree problems. In that case, it can be more interesting to consider WAMs which have a much lower cardinality.

From Theorem 3.25 and P2, if (Y n ) is an appropriate sequence of Chebyshev nodes of increasing degree, it will be a WAM on [-1, 1] with C(Y n ) = O(log n). Analogous to the previous example, by using P1 and P4, we can construct WAMs for finite unions of closed intervals in R. If X is a union of k such intervals, then Y n will have size O(kn). The Lebesgue constant of any of its y n Fekete point vectors will satisfy

Λ Rn[x],X (y n ) O(n log n).
The appeal of using Algorithms 4 and 5 on any weakly admissible mesh Y n ⊂ X rests on the fact that the resulting AFPs and DLPs will have the same asymptotic distribution as the true Fekete points over X (in the sense that their corresponding discrete probability measures converge weak-to the (pluri)potential equilibrium measure of K). These results are made explicit in [31, Thm. 1] and [START_REF] Bos | Computing multivariate Fekete and Leja points by numerical linear algebra[END_REF]Thm. 6.2].

It seems that approximate Fekete points are usually of slightly better quality (in terms of Lebesgue constant values and interpolation errors) than discrete Leja points, which, on the other hand, require a bit less time to compute. This is exemplified in [START_REF] Bos | Computing multivariate Fekete and Leja points by numerical linear algebra[END_REF][START_REF] Bos | Geometric weakly admissible meshes, discrete least squares approximations and approximate Fekete points[END_REF] for several two dimensional problems. Because of this, we have preferred AFP-based starting references to DLP-based ones in the sequel.

Incorporating weight functions into the problem

We can extend the previous paragraphs to the wR n [x 1 , . . . , x d ] setting as well. The weighted interpolation operator is strongly linked to the non-weighted one by uniqueness:

L wRn[x1,...,x d ],x f (x) = w(x)L Rn[x1,...,x d ],x g(x), f = wg and consequently f -L wRn[x1,...,x d ],x f ∞,X = w(g -L Rn[x1,...,x d ],x g) ∞,X .
The principal idea to notice is that, in many cases, WAMs for non-weighted polynomial interpolation give rise to very good interpolation nodes in the weighted setting, assuming w = 0 over X. Indeed, if Y n is a weakly admissible mesh in the non-weighted setting (i.e., p

∞,X C(Y n ) p ∞,Yn , ∀p ∈ R n [x 1 , . . . , x d ]), it follows that wp ∞,X = |w(x * )p(x * )| |w(x * )| p ∞,X |w(x * )| C(Y n ) p ∞,Yn = |w(x * )| C(Y n ) |p(µ)| , for certain x * ∈ X, µ ∈ Y n .
Thus, by the positivity of w over X, we get

wp ∞,X |w(x * )| |w(µ)| C(Y n ) |w(µ)p(µ)| max x∈X |w(x)| min x∈Yn |w(x)| C(Y n ) wp ∞,Yn = w ∞,X 1/w ∞,Yn C(Y n ) wp ∞,Yn . If we take C w (Y n ) = w ∞,X 1/w ∞,Yn C(Y n ),
we can rewrite the previous inequality as

wp ∞,X C w (Y n ) wp ∞,Yn .
It then follows from (3.8) that the weighted Fekete points y n of the space wR n [x 1 , . . . , x d ] over Y n have a Lebesgue constant over X which is bounded like

Λ wRn[x1,...,x d ],X (y n ) C w (Y n ) n + d d .
Such bounds are usually overestimates of the actual ones. We can try improving them by using a combination of P1-P7. Possible approaches include taking advantage of X's structure (if it is a finite union of compact sets) and trying to come up with Markov-like inequalities for weighted polynomial approximation.

The actual rate of increase of Lebesgue constants associated to AFPs extracted from AMs and WAMs seems to be much smaller in practice, with [START_REF] Sommariva | Approximate Fekete points for weighted polynomial interpolation[END_REF]Sec. 3] showing several weighted multi-interval examples where it is O(log n), something we also experienced in our tests.

FIR filter design weighting functions

A typical instance of minimax FIR filter design involves a domain X ⊆ [-1, 1], X = k i=1 X i , where the X k 's are disjoint closed intervals. The weighting function is usually of Jacobi-type, in the sense that

w(x) = w k (1 -x) α (1 + x) β , x ∈ X k , w k ∈ R, w k > 0,
where (α, β) ∈ {(0, 0), (1/2, 0), (0, 1/2), (1/2, 1/2)} and each possible value of (α, β) corresponds to one of the four basic filter types introduced in Section 2.2.3, as summarized in Table 3. [START_REF] Achieser | On extremal properties of certain rational functions[END_REF].

Consider now that we construct a WAM for X using Chebyshev nodes of the second kind, via Example 3.29. On each X i = [a i , b i ] we have a grid Y n,i of size n + 1, which contains a i and b i . Then w will achieve its maximum and minimum value over X i (and Y n,i ) at one of these nodes or possibly at 0 if 0 ∈ X i and we are dealing with a type III filter. In all cases, this implies

w ∞,Xi 1/w ∞,Yn,i = O(1), meaning that over Y n = k i=1 Y n,i , C w (Y n ) = O(C(Y n )) = O(log n).
Examples are discussed in Section 3.6.4.

Filter type

W (ω) w(x) I 1 1 II cos ω 2 [(1 + x)/2] 1/2 III sin(ω) (1 -x 2 ) 1/2 IV sin ω 2 [(1 -x)/2] 1/2
3.6.3 A reference scaling idea

The limit behavior of (weighted) minimax polynomial approximation problems is an important subject of Potential Theory [START_REF] Levin | Potential Theoretic Tools in Polynomial and Rational Approximation[END_REF]. Of particular interest to us is the fact that, asymptotically, the final reference sets of minimax approximations and the zeros of the minimax error follow a certain distribution over X, called the equilibrium distribution of X (see, for instance, [START_REF] Shen | The Potential Theory of Several Intervals and Its Applications[END_REF]Sec. 5] for the necessary theoretical results).

Computing it, in all but the simplest setting (the interval), is an involved procedure [START_REF] Embree | Green's Functions for Multiply Connected Domains via Conformal Mapping[END_REF][START_REF] Shen | The Potential Theory of Several Intervals and Its Applications[END_REF], requiring the use of elliptic integrals and numerical conformal mapping. An important element developed in the aforementioned articles, confirmed experimentally in our tests, is that the number of reference values for minimax polynomial approximants inside each interval of X is directly proportional with the degree. As an example, we consider the design specification from Example 3.19 and look at what happens when uniform initialization is used within the exchange algorithm. The a/b entries in Table 3.3 show the number of reference points inside each band before the first iteration (the a value) and upon convergence (the b value), for three different degrees. As expected, the b values tend to be proportional with n, while for the second and third band, the corresponding a and b become further apart as n → ∞.

This behavior allowed us to develop a relatively fast and very simple to implement heuristic for choosing an initial reference. The core of the approach is that, if, for a degree n approximation, we first compute the minimax result of degree n/2 , then we have a very good idea on the number of reference values to put inside each band for the degree n problem. The values of the new reference set x are established by taking the n/2 + 2 final references of the smaller result and adding the remaining nn/2 points uniformly between them, thus ensuring a similar distribution of the references inside X for the two degrees. If needed, this strategy can be applied recursively. Since it is based on asymptotic results, this idea works best for high degree designs, where the AFP and DLP strategies become too expensive.

Numerical examples

Performance-wise, Table 3.4 shows some results when considering Examples 3.18 to 3.21. For each entry of the Iterations columns, the first value corresponds to the uniform initialization technique, while the second and third ones represent our scaling and AFP approaches. We can observe that, in many cases, there is a considerable reduction in the number of iterations required for convergence. This frequently translates to smaller execution times as well, despite a more involved setup of the starting references. Still, the biggest advantage of these heuristics is that often, they allow us to address, in a simple manner, filter design problems where uniform initialization gives rise to numerical instability issues and the implementation does not converge (NC). We also tried the strategies from [START_REF] Psarakis | A robust initialization scheme for the Remez exchange algorithm[END_REF][START_REF] Shpak | A generalized Remez method for the design of FIR digital filters[END_REF], but encountered numerical problems on [START_REF] Psarakis | A robust initialization scheme for the Remez exchange algorithm[END_REF], the quadratic linear solver used to determine the least-squares optimal filter did not work accurately, while for the heuristic of [START_REF] Shpak | A generalized Remez method for the design of FIR digital filters[END_REF], the starting reference did not contain a good proportion of values inside each band for the algorithm to converge numerically.

In dealing with Example 3.20 we applied reference scaling two times, starting from a degree n = 130 filter and then moving up to n = 260 and finally n = 520. We only needed 4, 3 and 3 iterations for convergence. AFP initialization performed even better, only requiring one iteration. For Example 3.21, we again applied reference scaling two times, for a number of 6, 3 and 3 iterations, whereas AFP proved to be too costly. Note that, actually, convergence with uniform initialization for Examples 3.19 and 3.20 (the two * -ed cases) occurs in spite of numerical problems: this behavior is fortunate and does not generally happen in such a bad numerical context. See also Remark 3.30 for more insight.

Minimax

Uniform initialization Chebyshev WAM + AFP Reference scaling Tables 3.5 and 3.6 give more details on the execution of the exchange algorithm. We see that in both the case of AFP-based references and scaled ones, the starting levelled errors h 1 are quite close to δ X (which is not generally true when uniform initialization is used). Since the levelled error h k strictly increases at each step and converges to δ X , we expect that the number of iterations to be generally small. Equally important is the fact that the number of reference values inside each band at the start of the exchange algorithm are very close (if not equal) to their values upon convergence. Intuitively, this means that not a lot of iterations will be spent on moving references between intervals.

Degree f -p ∞,X Distribution f -p 1 ∞,X |h 1 | Initial distribution f -p 1 ∞,X |h 1 | Initial distribution f -p 1 ∞,X |h 1 | Initial distribution n = 50 5.

Minimax Uniform initialization Chebyshev WAM + AFP Reference scaling

Degree f -p ∞,X Distribution f -p 1 ∞,X |h 1 | Initial distribution f -p 1 ∞,X |h 1 | Initial distribution f -p 1 ∞,X |h 1 | Initial distribution n = 50 5.
Inside the test files, we have also provided code for the design of over 70 different filters that are considered high degree (with n in the order of hundreds and thousands). While the reduction in number of iterations, when computable, was very variable (savings from 0% to over 70% compared to uniform initialization were observable on most of the examples), reference scaling always ensured convergence, whereas for more than 30% of the considered filters, uniform initialization failed to converge. The AFP-based idea also performed very well, with only a small percentage (around 5%) of the tests failing. The examples where this happened had degree n 1000 and were much better suited for the scaling approach.

Computing the current approximation

Making abstraction of the iteration number k, Step 2 of Algorithm 2 asks one to, for a given reference vector

x ∈ R n+2 , determine p ∈ wR n [x] and h ∈ R such that f (x i ) -p(x i ) = (-1) i h, i = 0, . . . , n + 1. (3.12) By taking p(x) = n i=0 α i w(x)T i (x) and g(x) = f (x) w(x)
, we can express (3.12) in linear system form

          1 T 1 (x 0 ) T 2 (x 0 ) • • • T n (x 0 ) 1 w(x 0 ) 1 T 1 (x 1 ) T 2 (x 1 ) • • • T n (x 1 ) -1 w(x 1 ) . . . . . . . . . . . . . . . 1 T 1 (x n+1 ) T 2 (x n+1 ) • • • T n (x n+1 ) (-1) n+1 w(x n+1 )                  α 0 α 1 . . . α n h        =        g(x 0 ) g(x 1 ) . . . g(x n ) g(x n+1 )       
This system has a unique solution, since the (n + 2) × (n + 2) matrix is non-singular (see [START_REF] Veidinger | On the numerical determination of the best approximation in the Chebyshev sense[END_REF] for a proof idea). It is also a consequence of Theorem 3.9. According to [START_REF] Antoniou | Digital Signal Processing: Signals, Systems, and Filters[END_REF]Ch. 15.3.3] and [START_REF] Oppenheim | Discrete-Time Signal Processing[END_REF]Ch. 7.7.3], solving it directly is not encouraged, since it is computationally inefficient and susceptible to numerical ill-conditioning.

In practice, one deduces h analytically and uses barycentric Lagrange interpolation to determine p (i.e., the original choice of [START_REF] Parks | Chebyshev Approximation for Nonrecursive Digital Filters with Linear Phase[END_REF]). The entirety of this section focuses on the numerical stability of this approach and that of computing h during the execution of the exchange method.

Barycentric interpolation formulas

In recent years, barycentric interpolation has become an active research topic in Numerical Analysis. This is mostly due to the good numerical properties of this interpolation scheme [START_REF] Berrut | Barycentric Lagrange Interpolation[END_REF][START_REF] Floater | Barycentric rational interpolation with no poles and high rates of approximation[END_REF].

The basic setting is the following: if f : [a, b] → R and n ∈ N, let x ∈ R n+2 be a vector of distinct interpolation points x k ∈ [a, b], k = 0, . . . , n + 1, given in increasing order, together with y ∈ R n+2 , where y k = f (x k ), k = 0, . . . , n + 1. We want to find a polynomial p x with real coefficients of degree at most n + 1 which interpolates f at x (i.e., p x (x k ) = y k , k = 0, . . . , n + 1).

According to Rutishauser [START_REF] Rutishauser | Vorlesungen über Numerische Mathematik[END_REF], the barycentric forms of p x are given by

p x (x) = (x) n+1 k=0 w k x -x k y k , (3.13)
known as the first barycentric interpolation formula, and

p x (x) = n+1 k=0 w k x -x k y k n+1 k=0 w k x -x k , (3.14)
the second (or proper ) barycentric formula, where (x) = n+1 i=0 (xx i ) and If the barycentric weights w k have been precomputed, both (3.13) and (3.14) can be evaluated with only O(n) arithmetic operations at an arbitrary point x, the same complexity as Newton's interpolation formula once the corresponding divided differences have been determined. An essential difference between the two is the fact that divided differences have to be recomputed for each new f , whereas the w k 's only depend on the interpolation grid (see [START_REF] Berrut | Barycentric Lagrange Interpolation[END_REF]Sec. 3] for a discussion on Newton versus barycentric Lagrange interpolation).

w k = 1 (x k ) = 1 i =k (x k -x i ) , k = 0, . . . , n + 1. ( 3
In most practical situations, equation (3.14) is usually preferred. One of the reasons for this, as pointed out by Berrut and Trefethen [START_REF] Berrut | Barycentric Lagrange Interpolation[END_REF], is that the symmetry afforded to it by the presence of weighting functions in both numerator and denominator helps it avoid some underflow and/or overflow issues when n is very large (i.e., in the order of thousands or more).

By changing the w k 's to take other non-zero values, then (3.16) will no longer be valid and (3.14) will become a rational function interpolating f at the x i 's. This more general setting was first explored by Schneider and Werner [START_REF] Schneider | Some new aspects of rational interpolation[END_REF]. Moreover, Berrut and Mittlemann [START_REF] Berrut | Lebesgue constant minimizing linear rational interpolation of continuous functions over the interval[END_REF] show that any rational interpolant to f at the points x 0 , . . . , x n+1 , having numerator and denominator degrees not exceeding n + 1 can be written in barycentric form (3.14) for some choice of weights. One reason for considering barycentric rational interpolants is that they can be good choices when doing fitting on equispaced data (we refer in particular to the family of Floater-Hormann interpolants [START_REF] Floater | Barycentric rational interpolation with no poles and high rates of approximation[END_REF]) where polynomials can behave very badly due to the Runge phenomenon [START_REF] Runge | Über empirische Funktionen und die Interpolation zwischen äquidistanten Ordinaten[END_REF]. A classical example is to take the function f

(x) = 1 1+25x 2 , x ∈ [-1, 1],
where polynomial interpolants at the nodes x i = -1 + 2i n , i = 0, . . . , n actually diverge when n → ∞, a result which should not be that surprising if we consider the last part of Theorem 3.25.

To use barycentric interpolation for our evaluation of p(x), we first compute h using the formula

h = n+1 k=0 w k f (x k ) w(x k ) n+1 k=0 (-1) k w k w(x k ) (3.17)
(see [START_REF] Pachón | Barycentric-Remez algorithms for best polynomial approximation in the Chebfun system[END_REF]Sec. 3.3] for a proof idea). We then have

p(x) = w(x)p x (x) = w(x) n+1 k=0 w k x -x k f k n+1 k=0 w k x -x k (3.18) where f k = f (x k ) w(x k ) -(-1) k h w(x k ) and w = (w i ) 0 i n+1 ∈ R n+2
is the weight vector whose elements are determined according to (3.15).

Numerical stability issues

The evaluation of (3.17) and (3.18) is split into the computation of the barycentric weights (done once for each new reference vector x) and of the sums in the numerators and the denominators. For a numerically robust evaluation of the w k 's (O(n 2 ) operations), we use the formulas and ideas of [START_REF] Berrut | Barycentric Lagrange Interpolation[END_REF]Sec. 7] and [START_REF] Pachón | Barycentric-Remez algorithms for best polynomial approximation in the Chebfun system[END_REF]Sec. 3.4]. Notice that inside (3.18) we are using n + 2 points to interpolate a polynomial of degree at most n. This is intentional. We could have easily picked only a subset of n + 1 elements of x, but leaving out one element can pose numerical problems, especially if that point is the smallest or largest one from x [START_REF] Webb | Stability of Barycentric Interpolation Formulas for Extrapolation[END_REF].

The current levelled error

Let α x and β x be the numerator and denominator values of h in formula (3.17). For the remainder of this section, unless otherwise stated, all elementary operations are performed in round-to-nearest double-precision arithmetic with unit roundoff u = 2 -53 . Central to our analysis is the summation condition number [153, Ch. 6.1]: given n real values a 0 , . . . , a n-1 whose sum s n = n-1 k=0 a k we want to compute, its corresponding condition number is

C n = n-1 k=0 |a k | / n-1 k=0 a k .
If we only have access to perturbed versions âk = a k (1 + ε k ), k = 0, . . . , n -1 of the input terms, then the relative error

E n of computing ŝn = n-1 k=0 âk is upper bounded by max k |ε k | C n . Indeed, E n = |ŝ n -s n | |s n | = n-1 k=0 ε k a k n-1 k=0 a k n-1 k=0 |ε k | |a k | n-1 k=0 a k max k |ε k | n-1 k=0 |a k | n-1 k=0 a k .
Even if the perturbations are as small as possible with the current arithmetic, meaning ε k = O(u), k = 0, . . . , n -1, if there is severe cancellation in computing s n and C n u -1 , then E n will most likely be greater than 1 and give totally inaccurate results. Since α x and β x are obtained using finite precision arithmetic, in certain situations, there is pronounced numerical cancellation when computing α x . This can happen when:

• the minimax error at the end of executing the exchange algorithm is very small (in the sense of being relatively close to or smaller than u);

• the final minimax error is much larger than u, but the starting leveled error h is in the order of u or much smaller.

In practice, the second bullet point is more likely to occur than the first one, since polynomial filters with minimax error δ X < 10 -10 ( u ∼ 10 -16 ) seldom seem to be required. When using uniform initialization, such issues are not hard to find, as they sometimes occur in the starting iteration(s) of the exchange method. Consider, for instance, the specification from Example 3.20. Although the final alternating error is around 1.6067 • 10 -7 , the first iteration should give h 1.521 • 10 -21 u and a condition number for α x of about 6.572 • 10 20 72967 • u -1 . Because of this extreme ill-conditioning, a double-precision computation of h gives a wrong value of 5.753 • 10 -19 .

Based on our discussion up to this point, we propose two possible solutions:

1. use a higher precision arithmetic for doing all computations in the current iteration (barycentric weights, h and local extrema of e(x) = f (x)p(x));

2. pick a better starting reference (see initialization strategies from Section 3.5.1).

The first alternative is generally the safest, but costlier choice. From our experience, around 150-200 bits of precision are more than enough for the problems discussed here. Hence, the MPFR-based version of our code uses 165 bits of precision by default. Once enough iterations have passed and the current condition number for α x is sufficiently small (i.e., smaller than say 10 8 ), there is a good chance that using double-precision arithmetic for the remaining iterations will still lead to an acceptable result.

For the second strategy, the basic intuition is that the starting h should be much larger and closer to the minimax one (see also Tables 3.5 and3.6). This consequently implies that the condition number for α x is much smaller compared to u -1 and the summations are more stable. To illustrate this, we again consider Example 3.20, but this time, use the reference scaling strategy from Section 3.6.3. The initial leveled error is h 1.456 • 10 -7

u -1 and the condition number for α x is around 6.864 • 10 6 . Double-precision computations are again quite viable. Since it usually results in much smaller execution times, we recommend starting with this second approach.

Numerical problems are much less likely to occur when computing β x . Since we assume the interpolation nodes x are ordered by value, the barycentric weights w i alternate in sign. This means that all the terms of β x have the same sign and hence, its condition number has value 1.

Lebesgue constants as tools for detecting numerical problems

The numerical stability of (3.13) and (3.14) over [-1, 1] was first looked at in a rigorous manner by Rack and Reimer [START_REF] Rack | The numerical stability of evaluation schemes for polynomials based on the Lagrange interpolation form[END_REF] and later refined by Higham [START_REF] Higham | The numerical stability of barycentric Lagrange interpolation[END_REF]. This second reference shows how the modified Lagrange formula (3.13) is backward stable in general, whereas (3.14) is shown to be forward stable for vectors of points x ∈ R n+2 having a small Lebesgue constant Λ Rn[x],[-1,1] (x). Higham goes on to reinforce this experimentally, by comparing the two barycentric expressions with the Newton divided difference interpolation formula for different vectors x inside [-1, 1].

Although the aforementioned paper points out that the error analysis for formula (3.14) is not as favorable as the one for (3.13), we should not infer from this a general conclusion that the second barycentric formula is less stable than the first one. This seems to be especially true when Chebyshev nodes of the second kind are concerned. In a recent account, Mascarenhas [START_REF] Mascarenhas | The stability of barycentric interpolation at the Chebyshev points of the second kind[END_REF] shows that if we use the closed form of the barycentric weights for second kind Chebyshev nodes as established by Salzer [START_REF] Salzer | Lagrangian Interpolation at the Chebyshev points x n,ν ≡ cos(νπ/n), ν = 0(1)n; some unnoted advantages[END_REF], meaning

w k = (-1) k δ k , δ k = 1/2, k = 0 or k = n + 1, 1, otherwise;
then the second barycentric formula can be shown to be backward stable with respect to perturbations in the values of f . If f turns out to also have a derivative of moderate size, this will also lead to small forward errors.

On the other hand, for this particular setting, using the first barycentric formula for large n can be problematic. That is to say, if rounded (or perturbed) versions xk of the nodes x k are used during the evaluation of (3.13), then the relative error of computing p x (x) can actually be of order n 2 u. This leads to approximations which are less stable than if using the second barycentric formula. Examples with f (x) = sin(x) and n 10 3 are considered. Possible ways of making the first barycentric formula more stable in this case are discussed in [START_REF] Mascarenhas | The effects of rounding errors in the nodes on barycentric interpolation[END_REF].

The main idea we are trying to convey is that, when doing polynomial interpolation, one should first consider using (3.14). To support this claim, we also mention [START_REF] Mascarenhas | On the backward stability of the second barycentric formula for interpolation[END_REF], where Mascarenhas and Camargo argue that (3.14) is backward stable if the relevant Lebesgue constant corresponding to x is small.

An example of a reference set with small Lebesgue constant is showcased in Figures 3.5 and 3.6 for the specification given in Example 3.20. Both plots show the relative errors in computed p(x) during the first iteration of the exchange algorithm. The 'exact' computations were performed with MPFR using 600 bits of precision (roughly 180 digits). In Figure 3.5, Λ Rn[x],[-1,1] (x) is quite large and we see that the loss in accuracy is clearly visible around x = -1. The results are much better in Figure 3.6 for a smaller Lebesgue constant, reinforcing our earlier statements. Typical scenarios of how Λ Rn[x],[-1,1] (x) changes are given in Tables 3.7 to 3.9 for Examples 3.18 to 3.20. The numerical estimates were computed using the Chebfun routine lebesgue mentioned in [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 15]. They tell us that execution will tend to be more stable during latter iterations, with the risk that the starting iterations for uniform initialization are prone to extreme ill-conditioning. The effect of using the strategies from Section 3.6 is also clearly visible in Tables 3.8 and 3.9, leading to better numerically behaved computations from the beginning. At this point, one can conjecture that the Lebesgue constants on [-1, 1] associated with the references that appear during execution of the exchange algorithm generally tend to decrease in value when starting far from the optimal reference.

= 100 n = 520 Iteration Λ Rn[x],[-1,1] (x) Iteration Λ Rn[x],[-1,1] (x) Iteration Λ Rn[x],[-1,1] (x) 1 3.72896 •
= 100 n = 520 Iteration Λ Rn[x],[-1,1] (x) Iteration Λ Rn[x],[-1,1] (x) Iteration Λ Rn[x],[-1,1] (x) 1
Why is this? An intuitive, but still theoretically grounded, reason is related to the equilibrium distribution of equialternating sets for best approximation mentioned in Section 3.6.3. By taking an x that follows such a distribution, its Lebesgue constant Λ wRn[x],X (x) will generally be small (take for instance the Fekete points of X). This effect seems to carry over to Λ Rn[x],[-1,1] (x), provided:

(1) the intervals of [-1, 1] -X are small compared to those of X;

(2) if (1) does not hold, then n is not too large.

Both AFPs and scaled nodes follow such distributions and it is reasonable to assume that subsequent references during execution will do so too. Our statements are reinforced by the fact that Lebesgue constant values are stable under small perturbations of the sampling nodes [START_REF] Piazzon | On the stability of Lebesgue constants[END_REF].

Since a large Lebesgue constant Λ Rn[x],[-1,1] (x) is symptomatic for a very small levelled error h, the solutions for countering ill-conditioning of the previous subsection are very much true for evaluating (3.18). Remark 3.30. When numerical problems of the types discussed in this section occur (typically because of uniform initialization), our exchange algorithm implementation using double-precision arithmetic can sometimes still find the correct result. What happens in such cases is that, even though our computations of the current interpolant and its approximation error are inaccurate, the next reference we retrieve from them, despite being wrong, can have a small Lebesgue constant. Having such a reference, as we saw, usually improves chances for convergence. It can be viewed as a kind of reinitialization midway through execution. Nevertheless, as our test cases show, convergence in the presence of numerical issues is a completely random behavior. It is not to be expected and, most of all, trusted. One should definitely consider using a higher working precision and/or one of the initialization techniques from Section 3.6.

Extrema search

Let's denote by x ∈ R n+2 the reference vector at iteration k + 1 in Step 3 of Algorithm 2. To compute its elements, we want to know the local extrema of the current error function e(x). For this purpose, Chebyshev root-finding is reviewed in the next paragraphs, while Section 3.8.2 introduces our non-recursive subdivision strategy. For completeness, Sections 3.8.3 and 3.8.4 talk about updating the reference set at each iteration and how to retrieve the minimax result coefficients upon convergence.

Chebyshev-proxy root-finding

We first consider the slightly different problem of determining the zeros of a function f ∈ C ([-1, 1]), located inside [-1, 1]. We note that by suitable changes of variable, the following results hold for any closed interval [a, b]. The idea of the Chebyshev-proxy root-finder (CPR) method [START_REF] Boyd | Finding the Zeros of a Univariate Equation: Proxy Rootfinders, Chebyshev Interpolation, and the Companion Matrix[END_REF][START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF] is to replace f (x) by a degree m Chebyshev interpolant proxy p m (x). If the chosen polynomial is an accurate enough approximation of f , then its zeros will very closely match those of f . Recall from Section 2.1.2 that p m interpolates f at the Chebyshev nodes of the second kind ν k = cos((mk)π/m), 0 k m, and is expressed using the basis of Chebyshev polynomials of the first kind. We have

p m (x) = m k=0 a k T k (x), x ∈ [-1, 1], a k ∈ R, k = 0, . . . , m, with p m (ν k ) = f (ν k ), k = 0, . . . , m and
a k = 1 m f (ν 0 )T k (ν 0 ) + 2 m m-1 i=1 f (ν i )T k (ν i ) + 1 m f (ν m )T k (ν m ), k = 0, . . . , m. (3.19)
The roots of p m are then computed as the eigenvalues of a generalized companion matrix [START_REF] Boyd | Computing the zeros, maxima and inflection points of Chebyshev, Legendre and Fourier series: solving transcendental equations by spectral interpolation and polynomial rootfinding[END_REF][START_REF] Day | Roots of Polynomials Expressed in Terms of Orthogonal Polynomials[END_REF], called colleague matrix, which behaves well in practice [START_REF] Boyd | Numerical experiments on the accuracy of the Chebyshev-Frobenius companion matrix method for finding the zeros of a truncated series of Chebyshev polynomials[END_REF]: Theorem 3.31 (Colleague matrix). The roots of the polynomials

p m (x) = m i=0 a i T i (x),
a m = 0 correspond to the eigenvalues of the matrix

C(p m ) =               0 1 1 2 0 1 2 1 2 0 1 2 . . . . . . . . . 1 2 - a 0 2a m - a 1 2a m - a 2 2a m 1 2 - a m-2 2a m - a m-1 2a m               , (3.20)
where the entries not displayed are zero. If there are multiple roots, these correspond to eigenvalues with the same algebraic multiplicities. Proof. See for example [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 18].

To obtain good approximations of the local extrema of e(x), suppose we already have an accurate degree m proxy

e m (x) = m k=0 a k T k (x).
The value of m should be thought of independently from the degree n of the target minimax response p (x).

We look for the roots of e m (x) = de m dx , whose Chebyshev expansion is

e m (x) = m-1 k=0 b k T k (x)
e m (x) = m-1 k=0 c k U k (x),
where c k-1 = ka k , k = 1, . . . , m. Although the CPR method is introduced in the context of T m , we found the second formula for e m more natural to use in our setting, since it is simpler to compute; each c k-1 coefficient requires only one multiplication. The colleague matrix corresponding to an expansion using the basis of Chebyshev polynomials of the second kind U i has basically the same form as (3.20), with the sole difference that the 1 in the first row of C(p m ) is replaced by a 1 2 . To find the eigenvalues of a m × m colleague matrix, for both types of Chebyshev polynomials, we can use a QR/QZ algorithm (O(m 3 ) operation count). For numerical reasons, we use the colleague matrix form with non-zero coefficients on the first column, as suggested in [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ex. 18.3]:

               - a m-1 2a m 1 2 1 2 - a m-2 2a m 0 1 2 - a m-3 2a m 1 2 0 1 2 . . . . . . . . . 1 - a 0 2a m 1 2 0               
, preceded by a preconditioning phase, known as balancing [START_REF] Parlett | Balancing a matrix for calculation of eigenvalues and eigenvectors[END_REF]. It modifies the given matrix in such a way that the eigenvalues are invariant, whereas the norm of the new matrix is smaller. The cost can be reduced to O(m 2 ) computations by dividing the initial domain [-1, 1] into several subintervals and taking Chebyshev interpolation polynomials of smaller degree on each of them. The roots can then be determined as the collection of zeros inside all subintervals. More precisely: if N max < m is the maximum degree on which one is willing to use an eigenvalue algorithm, recursively split [-1, 1] until there are Chebyshev interpolants of degree at most N max on each subinterval, which approximate f accurately.

There are several general criteria that quantify when we have a good enough approximation of f (x) [START_REF] Boyd | Computing the zeros, maxima and inflection points of Chebyshev, Legendre and Fourier series: solving transcendental equations by spectral interpolation and polynomial rootfinding[END_REF][START_REF] Boyd | Finding the Zeros of a Univariate Equation: Proxy Rootfinders, Chebyshev Interpolation, and the Companion Matrix[END_REF]. The Chebfun Remez algorithm implementations [START_REF] Javed | The Remez algorithm for trigonometric approximation of periodic functions[END_REF][START_REF] Pachón | Barycentric-Remez algorithms for best polynomial approximation in the Chebfun system[END_REF] use such a recursive approach [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 18] by means of the Chebfun roots command. Note that the intermediary interpolants computed before the final stage subdivisions are not used for the actual root finding.

A new subdivision strategy

We use a different, non recursive approach. In general, during each iteration of the exchange algorithm, we have estimates about the location and number of extrema of e; if we take a subinterval defined by two consecutive points of the current reference vector x located inside the same band, say [x i , x i+1 ], then we usually expect to have between zero and two potential extrema of e inside it. Figure 3.7 summarizes this scenario. We then use a degree N max Chebyshev proxy on each subinterval. Values of N max we frequently used in our experiments are 4 and 8. Dynamic range issues [START_REF] Boyd | Finding the Zeros of a Univariate Equation: Proxy Rootfinders, Chebyshev Interpolation, and the Companion Matrix[END_REF]Sec. 7.4] with the values of e(x) are generally absent because the initial approximations from Section 3.6 are of good quality. Since there is only one subdivision level (no intermediary interpolants), there will be savings in computation time.

At each iteration, we use O(n) subintervals of the form [x i , x i+i ]. To cover all of X, we also consider all intervals of the form [a, x i ] ⊆ X and [x j , b] ⊆ X, where a and b are band extremities of X and x i and x j are elements of x which are closest to a and b, respectively. Inside each subinterval, we evaluate the error N max + 1 times in order to construct a suitable proxy for e and its derivative. Because of barycentric interpolation, each evaluation of e will usually require only O(n) operations, while solving each small eigenvalue problem amounts to a constant number of computations. The total operation count will be O(n 2 ).

In addition to requiring the evaluation of e a reasonable number of times (in the range of 4n to 8n), this approach can also be very easily parallelized (the computations on each subinterval are data parallel ). For large degree approximations on multicore systems, the speedup is considerable (see Section 3.9.2).

Even faster iterations

This quadratic extrema search scheme gives very reasonable execution times in practice, even for degrees in the order of thousands. Nevertheless, potential speedups are still possible; because of apriori knowledge on the exact number of evaluations of e involving formula (3.18), it is feasible to use fast multipole methods for evaluating polynomial interpolants [START_REF] Dutt | Fast algorithms for polynomial interpolation, integration, and differentiation[END_REF] at n arbitrary points. If ε is the numerical precision for our computations, such methods need O(n log(1/ε)) operations at each iteration. Parallelization is possible here as well; the O(N max n) polynomial evaluations can be split in O(N max ) independent applications of the fast multipole method on batches of n points. The only issue is that, from a numerical point of view, such computations can be less stable in practice than if barycentric interpolation is used [79, Example 3].

Updating the current reference set

In the classic version of the multi-point exchange rule on X = [a, b], the new reference x is determined by Algorithm 6. An explicit computation of the z i is avoidable in practice. A proper y can be obtained if we know the sign of e at its local extrema and their position with respect to the nodes of x. Pachón and Trefethen describe a slightly different strategy in [163, Sec. 2.2], but which usually behaves equally well.

Algorithm 6: Multi point exchange [START_REF] Veidinger | On the numerical determination of the best approximation in the Chebyshev sense[END_REF] Input: X = [a, b], x ∈ R n+2 , the current error function e(x) and levelled error h Output: new reference vector x ∈ R n+2 1 Determine a vector z = (z i ) 0 i n such that e(z i ) = 0, i = 0, . . . , n,

and x 0 ∈ [a, z 0 ], x i ∈ [z i-1 , z i ], for i = 1, . . . , n, x n+1 ∈ [z n , b]. 2 Construct y ∈ R n+2 such that y 0 ∈ [a, z 0 ], y i ∈ [z i-1 , z i ], for i = 1, . . . , n, y n+1 ∈ [z n , b]
and each y i is a local extrema of e where sgn(e(y i )) = sgn(e(x i )) and |e(y i )| |h|. For a multi-interval X, one possible approach is to apply Algorithm 6 on each interval of X and then take the union of the obtained partial references. The major issues are:

3 if y i s.t. |e(y i )| = e ∞,
• the number of reference values inside each interval stays the same from iteration to iteration, impeding convergence in many cases;

• the alternation property on x might not be true (i.e., the execution of lines 3-4 on certain intervals can cause sign swaps for the error values at the new reference nodes and no swap on others).

An alternative is to apply lines 1 and 2 on each interval, take y as the union of the resulting nodes and only then potentially perform lines 3-4. This should allow for the migration of reference nodes from one interval to another in certain cases. Other possibilities are described in [START_REF] Antoniou | Digital Signal Processing: Signals, Systems, and Filters[END_REF]Ch. 15.3.4]; although they allow the movement of reference points between intervals, they do not seem to enforce the error alternation property on x , hence incurring the risk of non-convergence in some cases.

Algorithm 7: Multi interval exchange rule

Input: the current error function e(x) and levelled error h Output: new reference vector x ∈ R n+2 1 Take x as the set of all ordered potential extrema y ∈ X of e such that |e(y)| |h| . Take for instance Tables 3.10 and 3.11. They show how the levelled error h k evolves with respect to the minimax deviation δ X . We used uniform initialization (so as to hopefully force a larger number of iterations), MPFR multiple precision arithmetic and a tolerance ε t = 2 -60 for Step 4 of Algorithm 2 to highlight that, towards the end of execution, the number of correct digits h k has with respect to δ X essentially doubles at each iteration, consistent with (3.5). Figure 3.8 shows a small sample of the minimax approximation error e k , for Example 3.21, after the filter coefficients have been computed using Clenshaw's recurrence relations. Although the degree n = 53248 is quite large, the computations are numerically accurate, with the equioscillations of Theorem 3.9 clearly visible.

Implementation details

In this section we give practical information on how someone can use our routines and compare them to equivalent ones available in widely used Signal Processing packages.

To summarize the previous three sections, each iteration of the exchange algorithm takes O(n 2 ) operations with our code (see https://github.com/sfilip/firpm). Choosing the starting reference takes O(n) operations if uniform initialization is used, but this cost can jump to O(n 2 ) with the approach from Section 3.6.3 or O(n 3 ) operations for Section 3.6.2. By limiting the use of AFP-based initialization to moderate degrees (n < 1000), the cubic cost is not problematic in practice. As discussed in Section 3.6.4, these more expensive strategies are most of the time worthwhile and sometimes even necessary. Also, the computational bottleneck (the extrema search of Section 3.8.2) is embarrassingly parallel. Exploiting it is very effective in practice (see Table 3.13).

User interface

Our code requires a small number of external libraries in order to work. Besides calling MPFR inside the multiple precision version, we also use the Eigen library [94] to perform all the eigenvalue computations when searching for a new reference set. Because it is designed with template metaprogramming techniques, the code calling Eigen requires little to no changes between the different versions. To parallelize the extrema search in Section 3.8.2, we use OpenMP [START_REF] Dagum | OpenMP: an industry standard API for shared-memory programming[END_REF].

All three versions of our code have an almost identical interface. As such, we will focus on describing only the double-precision version. For filter-centric applications, we have coded functions specifically designed for this task, inspired by the style used for the MATLAB implementation of the Parks-McClellan algorithm.

The function for designing type I and II filters has the following prototype:

PMOutput firpm(std::size_t N, std::vector<double>const& f, std::vector<double>const& a, std::vector<double>const& w, double epsT = 0.01, int Nmax = 4); where • N+1 is the number of coefficients of the designed filter;

• f is the vector of the frequency band edges of Ω ⊆ [0, π], normalized to [0, 1], and given in increasing order;

• a contains the desired amplitudes at each of the points from f;

• w is the vector of weights on each band specified by f (its size is half that of f and a);

• epsT convergence parameter threshold from Step 4 in Algorithm 2 from Section 3.3.1. The default value is taken from [START_REF] Antoniou | Digital Signal Processing: Signals, Systems, and Filters[END_REF]Ch. 15.3].

• Nmax designates the degree of the Chebyshev interpolants used for the extrema search from Section 3.8.2, with a default value of 4.

For instance, designing a degree n = 100, type I filter adhering to the specification given in Example 3.18, results in the following, valid C++11, function call:

PMOutput res = firpm(200, {0, 0.4, 0.5, 1}, {1, 1, 0, 0}, {1, 1});

The returned PMOutput object res has several member variables that can be useful to a filter designer. The vector res.h corresponds to the final coefficients of the filter transfer function from equation (2.10), while res.x is the final reference vector, belonging to X. The number of iterations required for convergence are stored in the variable res.iter, while the value of the final reference error δ X is denoted with res.delta.

The firpm functions use uniform initialization by default. To use reference scaling or approximate Fekete points, we supply the functions firpmRS and firpmAFP. The firpmRS versions allow the user to choose between uniform and AFP-based initialization at the lowest level.

More general weighted polynomial approximations can be computed with the function exchange, which is used internally by the firpm code:

PMOutput exchange(std::vector<double>& x, std::vector<Band>& chebyBands, double epsT, int Nmax);

It gives the user the freedom to specify the starting reference through the variable x, while the (multi)interval domain, together with the values of f (x) and w(x) on each subinterval are specified through the chebyBands parameter. There are multiple implementations of the Parks-McClellan algorithm available, so we compared our approach to those we believe are the most widely used and/or robust in practice. Some results are given in Table 3.12. Because they are written in different languages, there are bound to be some differences in terms of execution times. To make matters as fair as possible, we disabled parallelization of the extrema search in our code and went for uniform initialization in all the test cases. Default grid size parameters (see the discussion from Remark 3.16) were used for the routines in the last four columns and a default value of N max = 4 for our implementation.

Timings

The two optimized routines from [START_REF] Ahsan | Two Novel Implementations of the Remez Multiple Exchange Algorithm for Optimum FIR Filter Design[END_REF] are at heart efficient rewritings of the original code of [START_REF] Mcclellan | A computer program for designing optimum FIR linear phase digital filters[END_REF], the only difference between the two being how the reference set gets updated at each iteration. Together with our implementation, they were the only ones that were able to converge on 7 out of the 8 test cases. Even so, our code is the most robust one in terms of execution time. We also tested the corresponding routine from Scilab 5.5.1 (written in Fortran), but did not achieve convergence for any of the test cases.

The effects of starting with a better reference (via scaling or approximate Fekete points) and parallelization of the extrema search are showcased in Table 3.13. As we already emphasized, the greatest gain is for the last two examples, where the filter degrees are larger. In the case of Example 3.21, for which only our routine converged, enabling parallelization on the quad core machine we used for testing, resulted in our code running 3.3 times faster than the purely sequential version.

Conclusion

In this chapter we have presented several ideas that aid in the development of weighted minimax polynomial approximations, with a large focus on optimal linear-phase FIR filters. These contributions amount to the Table 3.13: Timings (real time) showing the effect of running our code with different options. As for Table 3.12, the numerical values represent the averages in seconds over 50 executions. For the first seven lines, the double-precision version of our routine was used, while for the last one long double 80-bit operations were carried out. In all cases, our code was compiled using g++5.2.0 with -O3 -DNDEBUG level optimizations. • introduce two new initialization strategies (Sections 3.6.2 and 3.6.3); they ensure the convergence of our routine in cases where all other implementations fail to work, while frequently incurring significant speedups as well (consequence of a small number of iterations required for convergence);

Example

• present pertinent analysis tools which help diagnose when the exchange algorithm is prone to numerical problems in practice (Section 3.7.2);

• introduce a variation of a well-established root-finding approach [START_REF] Boyd | Finding the Zeros of a Univariate Equation: Proxy Rootfinders, Chebyshev Interpolation, and the Companion Matrix[END_REF][START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF] which allows one to obtain weighted minimax polynomial approximations in an efficient way (Section 3.8.2).

• equally noteworthy is the fact that this study has helped us develop an efficient and highly parallel software library. As we saw throughout all of the examples we considered up to this point, our routine outperforms other existing codes in terms of scalability and numerical accuracy. Another major element differentiating our approach from standard routines like MATLAB's firpm is the fact that we do not discretize the approximation domain, meaning in the end we generally get more accurate results, all the while not incurring prohibitive computational costs.

Future work

In terms of continuing such an implementation-centric work, there are several possible avenues of exploration that are worth considering. Here are some of them.

• for the moment, our code can only handle functions using bases of the form (w(x)T 0 (x), . . . , w(x)T n (x)), because of their usefulness to filter design applications. More general bases satisfying the Haar condition should be allowed as well. Monomial-like bases are important in the design of mathematical function implementations for libms;

• provide an implementation of the first Remez algorithm for systems not satisfying the Haar condition.

Starting with a good initial reference in such a setting is maybe more important than for the second Remez algorithm, since at each iteration, the discrete problem to solve grows in size. Also, degeneracy problems of the type discussed in Remark 3.17, need to be properly taken into account;

• univariate minimax approximations can be used to construct so-called best product Chebyshev approximations to continuous bivariate functions on a rectangle [START_REF] Weinstein | Approximations of functions of several variables: product Chebychev approximations, I[END_REF] by a tensor product-like approach.

Since they can have very good uniform norm properties, it may be interesting to extend our code base to compute such results;

• see if similar ideas to the ones presented here can be applied to other digital signal processing tasks, like those requiring FIR filters with complex coefficients [START_REF] Karam | Complex Chebyshev approximation for FIR filter design[END_REF][START_REF] Karam | Design of optimal digital FIR filters with arbitrary magnitude and phase responses[END_REF].

Machine-efficient approximations and filter design

Imaginat ¸ia e şi ea o sursȃ de informare.

Grigore C. Moisil

According to [START_REF] Hennessy | Computer Architecture: A Quantitative Approach[END_REF], embedded processors are one of the main economical juggernauts in todays computing industry, mainly because they offer the widest range of alternatives in terms of processing power and cost. Since price is the principal constraint when using such platforms, the goal is to choose the device that meets some given performance requirements at the smallest possible cost. In particular, most digital filtering operations are done in this embedded setting, so employing efficient designs is very important in practice.

This means that we are generally forced to work with strict format constraints on the coefficients of the polynomials or rational functions we are using. Such requirements increase the complexity of determining optimal designs for the problem at hand. In this chapter, we introduce a fast and efficient heuristic for suboptimal finite wordlength coefficient quantization, based on the computation of good nodes for polynomial interpolation, as discussed in Section 3.6, and Euclidean lattice basis reduction. Most of the time, it returns finite precision linear phase FIR filters which behave very well with respect to the weighted minimax norm.

The exposition is an extension of [START_REF] Brisebarre | De nouveaux résultats sur la synthèse de filtres RIF[END_REF][START_REF] Brisebarre | A Lattice Basis Reduction Approach for the Design of Quantized FIR Filters[END_REF] and represents a joint work with N. Brisebarre and G. Hanrot.

Introduction

The efficient design of FIR filters has been an active research topic in digital signal processing for several decades now. A lot of the focus has been directed to how these objects are implemented in hardware, leading to the consideration of different structures and computational algorithms for performing the dot product filtering operation (2.8) in the time domain. Some notable examples (see [START_REF] Oppenheim | Discrete-Time Signal Processing[END_REF] for details) are:

• direct form: this is the simplest alternative. It consists of using the filter coefficients directly inside the difference equation (2.8), which for an N -tap FIR filter becomes

y[n] = N -1 k=0 h[k]x[n -k] (4.1)
and corresponds to the transfer function

H(z) = N -1 k=0 h[k]z -k . • cascade form: it is obtained by factoring H(z) as H(z) = N -1 k=0 h[k]z -k = N +1 2 k=1 b 0k + b 1k z -1 + b 2k z -2
and equivalently evaluating y[n] inside (4.1) using the b 0k , b 1k and b 2k coefficients.

• lattice filters: also a type of cascade-like structure that uses a different set of coefficients than the filter taps to evaluate y[n] (see [START_REF] Oppenheim | Discrete-Time Signal Processing[END_REF]Ch. 6.6]). Lattice filters have no direct relation to Euclidean lattices.

Having access to different realizations is important since, when implemented, some of them might be less sensitive than others to finite precision numerical effects. The use of direct forms is nonetheless preferred in many cases, which is why we will focus on them here. The major reason for working with direct forms is due to the fact that most DSP chips come equipped with efficient structures to perform long sequences of multiply-accumulate operations, just like in (4.1).

In general, an initial design procedure like the Remez exchange algorithm is applied in order to retrieve a set of "infinite precision" coefficients and filter taps, which are frequently computed as 64-bit floating-point values. When, for example, FIR filters are used inside specialized DSP processors or field-programmable gate arrays (FPGAs), the coefficient constraints are very strict, usually requiring the use of fixed-point values of much smaller bit size. Even very recent FPGAs that come with floating-point DSP blocks [START_REF] Langhammer | Floating-Point DSP Block Architecture for FPGAs[END_REF] only offer support for 32-bit floating-point arithmetic. Simply rounding the initial 64-bit precision coefficients to their nearest representations in these imposed formats can give rise to suboptimal filters. In certain cases, the quality of these naive results can be significantly improved, especially when fixed-point values are used.

Two types of quantizations are commonly discussed in the literature:

(i) the filter taps are fixed-point values of the form

m i s , m i ∈ Z ∩ [m -, m + ], m -, m + ∈ Z, (4.2)
where the scaling factor s is is usually a power of 2. This is also known as uniform coefficient quantization. Such representations are useful when working with dedicated DSP processors or equivalent blocks inside FPGAs.

(ii) sum of power of two terms in binary or CSD formats (see the end of Section 2.3.2 for a definition of CSD encodings). They are useful for multiplierless filtering circuits, where the interest is for the overall number of power of two terms in the coefficients to be as small as possible (i.e., non-uniform coefficient quantization).

State of the art

The engineering literature on the coefficient quantization problem in digital filter design is much too large to do it justice in just a few paragraphs. We will nonetheless try to give a comprehensive picture of how it evolved over the past decades.

It could be said that everything started in the 1960s and was due to what is now seen as an unavoidable switch from analog to digital circuits. Kaiser [START_REF] Kaiser | Some practical considerations in the realization of linear digital filters[END_REF], in 1965, is the first to study the effect of coefficient errors on filter performance. Several years later, Chan and Rabiner [START_REF] Chan | Analysis of quantization errors in the direct form for finite impulse response digital filters[END_REF] looked at the statistical properties of the error in the filter's frequency response when rounding of the coefficients is used. A more recent reference on the statistical effects of finite precision computation, including digital filter design, is [START_REF] Widrow | Quantization noise[END_REF].

For both uniform and non-uniform coefficient quantization problems, finding a set of optimal quantized coefficients is a computationally hard problem, with exact solvers making heavy use of (mixed) integer linear programming (MILP) techniques. A summary of early references (circa 1980) on the topic can be consulted for instance in [START_REF] Kodek | Comparison of optimal and local search methods for designing finite wordlength FIR digital filters[END_REF][START_REF] Kodek | Design of optimal finite wordlength FIR digital filters using integer programming techniques[END_REF][START_REF] Lim | Discrete coefficient FIR digital filter design based upon an LMS criteria[END_REF]. In the case of optimal type (i) solutions, it is probably Kodek [START_REF] Kodek | Design of optimal finite wordlength FIR digital filters using integer programming techniques[END_REF][START_REF] Kodek | Design of optimal finite wordlength FIR digital filters[END_REF][START_REF] Kodek | Performance limit of finite wordlength FIR digital filters[END_REF][START_REF] Kodek | LLL Algorithm and the Optimal Finite Wordlength FIR Design[END_REF] that, over the years, has worked the most on studying and improving the behavior of specialized branch-and-bound MILP algorithms. These efforts, coupled with the computational capabilities of current processors, make it that for problems where N 60 and coefficients stored using up to 12 bits, optimal solutions can usually be obtained within seconds [START_REF] Kodek | LLL Algorithm and the Optimal Finite Wordlength FIR Design[END_REF]Table I], while for larger parameter values, the runtime quickly escalates.

The sum of power of two setting has received even more attention from the engineering community. A probable reason is that, early on, the accuracy gains from doing optimal uniform coefficient quantization as opposed to using more naive methods seemed experimentally not to over-weigh the complexity costs [START_REF] Kodek | Comparison of optimal and local search methods for designing finite wordlength FIR digital filters[END_REF], whereas in the non-uniform case, significant improvements were clearly achievable [START_REF] Lim | FIR filter design over a discrete powers-of-two coefficient space[END_REF]. Optimal approaches based on MILP have been discussed for instance in [START_REF] Aksoy | Exact and approximate algorithms for the filter design optimization problem[END_REF][START_REF] Gustafsson | An MILP approach for the design of linear-phase FIR filters with minimum number of signed-power-of-two terms[END_REF][START_REF] Lim | Design of discrete-coefficient-value linear phase FIR filters with optimum normalized peak ripple magnitude[END_REF][START_REF] Lim | FIR filter design over a discrete powers-of-two coefficient space[END_REF][START_REF] Lim | Finite word length FIR filter design using integer programming over a discrete coefficient space[END_REF][START_REF] Lim | Design of discrete-coefficient FIR filters on loosely connected parallel machines[END_REF][START_REF] Shi | Design of Linear Phase FIR Filters With High Probability of Achieving Minimum Number of Adders[END_REF], with a name appearing in many of the references being that of Lim. Again, their use is limited to relatively small design parameters.

To successfully address larger word-length (and degree) problems, fast heuristics have also been proposed. For example, in the case of uniform fixed-point coefficients, an early interesting reference is [START_REF] Lim | Discrete coefficient FIR digital filter design based upon an LMS criteria[END_REF], which describes a branch-and-bound tree search strategy combined with a L 2 -type coefficient quantization criterion. The approach described in [START_REF] Nielsen | Design of linear-phase direct-form FIR digital filters with quantized coefficients using error spectrum shaping[END_REF], which employs error spectrum shaping techniques, is routinely used inside MATLAB for FIR coefficient quantization. More recently, the telescoping rounding approach described in [START_REF] Kodek | Telescoping rounding for suboptimal finite wordlength FIR digital filter design[END_REF] also seems to produce good results. In the context of non-uniform coefficient problems, there are again a lot of heuristics to choose from. For recent accounts and methods, we refer the reader to [START_REF] Aksoy | Exact and approximate algorithms for the filter design optimization problem[END_REF][START_REF] Da Silva | Fir filter design based on successive approximation of vectors[END_REF][START_REF] Skaf | Filter Design With Low Complexity Coefficients[END_REF][START_REF] Wei | Design of discrete-time filters for efficient implementation[END_REF][START_REF] Yli-Kaakinen | A systematic algorithm for the design of lattice wave digital filters with short-coefficient wordlength[END_REF] and the references therein.

The rest of this chapter will be focused on introducing a novel heuristic for designing suboptimal FIR filters with uniform quantized coefficients. It is based on previous work for doing machine-efficient polynomial approximation of functions [START_REF] Brisebarre | Efficient polynomial L ∞ -approximations[END_REF] combined with techniques that yield families of very good interpolation nodes [START_REF] Bos | Geometric weakly admissible meshes, discrete least squares approximations and approximate Fekete points[END_REF][START_REF] Bos | On the calculation of approximate Fekete points: the univariate case[END_REF][START_REF] Calvi | Uniform approximation by discrete least squares polynomials[END_REF][START_REF] De Marchi | Polynomial meshes: Computation and approximation[END_REF][START_REF] Sommariva | Computing approximate Fekete points by QR factorizations of Vandermonde matrices[END_REF][START_REF] Sommariva | Approximate Fekete points for weighted polynomial interpolation[END_REF]. We also make available an open source C++ implementation of our approach1 . Since it produces very good quantizations with respect to the L ∞ error measure, our code should also be able to help accelerate exact solvers based on MILP in certain cases.

The finite wordlength design problem

A general formalization of the question we are asking in this chapter is the following: Problem 4.1 (Machine-coefficient optimal approximation). Given an approximation domain X ⊂ R, a target real-valued function f to approximate over X, a set of basis functions ϕ 0 , . . . , ϕ n and a set of finite-precision formats

(F i ) 0 i n , find a i ∈ F i , 0 i n such that sup x∈X n i=0 a i ϕ i (x) -f (x)
is minimal. Let us call this value δ opt .

It follows from the fact that the number of candidate approximations is always finite that an instance of Problem 4.1 always has a solution. On the other hand, we cannot guarantee anything regarding uniqueness.

In function approximation problems for libm design, X is generally a closed interval, f ∈ C(X), the basis functions correspond to (appropriately scaled) monomials and the F i formats are usually the single or double-precision floating-point formats or floating-point expansion (that is, sums of two or more floating-point values, like for instance so-called double-double and triple-double values). For a detailed discussion on the these types of problems and possible solutions, see for instance [START_REF] Chevillard | Évaluation efficace de functions numériques[END_REF]Ch. 2.3].

In the filter design applications we are focusing on here, X is generally a finite union of closed intervals and the basis functions are scaled versions of the ones introduced by equations (2.11)-(2.14), depending on the target filter type. Indeed, if the filter tap format is the one given in (4.2), then we can force the a i 's to be in [m -, m + ] ∩ Z, whereas the basis functions take the values from Table 4.1. We recall that our usual x = cos(ω) change of variable is in effect.

While there are a lot of similarities between these two settings, the target applications in the filter use case can sometimes introduce issues which were not present in the function approximation space. Table 4.2 gives 5 design specifications used throughout the chapter as working examples for our method.

Exact approaches

There are certain advantages and limitations of current methods for finding optimal finite wordlength solutions which are worth discussing here. Looking at Problem 4.1 geometrically is especially interesting. [START_REF] Kodek | Telescoping rounding for suboptimal finite wordlength FIR digital filter design[END_REF].

Filter Bands D(ω) W (ω) A [0, 0.4π] [0.5π, π] 1 0 1 1 B [0, 0.4π] [0.5π, π] 1 0 1 10 C [0, 0.24π] [0.4π, 0.68π] [0.84π, π] 1 0 1 1 1 1 D [0, 0.24π] [0.4π, 0.68π] [0.84π, π] 1 0 1 1 10 1 E [0.02π, 0.42π] [0.52π, 0.98π] 1 0 1 1

Polytope projections

Consider a set of m + 1 n + 1 distinct points x 0 , . . . , x m ∈ X, arbitrarily chosen for the time being, and an error term δ δ X , where δ X corresponds to the minimax solution of Problem 4.1 when the a i are only required to be real values. Then, the following problem, with unknowns a 0 , . . . , a n , has at least one solution in R n+1 :

n i=0 a i ϕ i (x 0 ) -f (x 0 ) δ, f (x 0 ) - n i=0 a i ϕ i (x 0 ) δ, . . . n i=0 a i ϕ i (x m ) -f (x m ) δ, f (x m ) - n i=0 a i ϕ i (x m ) δ. (4.3)
As discussed in the previous chapter, for the problems at hand, the basis functions we are using satisfy the Haar condition, thus the system formed by the ϕ i (x j )'s has rank n + 1, meaning (4.3) defines a bounded polytope P in R n+1 (see for instance [START_REF] Brisebarre | Computing machine-efficient polynomial approximations[END_REF]Appx. 2] for a proof idea). We can thus orthogonally project P on each of the axes spanned by the a i 's using the simplex algorithm (i.e., minimize and maximize each a i under the linear constraints of (4.3)). If moreover, δ δ opt , then we have the guarantee that each bounding interval [a - i , a + i ] defined by the projections of P contains at least one element from F i and that by testing all possible combinations of valid coefficients, at least one of them will generate the solution to Problem 4.1. In all of (4.4), (4.5) and (4.6), the bounds do not vary very much. The position of the optimal a i 's inside these intervals is interesting though; they appear to be approximately centered in all cases. We noticed this behavior for some other examples as well, although we cannot confirm this to be generally the case.

The fact that the bounds we obtain are rather large for all coefficients contrasts somewhat the situation in Chevillard's thesis [START_REF] Chevillard | Évaluation efficace de functions numériques[END_REF]Ch. 2.3.2]. In that context, projection produces tighter bounds for many examples of floating-point quantization on an interval. A reason might be the much smaller errors δ opt < 10 -9 they target, which are normally much more sensitive to changes in the coefficient values. Another reason might be the working basis; we consider Chebyshev polynomials on essentially a large subset of [-1, 1], meaning all the basis polynomials will have more or less the same range. The function approximation context of [58, Ch. 2.3.2] however, works on very small intervals using the basis of monomials; the range of each basis element will thus be very small and the ranges of any two distinct monomials might differ quite a lot from one another, influencing the tightness of the projection bounds. For the moment these are just speculations.

Using projections in such a way, although capable of providing exact solutions, seems like a viable option only for relatively small degrees (say n < 15), considering the 2n + 2 linear programs that are to be solved each time a new δ and/or discretization is chosen. The denser the discretization, the more accurate the projections will be (a smaller number of candidate solutions to verify), but it will also impact the execution time for the linear programming solver.

Our computations were performed by coding an experimental C/C++ implementation for polytope projection operations. It relies on the GLPK 2 C library interface for the exact solution of linear programming problems using GMP 3 multiple precision rationals. We are extremely grateful for all the help that Serge Torres has provided, by sharing his experience in coding the similar projection routine of [START_REF] Chevillard | Évaluation efficace de functions numériques[END_REF]Ch. 2.3.2].

Enumeration

Continuing with the geometric tone of our presentation, another idea that will theoretically lead to all the optimal solutions of Problem 4.1 is that of enumerating all the quantization points (a 0 , . . . , a n ) located inside the polytope defined by (4.3). We will not go into the details of the approach; this is explored in [START_REF] Brisebarre | Computing machine-efficient polynomial approximations[END_REF] and [START_REF] Chevillard | Évaluation efficace de functions numériques[END_REF]Ch. 2.3.3] for function approximation. By carefully constructing P, the goal is to only deal with a small number of candidate solutions (less than if we use projection). Again, this seems to be feasible only for very small degrees (n < 15). Example 4.2 for instance, was much too time consuming. For testing the approach, we wrote a prototype C++ implementation with the help of the ISL library [START_REF] Verdoolaege | isl: An integer set library for the polyhedral model[END_REF], which features state of the art algorithms for the enumeration of integer points inside polyhedra. On the specifications from Table 4.2, we only managed to go up to degree n = 10 filters. The running time generally ranged from several minutes for n = 5 up to a dozen hours for some n = 10 instances.

Mixed Integer Linear Programming

A more fruitful approach is to cast the design problem as an MILP and apply branch-and-bound strategies. Instead of attacking Problem 4.1 directly, the goal is to solve The set X d ⊂ X should be dense enough such that the solution of (4.8) is not far from the optimal one over X. For instance, a number of 16n points (the value used by default for most discretized versions of the Remez exchange algorithm found in many Signal Processing packages) is in general sufficient for practical purposes and will actually produce a solution over X as well. We found that in some cases, a smaller number of points inside X d continued to produce an optimal result over X, while in others it did not.

minimize δ subject to n k=0 a k ϕ k (x) -f (x) δ, x ∈ X d , f (x) - n k=0 a k ϕ k (x) δ, x ∈ X d , δ > 0, a k ∈ F k , k = 0, . . . , n.
MILPs of the form (4.8) have been studied quite a lot in the literature. Implementation-wise, it is easy to code up such an MILP instance using current mathematical optimization suites. In our tests we use two particular solvers. One relies on the commercial Gurobi library [START_REF]I. Gurobi Optimizer Reference Manual[END_REF], which performs computations in double precision arithmetic. It is capable of addressing instances with n < 30 and coefficients with word-lengths of up to 10 bits in under a minute in many cases. For slightly larger degrees and/or wordlengths on the other hand, it quickly becomes much slower.

The other one is an exact solver based on a multiple precision implementation of the simplex algorithm [START_REF] Cook | A hybrid branch-and-bound approach for exact rational mixed-integer programming[END_REF], a fork of the SCIP optimization suite [START_REF] Achterberg | SCIP: Solving constraint integer programs[END_REF]. It is therefore also very slow. An exact solver is nevertheless useful if one wants to validate the quality of the result. Although most practitioners would probably see this as overkill, it's impressive in itself that with current tools, we are able to offer such guarantees.

By a validated result, we mean that the exact solution for an instance of (4.8), provides a true lower bound for δ opt . In the case of Example 4.2, using an X d with 400 > 22 • 16 points gives us

δ = 5675024184985759775800304352648757143647490133510571 191561942608236107294793378393788647952342390272950272 2.96250085362298 • 10 -2 ,
taking around 2891 seconds on a machine equipped with an Intel i7-3687U CPU, as opposed to the 5.83 seconds required by the double precision solver. For a rigorous upper bound, we can for instance obtain one by taking the quantized polynomial given by the MILP solver (whose coefficients are given by (4.7)) and applying the supnorm command from Sollya, the algorithm of which is described in [START_REF] Chevillard | Efficient and accurate computation of upper bounds of approximation errors[END_REF]. We then obtain the validated upper bound

δ = 2.9627506969723628177056238246104743540753907011893 • 10 -2 ,
meaning the exact error δ opt of the minimax solution is provably inside the interval [δ, δ].

A heuristic approach

In the context of finite precision function approximation problems for libm design, Brisebarre and Chevillard [START_REF] Brisebarre | Efficient polynomial L ∞ -approximations[END_REF] advocate the idea of using a well-chosen discretized version of Problem 4.1 (the fpminimax algorithm).

In our case, the basis functions (ϕ i ) 0 i n are appropriately scaled as discussed in the beginning of this section. We then search for a i ∈ [m -, m + ] ∩ Z such that δ opt is minimal. Ideally, if the format constraints given by m -, m + and s are not too strict, then we expect the integral solution (a 0 , . . . , a n ) to match as close as possible the infinite precision solution p , obtained for instance using the Remez exchange algorithm. If we take m + 1 n + 1 distinct points (z i ) 0 i m from X, then it should hopefully follow that

n i=0 a i      ϕ i (z 0 ) ϕ i (z 1 )
. . .

ϕ i (z m )      bi      p (z 0 ) p (z 1 ) . . . p (z m )      t (4.9)
For the vector t ∈ R m+1 , we want to find the integer combination of m + 1-dimensional basis vectors b 0 , . . . , b n closest to it with respect to a certain norm (as will be explained, we use the Euclidean norm). If we do that, the result will probably give us a good estimation of the actual solution of Problem 4.1.

The integer combinations of vectors on the left hand side of (4.9) are called lattice vectors, whereas the problem of determining a lattice vector which is closest to a targer vector t is called the closest vector problem or CVP. Over the course of the next section we will review some basic facts regarding lattices. We will also look at some important problems and algorithmic approaches used to solve them. They will be essential in describing our method in Section 4.4. Remark 4.3. It is not mandatory to compute p if we replace the CVP instance in (4.9) with

n i=0 a i      ϕ i (z 0 ) ϕ i (z 1 )
. . .

ϕ i (z m )      bi      f (z 0 ) f (z 1 ) . . . f (z m )      t , (4.10)
after having chosen the nodes z 0 , . . . , z m . It makes sense to do so, since the computed approximant will in fact need to be close to f and not necessarily p . Both (4.9) and (4.10) tend to produce very good results, but neither seems to be globally best in practice. This is why we will continue to use (4.9) in the sequel, although everything we say applies to (4.10) also.

Euclidean lattices

The study of lattices has sparked the interest of some highly influential mathematicians such as Lagrange [START_REF] Lagrange | Recherches d'arithmetique[END_REF], Gauss [START_REF] Gauss | Disquisitiones arithmeticae[END_REF] (in the study of binary quadratic forms) and Hermite [START_REF] Hermite | Extraits de lettres de M. Ch. Hermite à M. Jacobi sur différents objects de la théorie des nombres.(Continuation)[END_REF]. They are the core of an important branch of Number Theory called Geometry of Numbers, which was introduced as a mathematical discipline by Minkowski [START_REF] Minkowski | Geometrie der Zahlen[END_REF] in the second half of the 19th century. Today, Euclidean lattices are also seen as powerful geometric objects with many applications in Mathematics and Computer Science. Some notable examples include diophantine approximation, error correcting codes in Information Theory, solutions of integer programming problems and cryptographic security.

Some basic results

We will be working in the R n vector space and, for the most part, consider the 2 Euclidean norm

x 2 = x, x , x ∈ R n .
At the bare minimum, a lattice is just a discrete subgroup of (R n , +). Given a set of vectors {b 1 , . . . , b d } ⊂ R n , d n, it will be useful to consider the set

L = L({b i : 1 i d}) = d i=1 x i b i : x i ∈ Z ,
which is a subgroup of R n , but not necessarily a lattice. For L to be a lattice it will suffice that either the b i vectors belong to Q n or that they are linearly independent R n vectors (see [156, Ch. 2, Thm. 1]). Equivalently, if we take B as the n × d matrix whose columns are the basis vectors b 1 , . . . , b d , then the lattice they generate can also be defined as

L = L(B) = Bx : x ∈ Z d .
A very natural example is the integer lattice Z n , which has as possible basis, the set of n-dimensional unit vectors {e 1 , . . . , e n }. It is not hard to check that, when dealing with any rank d 2 lattice, it will have infinitely many bases.

If we already know a basis B of L, we can algebraically tell if another matrix B is also a basis. It is the analogue of the change of basis operation for finite dimensional vector spaces and relies on the use of unimodular matrices, that is elements U ∈ Z d×d with det U = ±1. Proof. Assume that L(B) = L(B ). This implies that each column of B can be written as an integer combination of columns of B, meaning there exists U ∈ Z d×d such that B = BU. Analogously, there exists V ∈ Z d×d for which B = B V. We have B = BU = B VU and consequently B T B = (VU) T B T B (VU). By taking determinants, we get det(B T B ) = (det(VU)) 2 det(B T B ). We also have det(B T B ) = 0. If this were not true, then there exists x ∈ R d \ {0} such that B T B x = 0, meaning B x 2 = 0 and B x = 0. Since the columns of B are linearly independent, x = 0, resulting in a contradiction. It then follows that det(V) det(U) = ±1. Since both U, V are integer matrices, det(U) = ±1.

In the other direction, we have B = BU for some unimodular matrix U. This means that each column of B is an integer combination of columns of B (i.e., L(B ) ⊆ L(B)). Also, B = B U -1 . The reader can easily check that U -1 is also unimodular (the set of unimodular matrices forms a group under matrix multiplication), leading to L(B) ⊆ L(B ). The conclusion L(B) = L(B ) then follows.

The analogy with vector spaces should be done with care. For instance, a rank d lattice L can have a proper sublattice L ⊂ L of the same rank. An example is Z 2 , which has the lattice 2Z × Z as a proper subset. Definition 4.6 (Fundamental parallelepiped). For any given lattice basis B, its fundamental parallelepiped is

P(B) = d i=1 x i b i : x i ∈ R, 0 x i < 1 .
Examples can be seen in the gray areas of Figures 4.1 and 4.2, where it is visible that a fundamental parallelepiped depends on the basis. A final basic notion we will be requiring is the following

The shortest vector problem

In practice, there are certain bases which are considered to be better than others. For instance, it seems reasonable to prefer a basis which allows us to move easily in the vicinity of a given point (i.e., it favors local searches inside the lattice). In the case of Z 2 , the canonical basis from Figure 4.1 is preferable to the one from Figure 4.2.

Continuing with this train of thought regarding locality, a natural question presents itself: what is the shortest nonzero vector inside a lattice? This is known as the shortest vector problem (SVP). Since in R n all norms are equivalent, it makes sense to ask this question with respect to any norm. Our interest here will be more focused towards the 2 and ∞ norms. Note in particular that the solution depends on the norm (Figure 4.3). When not referring to a particular norm in the sequel, we will use the notation • . Related to the concept of shortest nonzero vector (which we will simply call shortest vector in the sequel), Minkowski defined its length as the first minimum of the lattice L, denoted with λ 1 (L). This leads to the notion of successive minima inside a lattice:

Definition 4.9 (Successive minima). If L ⊂ R n is a rank d lattice, for 1 i d, the i th minimum of L is λ i (L) = min u1,...,ui∈L independent max 1 j i u j .
From this definition, it follows that λ 1 (L) . . . λ d (L). Figure 4.4 gives an example. Ideally, reducing to a basis whose vectors have lengths corresponding to the successive minima is desirable, but as soon as n 5 such a basis need not exist (for an example, see for instance [START_REF] Nguyen | The LLL Algorithm -Survey and Applications[END_REF]Ch. 2]). It is also immediate to note that the shortest vector in a lattice is not unique (e.g., if u is a SVP solution, then so is -u). Related to the length of a shortest lattice vector, Minkowski proved the following result: Unfortunately, the proof of this theorem (see for instance [START_REF] Barvinok | A Course in Convexity[END_REF]Ch. 7.3]) relies on a kind of pigeonhole principle, making it non-constructive. Computationally, Van Emde Boas showed that the SVP problem is NP-hard in the ∞ setting [START_REF] Van Emde Boas | Another NP-complete problem and the complexity of computing short vectors in a lattice[END_REF]. For the 2 norm, Ajtai [START_REF] Ajtai | The shortest vector problem in l 2 is NP-hard for randomized reductions (extended abstract)[END_REF] proved the problem to be NP-hard under randomized reductions (see for instance [START_REF] Micciancio | Complexity of lattice problems: a cryptographic perspective[END_REF]Ch. 4] for further explanations). As a consequence, in applications we might be content with vectors that prove to be short enough (see the next section): Definition 4.11 (Approximate Shortest Vector Problem (aSVP)). For a basis B of a rank d lattice L ⊂ R n and an approximation factor γ 1, find a nonzero vector u of L such that u γ min v∈L\{0} v .

Lattice basis reduction

Geometrically, the process of determining a lattice basis with reasonably short vectors (lattice basis reduction) implies that such vectors are not far from being orthogonal to one other. In finite-dimensional vector spaces, this could correspond to finding an orthonormal basis.

b i = b i - i-1 j=1 µ i,j b j , where µ i,j = b i , b j b j , b j . (4.11)
It is easy to verify that, for all 1 i d, span(b 1 , . . . , b i ) = span(b 1 , . . . , b i ) and that the GSO family depends on the order of the basis vectors. Even though the b i 's do not usually belong to L, they are strongly connected to the characteristics of L.

The main reason for this is that Gram-Schmidt orthogonalization triangulates a given basis. Indeed, if we express b 1 , . . . , b d using the orthonormal basis (b 1 / b 1 2 , . . . , b d / b d 2 ), then the coordinates of each b i in this basis are given by the lines in the triangular matrix

        b 1 2 0 • • • 0 µ 2,1 b 1 2 b 2 2 • • • 0 . . . . . . . . . . . . . . . . . . . . . 0 µ d,1 b 1 2 • • • µ d,d-1 b d-1 2 b d 2        
.

The reader can check that the lattice L spanned by b 1 , . . . , b d satisfies

det(L) = d i=1 b i 2 .
Because of (4.11), b i 2 b i 2 and hence det(L)

d i=1 b i 2 .
This leads to a possible way of quantifying how orthogonal a given lattice basis is:

Definition 4.13. If B is a basis for a rank d lattice L ⊂ R n , then the orthogonality defect of B is the constant δ(B) = d i=1 b i 2 det(L)
.

It follows that δ(B) 1, with equality if and only if B is composed of orthogonal vectors. Another consequence of the GSO process is the following: Lemma 4.14. If B is a basis of a rank d lattice L ⊂ R n in the 2 setting, then its GSO satisfies

λ 1 (L) min 1 i d b i 2 .
Proof. Take v = n i=1 a i b i ∈ L and assume its length equals the first successive minimum of L. At least one of the a j coefficients is nonzero (take j to be the smallest such index). Representing v in the orthonormal basis (b

1 / b 1 2 , . . . , b d / b d 2 ) gives λ 1 (L) = v 2 |a j | b j 2 min 1 i d b i 2 .
Of particular interest to us should be the fact that b 1 = b 1 . If the Gram-Schmidt vectors have increasing lengths, then b 1 will be a SVP solution in 2 . Such a basis seems to be inexistent in most cases, and even if one did exist, NP-hardness would make it difficult to compute. Despite this, we will see that there are polynomial time algorithms that allow us to construct a basis for which its Gram-Schmidt vectors do not decrease in length too fast.

Size-reduction

A first step for introducing such algorithms uses an idea due to Hermite [START_REF] Hermite | Extraits de lettres de M. Ch. Hermite à M. Jacobi sur différents objects de la théorie des nombres.(Continuation)[END_REF]:

Definition 4.15 (Size-reduction). A basis {b 1 , . . . , b d } of a lattice L ⊂ R n is called size-reduced if its Gram-Schmidt coefficients µ i,j satisfy |µ i,j | 1 2 ,
for all 1 j < i d.

Geometrically, this notion states that each b i is already as close as possible to the orthogonal complement of b j , for all j < i (i.e., by projecting b i on the orthogonal complement of b j , less than half the vector b j needs to be added or subtracted). In other words, it is a basis which is closest to its GSO. From the Pythagorean theorem and b

i = b i + j<i µ i,j b j , it follows that b i 2 2 b i 2 2 b i 2 2 + 1 4 i-1 j=1 b j 2 2 ,
meaning the size of the basis vectors are not much different from those of its GSO.

Computing a size-reduced basis is fairly straightforward if we tweak (4.11) (the reader should check that it is indeed the case):

Algorithm 8: Size-Reduce Input: a basis B of a rank d lattice L ⊂ R n Output: a size-reduced basis B of L 1 B ← GSO(B) 2 b 1 ← b 1 3 for k ← 2 to d do 4 b k ← b k 5 for j ← k -1 downto 1 do 6 b k ← b k - b k ,b j b j ,b j b j 7 return (b 1 , . . . , b d )
Size-reduction is a rather weak property by itself. This is due, most of all, to the fact that it does not change the b i 2 's, not directly serving our goal of having a basis with slowly decreasing GSO vectors. Also, it does not necessarily bound the length of the b i 's in Definition 4.15. A nice example, taken from [209, Ch. 2.2.1], consists of generating Z 2 by using the basis

B n = F n+1 F n-1 F n+2 F n ,
where F n is the n th Fibonacci number (i.e.,

F 0 = F 1 = 1, F n = F n-1 + F n-2 , n 2). B n is size-reduced because F k = (F k+2 -F k-1 )/2 F k+2 /2 and hence |µ 2,1 | = F n+1 F n-1 + F n+2 F n F 2 n+1 + F 2 n+2 F 2 n+1 /2 + F 2 n+2 /2 F 2 n+1 + F 2 n+2 = 1 2 .
As we increase n, the columns of B n become arbitrarily large. Nevertheless, size-reduction does serve as an important ingredient for stronger types of basis reductions.

LLL-reduction

Up to this point, our angle of attack was to only modify the basis vectors. Since we expect a size-reduced basis to be close to its Gram-Schmidt vectors, it is natural to try and update the basis vectors in such a way that the quality of its GSO also improves (in the sense of successive GSO vectors with slowly decreasing lengths). A notion of reduction achieving this is the following:

Definition 4.16 (LLL-reduction). A basis {b 1 , . . . , b d } of a lattice L ⊂ R n is said to be LLL-reduced with factor δ ∈ 1 4 , 1 if it is size-reduced and
δ b i 2 2 b i+1 + µ i+1,i b i 2 2 , (4.12)
for all 1 < i d.

The inequality (4.12) is known as the Lovász condition and is equivalent to

(δ -µ 2 i+1,i ) b i 2 2 b i+1 2 2 ,
basically saying that b i+1 is not much shorter than b i . The decrease in the size of the b i 's is at most geometric. Indeed, because of size-reduction (µ 2 i+1,i

1/4) we have b i+1 2 2 (δ -1/4) b i 2 2
, which coupled with Lemma 4.14 also gives a bound on the SVP solution with respect to b 1 :

λ 1 (L) (δ -1/4) d-1 b 1 2 .
The LLL tag comes from the names of A. K. Lenstra, H. W. Lenstra and L. Lovász, whom, in 1982, devised an algorithm [START_REF] Lenstra | Factoring polynomials with rational coefficients[END_REF] to compute lattice bases satisfying Definition 4.16 as a method to factor polynomials with rational coefficients in polynomial time. In its simplest form, the LLL algorithm works as follows:

Algorithm 9: LLL Input: a basis B of a rank d lattice L ⊂ R n , δ ∈ 1
4 , 1 // at the end of execution, B will be δ-LLL-reduced 1 B ← Size-Reduce(B) 2 if there exists a (smallest) index i violating the Lovász condition (4.12) then 3 swap b i and b i+1 and goto 1 A proof of the fact that this algorithm terminates in a finite number of operations can be consulted in [START_REF] Lenstra | Factoring polynomials with rational coefficients[END_REF] or [START_REF] Cohen | A course in computational algebraic number theory[END_REF]Ch. 2.6]. It is nonetheless constructive to sketch the idea here. Each time two vectors b i and b i+1 get swapped, only their GSO vectors change. If we denote these new GSO vectors with c i and c i+1 , then

c i 2 • c i+1 2 = b i 2 • b i+1 2 ,
a consequence of the fact that the product of the GSO vector lengths is a lattice invariant. Since the Lovász condition does not hold, we have c i

2 2 = b i+1 + µ i+1,i b i 2 2 < δ b i 2 2
, which coupled with the last equality gives

c i 2(d-i+1) 2 • c i+1 2(d-i) 2 < δ b i 2(d-i+1) 2 • b i+1 2(d-i) 2
.

Table 4.3: Lattice basis reduction algorithms

Algorithm

SVP approximation factor Time

LLL δ [132] (δ -1/4) -(d-1)/2 poly (d) BKZ β [97, 184] ≈ β d/β poly (d)2 O(β) HKZ [113] 1 2 O(d)
factor, but the constant c drops down to roughly 1.05. It seems highly plausible that similar facts hold for BKZ [START_REF] Chen | 2.0: Better Lattice Security Estimates[END_REF]. We already point out that in our setting, the performances of all these algorithms, both in terms of approximation factor and of complexity, seem significantly better than expected -HKZ-reducing a random lattice of rank greater than 60 is, as of today, a considerable task, whereas we were able to do it on instances of rank up to 101 coming from our problems in less than half a minute (see the discussions in Sections 4.4 and 4.5).

The closest vector problem

Another important question in lattice theory is that of the closest lattice vector to an arbitrary point t ∈ R n , the inhomogeneous extension of the shortest vector problem: Definition 4.19 (Closest Vector Problem (CVP)). Given a d-rank lattice L ⊂ R n and a target vector t ∈ R n , find a lattice vector x ∈ L such that tx = dist(t, L).

Similar to SVP, van Emde Boas showed this problem to be NP-hard, for the 2 and ∞ norms [START_REF] Van Emde Boas | Another NP-complete problem and the complexity of computing short vectors in a lattice[END_REF]. If L ⊆ Z n , then CVP is also NP-hard to approximate within any constant factor or sub-polynomially in the lattice rank [START_REF] Arora | The hardness of approximate optima in lattices, codes, and systems of linear equations[END_REF][START_REF] Dinur | Approximating CVP to within almost-polynomial factors is NP-hard[END_REF]. From the same complexity point of view, CVP is regarded as being harder than SVP in the same dimension, due to the fact that a CVP oracle can be used to solve a SVP instance [START_REF] Goldreich | Approximating shortest lattice vectors is not harder than approximating closest lattice vectors[END_REF][START_REF] Henk | Note on shortest and nearest lattice vectors[END_REF].

It turns out nonetheless that lattice basis reduction can be an effective way to find approximate solutions to the closest vector problem in the 2 setting. We briefly present three such approaches here. The first two are due to Babai [START_REF] Babai | On Lovász' lattice reduction and the nearest lattice point problem[END_REF], while the idea for the third one comes from Kannan [START_REF] Kannan | Minkowski's Convex Body Theorem and Integer Programming[END_REF].

Babai's algorithms

The idea for Babai's rounding algorithm is a very simple one, but assumes that t ∈ span(L). If L has a basis B and is of rank d, then t = d i=1 α i b i , α i ∈ R and we just take x = d i=1 α i b i ∈ L. This method is shown to solve CVP to within an approximation factor γ(d) = 1 + 2d(9/2) d/2 if B is LLL-reduced with δ = 3/4. In particular, if B is orthogonal, then x would be the exact 2 norm CVP solution. When t / ∈ span(L), then we can first orthogonally project t onto span(L) to apply the method. Babai's nearest plane algorithm, on the other hand, is a bit more involved, but can essentially be viewed as the size reduction of t with respect to b 1 , . . . , b d . The starting point is to consider t as expressed with respect to the GSO vectors of B, with the lattice vector x = Its name comes from the fact that each b i can be seen as defining a plane, with x emerging as we repeatedly take the plane closest to t.

Just like with the rounding algorithm, the nearest plane approach depends on the quality of the initial basis B. If it is LLL-reduced, then we get a CVP approximation factor of (δ-1/4) -(d-1)

(5/4-δ)

, which for δ = 3/4

(the default reduction parameter generally considered in the literature) stands at 2 d/2 , slightly better than with rounding.

coefficients a i satisfy m -a i m + , even though we have never encountered a case in practice where this is not so.

The first step is treated in considerable detail in Chapter 3, so our focus here will be mostly towards the second and third steps. We will again consider the specification of Example 4.2 as a worked example. Note that if we had chosen to use (4.10) instead of (4.9), step 1 can be bypassed.

Suitable interpolation points

Since we are doing something akin to weighted polynomial interpolation, it seems reasonable to pick a discretization of X which behaves well with respect to interpolation. From Section 3.6.3, good choices are points which follow the equilibrium distribution of X. In our case, those could be:

(a) the final reference set of p , when applying the exchange algorithm p (i.e., the local extrema of e = fp over X);

(b) the zeros of e over X together with the endpoints of the intervals composing X;

(c) the approximate Fekete points we proposed to initialize the exchange algorithm in Section 3.6.

Choices (a) and (c) give us a number of n + 2 points each, whereas (b) will also result in at least n + 2 points (if X is composed of b bands, we will have at least n + 2b zeros, one between each pair of final reference points of p located inside the same subinterval of X and the 2b endpoints, resulting in at least n + 2 + b points). Based on our discussion from Section 3.6, the number of AFPs we generate can be varied, so taking a size n + 1 or larger AFP-based discretization is also possible.

Besides the fact that such points are good for interpolation/approximation purposes, the lattices that they generate for eq. (4.9) have very well-behaved starting bases. To show this, let us first consider the case where X = [-1, 1] and the particular grid of n + 1-st order Chebyshev nodes of the second kind

ν i = cos (n-k)π n
, k = 0, . . . , n, which follow the equilibrium distribution of X for polynomial approximation (see for instance [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 12]). For a type I degree n filter with uniform weight over [-1, 1], the basis elements will then be (looking at Table 4.1 and abstracting out the scaling factor by taking s = 2) (n + 1),

     T 0 (ν 0 )/2 T 0 (ν 1 )/2 . . . T 0 (ν n )/2      b0 ,      T 1 (ν 0 ) T 1 (ν 1 ) . . . T 1 (ν n )      b1 , . . . ,      T n (ν 0 ) T n (ν 1 ) . . . T n (ν n )      bn . ( 4
g ii = 1 2 n + 1, 0 < i < n, g nn = n + 1, g i0 = g 0i = 1 + (-1) i 4 , 0 < i n, g ij = 1 + (-1) i+j 2 , i = j; 0 < i, j n.
Proof. This result is a direct consequence of the discrete orthogonality property of Chebyshev polynomials (see Proposition 2.9), which tells us that, if

d ij = 1 2 T i (ν 0 )T j (ν 0 ) + n-1 k=1 T i (ν k )T j (ν k ) + 1 2 T i (ν n )T j (ν n ),
then we have d 00 = d nn = n, d ii = 1 2 n for 0 < i < n and d ij = 0 when i = j; i, j n. We indeed get

g 00 = 1 4 n k=0 T 2 0 (ν k ) = 1 4 d 00 + 1 2 T 2 0 (ν 0 ) + 1 2 T 2 0 (ν n ) = 1 4 (n + 1) , g ii = d ii + 1 2 T 2 i (ν 0 ) + T 2 i (ν n ) = 1 2 n + 1,
g nn = d nn + 1 2 T 2 n (ν 0 ) + T 2 n (ν n ) = n + 1, g i0 = g 0i = 1 2 n k=0 T 0 (ν k )T i (ν k ) = 1 2 d i0 + 1 2 T 0 (ν 0 )T i (ν 0 ) + 1 2 T 0 (ν n )T i (ν n ) = 1 + (-1) i 4 ,
and

g ij = d ij + 1 2 T i (ν 0 )T j (ν 0 ) + 1 2 T i (ν n )T j (ν n ) = 1 + (-1) i+j 2 .
This result tells us that the Gram matrix is almost diagonal, meaning the basis vectors b 0 , . . . , b n are very close to being orthogonal. If we think about basis reduction, ideally there will also be an almost orthogonal feel to the reduced basis vectors because of the invariant nature of the lattice volume.

As a consequence, the associated Gram-Schmidt vectors will have slow varying lengths:

= g 11 = n(n+1+1) 2(n+1-1) . b 2 = b 2 - b 2 , b 1 b 1 , b 1 b 1 - b 2 , b 0 b 0 , b 0 b 0 = b 2 - g 20 g 00 b 0 = b 2 - 2 n + 1 b 0 , which means that b 2 2 2 = b 2 - 2 n + 1 b 0 , b 2 - 2 n + 1 b 0 = b 2 2 2 + 4 (n + 1) 2 b 0 2 2 - 4 n + 1 b 0 , b 2 = n 2 + 1 + 1 n + 1 - 2 n + 1 = n 2 + 3n + 2 -2 2(n + 1) = n(n + 2 + 1) 2(n + 2 -1) . Similarly b 3 = b 3 - b 3 , b 2 b 2 , b 2 b 2 - b 3 , b 1 b 1 , b 1 b 1 - b 3 , b 0 b 0 , b 0 b 0 = b 3 - g 31 g 11 b 1 = b 3 - 2 n + 2 b 1 and b 3 2 2 = b 3 - 2 n + 2 b 1 , b 3 - 2 n + 2 b 1 = b 3 2 2 + 4 (n + 2) 2 b 1 2 2 - 4 n + 2 b 1 , b 3 = n 2 + 1 + 2 n + 2 - 4 n + 2 = n 2 + 4n + 4 -4 2(n + 2) = n(n + 3 + 1) 2(n + 3 -1)
.

The rest follows from induction. Assume that the requested equalities hold true for b 1 , . . . , b k-1 . We will only consider the case when k = 2m < n; odd k < n can be treated analogously.

From the GSO definition and the target identities being true for i < 2m, we have that

b 2m = b 2m - m-1 j=0 µ 2m,2j b 2j .
Writing each b 2j in this last expression in terms of the original basis vectors as given by the (4.15) identities already established, gives

b 2m = b 2m + m-1 j=0 c j b 2j ,
where

c j = -µ 2m,2j + m-1 =j+1 2 n + 2 -1 µ 2m,2 .
We need to show that c j = -

2 n+2m-1 , 0 j < m. If < m, µ 2m,2 = b 2m , b 2 b 2 , b 2 = b 2m , b 2 - 2 n+2 -1 b 2 -2 - 2 n+2 -1 b 2 -4 -. . . - 2 n+2 -1 b 0 n(n+2 +1) 2(n+2 -1) = 1 - -1 2 n + 2 -1 -. . . - 2 n + 2 -1 - 1 n + 2 -1 n(n+2 +1) 2(n+2 -1) = 2 n + 2 + 1 ,
which then results in

c j = - 2 n + 2j + 1 + m-1 =j+1 4 (n + 2 -1)(n + 2 + 1) = - 2 n + 2j + 1 + m-1 =j+1 2 n + 2 -1 - 2 n + 2 + 1 = - 2 n + 2m -1 .
For the norm of b 2m , we have

b 2m 2 2 = b 2m - 2 n + 2m -1 m j=1 b 2m-2j , b 2m - 2 n + 2m -1 m j=1 b 2m-2j = b 2m 2 2 + 4 (n + 2m -1) 2 m j=1 b 2m-2j 2 2 - 4 n + 2m -1 m j=1 b 2m , b 2m-2j + 8 (n + 2m -1) 2 1 i<j m b 2m-2i , b 2m-2j = n + 2 2 + 2(n + 2)(m -1) + n + 1 (n + 2m -1) 2 - 4m -2 n + 2m -1 + 4(m -1) 2 (n + 2m -1) 2 = n(n + 2m + 1) 2(n + 2m -1)
.

The norm of b n is also computed in the same manner, in the sense in the end we will have Based on Lemma 4.20 and (4.15), one can easily check that B is already size-reduced. Inside the Lovász condition (4.12), we have that µ i+1,i = 0, 0 i < n. From (4.16) and (4.17) it also follows that b n-1

b n 2 2 = n 2 + n(2n + 1) 2(2n -1) = 2n 2 2n -1 . i b i 2 max 0 i n b i 2 i b i 2 max 0 i n b i 2 i b i 2 max 0 i n b i 2 i b i 2 max 0 i n b i 2 i b i 2 max 0 i n b i 2 i b i 2 max 0 i n b i 2
b i+1 2 2 b i 2 2 = (n + i + 2)(n + i -1) (n + i)(n + i + 1) > 1 2 , 0 i < n -1,
2 2 = 2n -1 2(2n -2) > 1 2 , 0 i < n -1,
which means that B is a δ-LLL-reduced basis with δ > 0.5. Even though the value of δ will be close to 0.5, the computational effort to reach a δ = 0.99 LLL-reduced basis (the default value used in our tests) seems to be very modest in practice, as we shall see.

To a slightly lesser extent, this good behavior carries over to multi-interval domains as well, although we are not able to produce such a closed-form analysis as the one in Lemmas 4.20 and 4.21. A theoretically grounded intuition for why this is the case can nonetheless be given by taking into account how the greedy heuristic for choosing approximate Fekete points works. Recalling our discussion from Section 3.6.1, each basis vector corresponding to a new point is chosen such that the volume it generates with the previously selected vectors is as large as possible. Empirically, this suggests that the chosen basis vectors will be close to orthogonal to one another and the lengths of their Gram-Schmidt vectors will not vary by huge factors. the AFP-generated one in particular, we notice that b 0 is the shortest GSO vector, which, by Lemma 4.14, means that b 0 is a solution for the corresponding 2 SVP problem. After performing LLL reduction in the right column, b 0 becomes the shortest GSO vector in all three cases. 4.2, with 22-bit (21 bits for the fractional part) filter taps. The top row corresponds to the situation before any basis reduction algorithm was applied, whereas the bottom row shows the effect of LLL reduction. BKZ (with block size β = 8) and HKZ reductions give very similar results, which is why they are not shown. A grid of n + 2 equispaced points inside the convex hull of X was used.

i b i 2 max 0 i n b i 2 i b i 2 max 0 i n b i 2 i b i 2 max 0 i n b i 2
i b i 2 max 0 i n b i 2 i b i 2 max 0 i n b i 2
Increasing n does not degrade by much the quality of the obtained bases. Figure 4.6 explores this for a degree n = 62 problem. There is a relatively small decrease in the lengths of successive b i 's even before any reduction is applied and the rate of decrease after reduction seems only slightly slower than before. Also, and maybe more importantly, there are no essential differences in the quality of the obtained bases when different reduction algorithms are applied (middle and bottom rows). This tells us that, for our context, it is better to prefer LLL reduction due to its smaller execution times. Remark 4.22. If we take a bad discretization for approximation/interpolation purposes, for instance n + 2 nodes which are equispaced inside the convex hull of X, then the initial lattice also seems to be of lesser quality. This is visible in Figure 4.7 for the same degree n = 62 specification as before. The dynamic range of the GSO vector lengths of the initial basis is much larger than in Figure 4.6 and considerable improvement is made after basis reduction. Still, we would not use such a basis in practice. Also, in this particular case, the time required to run the LLL algorithm is around 4 four times higher than if using one of the good discretization alternatives.

An approximate solution for the resulting CVP instance

Following our discussion on Kannan embedding in Section 4.3.4, our heuristic solution to (4.9) relies on the basis change b

0 b 1 • • • b n t 0 0 • • • 0 γ Bt basis reduction ---------→ b 0 b 1 • • • b n b n+1 0 0 • • • 0 γ B t , (4.18)
where γ = max 0 i n b i 2 and γ ∈ {±γ}. Generally, implementations of basis reduction algorithms like LLL, BKZ or HKZ can also provide the change of basis matrix U ∈ Z (n+2)×(n+2) such that B t U = B t , without modifying the time complexity of the implementation. The a i integer coefficients in (4.9) can then be taken as the first n + 1 coefficients of the last column of U if γ = -γ, or their sign swapped values if γ = γ.

Refining the solution

The result of solving (4.9) gives a small n i=0 a i b it 2 which will usually be close to the optimal 2 CVP solution. Thinking optimistically, our heuristic should also give us a small ∞ error n i=0 a i b it ∞ and, if the (z i ) 0 i m discretization is well chosen, a close to optimal n i=0 a i ϕ if ∞,X value. Taking m to be as small as possible should also be preferred, since by the norm inequality in R m+1 , we have

• ∞ • 2 √ m + 1 • ∞ .
Because the b i vectors in (4.18) are usually short with respect to the 2 norm (and consequently, the ∞ one as well) we can use them to search in the vicinity of n i=0 a i b i to improve our L ∞ target solution. In the function approximation setting, a similar idea is described in [58, p. 128].

Let x = n i=0 a i b i . We then perform the following:

(1) Let x successively denote the vectors x+ε i b i +ε j b j , where ε i , ε j ∈ {0, ±1} , t 1 , t 2 ∈ N, 0 < t 1 < t 2 n and 0 i t 1 < j t 2 . The values of t 1 and t 2 can be chosen by the user.

(2) Express each x as n i=0 a i b i (this is easy to do since each b i can be expressed in terms of b 0 , . . . , b n by taking the corresponding column of U) and pick one for which the resulting a i 's satisfy the format constraints and

n i=0 a i ϕ i -f ∞,X (4.19) is minimal.
In [START_REF] Chevillard | Évaluation efficace de functions numériques[END_REF], the (4.19) error is replaced with a ∞ one that uses the discretization nodes (z i ) 0 i m . While this ensures a faster execution (the resulting ∞ error computations are much less expensive than the L ∞ ones), the quality of the results obtained by using (4.19) should overall be better. The value of t 1 should be very small (say t 1 2) if the computational cost of the vicinity search is to be kept reasonable. In our tests, increasing t 1 beyond 4 did not improve the final output and only incurred a significant execution overhead.

A theoretical estimate of the quality of our solution

Let p be an approximation returned by our algorithm and p opt an optimal solution. We set m = n. Let { k (x)} 0 k n be the Lagrange basis functions associated to S n = span R (ϕ i ) 0 i n and z := {z 0 , . . . , z n }. We denote by Λ Sn,X (z) the Lebesgue constant associated to z and X (see Section 3.6.1 for the corresponding definitions).

Let us consider δ = max 0 k n |p(z k )f (z k )|, the ∞ error yielded by our approximate solution to the CVP stated in (4.10). For all x ∈ X,

p(x) -p opt (x) = n i=0 (p(z i ) -p opt (z i )) i (x),
hence, for all x ∈ X, we have, from (3.8),

|p(x) -p opt (x)| Λ Sn,X (z) max 0 k n |p(z k ) -p opt (z k )| Λ Sn,X (z) max 0 k n (|p(z k ) -f (z k )| + |f (z k ) -p opt (z k )|) Λ Sn,X (z)(δ + ||f -p opt || ∞,X ). Now, if we remember that ||f -p|| ∞,X -||f -p opt || ∞,X ||p -p opt || ∞,X , it follows that ||f -p|| ∞,X (1 + Λ Rn[x],X (z))||f -p opt || ∞,X + Λ Rn[x],X (z)δ.
This inequality tells us that the smaller δ and the Lebesgue constant, the better the approximation quality of the returned polynomial p.

Experimental results

The numerical computations in this section were performed using the multiple precision version of the exchange algorithm discussed in the previous chapter and the lattice basis reduction algorithm implementations from the FPLLL library [START_REF]The FPLLL development team. fplll, a lattice reduction library[END_REF] (also their multiple precision versions). The same machine that performed the computations from Section 4.2 is used here also.

To show the capabilities of our method, we will compare it to the telescoping rounding approach introduced in [START_REF] Kodek | Telescoping rounding for suboptimal finite wordlength FIR digital filter design[END_REF] and the MATLAB DSP Toolbox implementation of the error shaping algorithm from [START_REF] Nielsen | Design of linear-phase direct-form FIR digital filters with quantized coefficients using error spectrum shaping[END_REF], since both these methods address the same coefficient format context as us. We use all three discretization approaches mentioned at the start of Section 4.4.1 and take the best result. On some of the examples, we will use the passband ripple 20 log 10 1+δp 1-δp and stopband attenuation -20 log 10 δ s to measure the quality of our outputs, where δ p and δ s represent the unweighted approximation errors on the passband and stopband, respectively.

We will start with the examples in [124, Table 2]. In terms of design instance codes of the form A35/8, the letter designates the specification from Table 4.2, the second value is the filter length N from (2.10) (meaning a degree n = 17 approximation), whereas the third value is the number of bits used to store the resulting filter taps, which in this case corresponds to b = 8 bits. Out of all these bits, one is used to store the sign of the taps, whereas the remaining b -1 are used to store their fractional part. In the context of Let us first compare the quality of the obtained results between the three different discretization choices (the error from (4.19) after we perform the vicinity search). They are explored in Table 4.4. The first column designates the problem instance, while the next three columns represent the approximation errors at the end of executing our routine for each choice. The fourth column is the average real time (over the three discretization choices) required by the LLL algorithm to work on each corresponding basis B t inside (4.18). Similarly, the fifth column gives the average runtime of the vicinity search after B t and U are computed. The last column gives the total runtime and consists of the execution of all three steps of our heuristic for all three discretization choices. In particular, the 7.1 seconds required for A45/8 (the specification for Example 4.2) is higher than the 5.83 seconds needed by the double-precision MILP solver. This is mainly due to the use of multiple precision in our code (a default value of 200 bits of precision in our MPFR-based routines).

We used multiple precision because it provides a safer context for performing basis reduction, but for speed considerations, both the minimax computation using the Parks-McClellan algorithm and the vicinity search should behave in double-precision arithmetic without any numerical issues. Switching to double-precision in those contexts should decrease the total runtime by at least an order of magnitude. We are currently investigating precisely which parts of the implementation can be done in double precision arithmetic, without any significant accuracy impact towards the final result.

Nevertheless, since we are dealing with offline computations, a runtime of less than a minute for the larger degree problems should not be a limitation for our method (MILP approaches seem to require significantly more time for those instances). In terms of error values, it becomes clear from these 15 examples that none of the three discretization choices is universally better than the others, although all of them seem to provide pretty similar results. This is why we work with all of them and at the end we pick the best result. 4.5 offers information about the use of LLL, BKZ and HKZ reduction. The results in columns 2 to 4 represent the best values after all three discretization choices were tried, while the last three columns show the average run times of the basis reduction algorithms on B t . We remark that the more expensive algorithms like BKZ and HKZ do not seem to offer many improvements over LLL in our context. This means that LLL already performs a very good job, matching our analysis from Section 4.4.1. HKZ-reducing a random lattice of dimension greater than 60 is, as of today, a considerable task. The fact that HKZ managed to finish in less than two minutes for the degree n = 62 instances considered here is further experimental proof of the good basis reduction properties of the lattices appearing in our problems. 4.6, the second column gives the real-valued coefficient minimax error computed using the Parks-McClellan algorithm. All remaining columns represent approximation errors of the transfer function for various finite precision coefficient strategies. The third column errors are optimal in the sense that most of them (i.e., those corresponding to the problems without a † or ‡ tag) are obtained using an MILP solver. Problems marked with † (of degree n = 62) are those where the exact solver was stopped after a certain time limit and the result given is the best one found so far. The two specifications marked with ‡ also have time-limited MILP values in [START_REF] Kodek | Telescoping rounding for suboptimal finite wordlength FIR digital filter design[END_REF], but during our lattice-based computations we were able to find quantizations with smaller errors (in less time), which are given here.

Column four lists the errors obtained by simply rounding the real-valued minimax coefficients to their closest values in the imposed formats, whereas the fifth column gives the best errors from using the coefficient telescoping rounding approach of [START_REF] Kodek | Telescoping rounding for suboptimal finite wordlength FIR digital filter design[END_REF]Sec. 4]. That article actually describes two versions of the method: a one coefficient version and a two coefficient one. Without going into the details, the one coefficient telescoping method works by iteratively rounding the coefficients, one at a time, starting from a n and finishing at a 0 . At each step, the coefficients which have not yet been discretized are updated in such a way that the approximation error due to this progressive quantization does not grow too large. The two coefficient version is a more complicated variation of this idea. Since we were not able to reproduce many of the results obtained with these methods using our tools, these values are reported here in italic (and represent the best values between the one and two coefficient versions).

The last column gives the best results we obtained with our lattice-based approach, together with the lattice reduction algorithm that generated it. In particular, we remark that the LLL-based results in 12 out of the 15 specifications are on par or better than the telescoping rounding approach. They are also very close to the optimal ones.

Adaptive weighting

Consider now a lowpass filter specification similar to that of [START_REF] Nielsen | Design of linear-phase direct-form FIR digital filters with quantized coefficients using error spectrum shaping[END_REF]Sec. 5]. We want to design a degree n = 34 type I filter with passband [0, 0.4π] and stopband [0.6π, π] in such a way that all coefficients are stored using 16 bits of precision and the stopband attenuation of the final design is maximized. Inside MATLAB, we can first construct a real-valued coefficient filter and then use the error shaping algorithm from [START_REF] Nielsen | Design of linear-phase direct-form FIR digital filters with quantized coefficients using error spectrum shaping[END_REF]: d = fdesign.lowpass('N,Fp,Fst,Ast',68,0.4,0.6,120); Hd = design(d,'equiripple'); Hq = maximizestopband(Hd,16,'Ntrials',100);

The first two lines design an equiripple filter with a 120 dB target stopband attenuation using the Parks-McClellan algorithm, whereas the last one performs the actual coefficient quantization by trying to maximize the quality of the approximation on the stopband. Since the maximizestopband routine is stochastic, we execute it 100 times and take the best result, which has a 101.54 dB attenuation on the stopband.

We can use our heuristic in a similar way to optimize the approximation error more on certain bands (without changing the scaling factor s). This is done by changing the CVP problem (4.9) into

n i=0 a i      α 0 ϕ i (z 0 ) α 1 ϕ i (z 1 )
. . .

α m ϕ i (z m )      bi      α 0 p (z 0 ) α 1 p (z 1 ) . . . α m p (z m )      t ,
where α 0 , . . . , α m ∈ R + . By default, we have α 0 = . . . = α m = 1, but by slightly increasing the α i values corresponding only to the z i nodes located in a certain band, that should decrease the approximation error of our result on that particular band. Typical values we considered are α i ∈ {1. Used in this way, the LLL basis reduction approach on the same starting minimax design gives us a larger 102.83 dB stopband attenuation. These responses are also shown in Figure 4.8. The cost of having a better stopband behavior for our LLL-designed filter is a larger passband ripple (0.046 dB as opposed to 0.013 dB for the error shaping design). This adaptive weighting strategy can also be used on the four examples from Table 4.6 that did not produce the best results. One such case is the lowpass design A125/21. When we used uniform unit weighting for all the interpolation nodes, the initial LLL quantization error was 1.397 • 10 -5 . This value represented the passband error, while the stopband error was a slightly smaller 1.369 • 10 -5 . Running the LLL reduction algorithm with a new passband weight of 1.5 reduces the overall starting error to 1.216 • 10 -5 . This new value corresponds to the stopband, while for the passband we got 1.124 • 10 -5 . Further improving this initial guess with the local search using short lattice vectors decreased the error to what is given in Table 4.7. For the time being, we are not able to fully automate this refinement process. Nevertheless, a filter designer can very quickly experiment with different weighting possibilities and pick the best one. More examples are given in the test file accompanying the code.

Higher degree examples

Filter

Bands

D(ω) W (ω) F [0, 0.2π] [0.205π, π] 0 1 10 1 G [0, 0.4π] [0.405π, 0.7π] [0.705π, π] 1 0 1 1 10 1 H [0, 0.45π] [0.47π, π] 0 1 10 1 I [0, 0.2π] [0.21π, π] 0 1 10 1 J [0, 0.25π] [0.27π, 0.7π] [0.72π, π] 0 1 0 10 1 10 K [0, 0.25π] [0.3π, 0.7π] [0.75π, π] 0 1 0 10 1 10
Although filters with degree n > 100 having small bit size fixed-point coefficients (the largest degree we have considered so far in this section is n = 62) do not seem to be common in practice, we remark that during our tests we were able to handle degrees of up to n = 800 in less than 10 minutes. Some results are shown in Table 4.9, which adhere to the specifications from Table 4.8.

Conclusion and future work

In this chapter we have presented a novel approach for uniform coefficient quantization of FIR filters based on an idea previously introduced in [START_REF] Brisebarre | Efficient polynomial L ∞ -approximations[END_REF] enhanced by the introduction of an efficient discretization of the approximation domain, which transforms the design problem using the language of Euclidean lattices.

The values obtained show that our method is very robust and competitive in practice. It frequently produces results which are close to optimal and/or beats other heuristic approaches. A current endeavor is automatizing the weight changes when trying to improve the quantization quality. It might be interesting to try and address IIR coefficient quantization problems using Euclidean lattices. There are several difficulties which have to be overcome in the rational IIR setting:

• nonlinearity of the transfer function;

• the approximation domain switches from X to a subset of the unit circle;

• ensure stability of the transfer function (control position of the poles).

A complete design chain for FIR filter synthesis on FPGAs

With four parameters I can fit an elephant, and with five I can make him wiggle his trunk.

J. von Neumann

In what follows, we propose an open-source automatic FIR filter synthesis tool1 targeting FPGAs. It is the result of a collaboration with N. Brisebarre, F. de Dinechin and M. Istoan [START_REF] Brisebarre | Automatic generation of hardware FIR filters from a frequency domain specification[END_REF]. User intervention is limited to a very small number of relevant input parameters (a high-level frequency-domain specification and input/output formats) without any sacrifices in terms of design flexibility. All the other design parameters are computed automatically, using the approaches discussed in Chapters 3-4 and the direct-form architecture implementation methodology presented in [START_REF] De Dinechin | Sum-of-product architectures computing just right[END_REF]. Our computations assure that the resulting architecture respects the specification, while attempting to keep the hardware use cost low. A comparison with other mainstream design tools is also performed.

Introduction

FPGAs (Field Programmable Gate Arrays) are maybe the most prominent examples of what is called reconfigurable hardware (i.e., during its lifetime, the logic behavior of the hardware device can be modified by the user and is not fixed during manufacturing, like for the microprocessors we find in our computers). With FPGAs, users can program the behavior of their circuit at the logic gate level using hardware description languages like VHDL or Verilog.

Why FPGAs?

Since their appearance in the 1980s, FPGAs have continued to evolve at a steady pace. Today they are being used in a myriad of domains such as automotive, medical and aerospace, just to name a few. Modern offerings from major vendors like Altera2 and Xilinx3 are in fact a mix of several building blocks: configurable memory elements, high-speed input/output pins, configurable logic blocks (CLBs) composed of multiple smaller look-up tables (LUTs) and programmable routing channels (linked through switch matrices).

These programmable logic blocks are usually structured as a large bidimensional array (see Figure 5.1). Such a structure and the huge duplicity in available resources hint at the massive parallelism FPGAs can achieve. Hardware intellectual property (IP) cores like digital signal processors are also included on FPGAs because of their usefulness in many practical scenarios (such as those requiring FIR filters). To quantify the cost and performance of an FPGA-bound circuit we generally have to look at the resource consumption in terms of memory elements (measured in registers) and programmable logic (measured in terms of LUTs) coupled with its speed/throughput characteristics. In the majority of cases, there is a trade-off to be made between the two (i.e., a faster circuit uses more resources). If we couple this aspect with the reasonable run times required to synthesize a logic design written in a language like VHDL, there is a lot of flexibility to be had, in particular for digital signal processing tasks like FIR filtering [START_REF] Meyer-Baese | Digital signal processing with field programmable gate arrays[END_REF]. We reiterate the fact that a digital filter is usually specified in the frequency domain (FD) by its frequency response, an example of which is provided in Figure 3.2. On that particular example, the specification consists of the passband frequency ω p , stopband frequency ω s , and the bounds δ p and δ s on the passband ripple and stopband attenuation. An actual FIR filter implementation, however, computes sums of products in the time domain (TD) (see eqs. (5.2) and (5.3)). Ideally, such an implementation would look something like Figure 5.2, but due to finite-precision errors, something more akin to Figure 5.3 will in fact be implemented.

Digital filters: from specification to implementation

x[k] × h[0] × h[1] × h[2] × h[3] x[k -1] + x[k -2] + x[k -3] + y [k] Figure 5.2: An ideal FIR filter architecture. SOPC x[k] × h[0] × h[1] × h[2] × h[3] x[k -1] + / ? x[k -2] + / ? x[k -3] + / ? final round y[k] y[k]
To obtain such an implementation of a FIR filter out of its FD specification, a three-step process is usually applied:

Step 1: the focus of Chapter 3. Determine the filter length N and the real coefficients {h[k]} N -1 k=0 of an appropriate frequency response

H(ω) = N -1 k=0 h[k]e -ikω , ω ∈ [0, 2π).
(5.1)

Normally, we want to implement

y [k] = N -1 i=0 h[i]x[k -i].
(5.2)

Step 2: the focus of Chapter 4. As stated before, we are usually limited in what we can do with (5.2), so we quantize each h[k] coefficient to a machine-representable (e.g., fixed-point) number h[k].

Step 3: the focus of this chapter. Implement the time domain computation:

y[k] = N -1 i=0 h[i]x[k -i], (5.3)
where the x[i] are the fixed-point input signal values. Here (5.3) is again an ideal description of the computation, but due to limitations on the output format, the value computed by the implementation will be some y[k] (Figure 5.3). Each of these three steps involves several parameters. The user should only need to provide the values describing the desired FD behavior (e.g., frequency response bands and error masks) and the I/O formats of the implementation, letting the tool take care of the rest in an efficient manner.

Implementation parameter space

Functional, FD parameters and constraints control the first step. The second and third steps depend on architectural, time domain parameters and constraints: the fixed-point format of x[k] (or input format); the format of y[k] (output format); the format of the intermediate products and sums, represented by a ? on Figure 5.3. The filter order N is a parameter shared by all the steps.

The main challenge for a filter designer is that architectural choices made in the time domain obviously also impact the quality of a filter, as specified in the frequency domain. For instance, however clever the filter design may be, the quantization noise added by the I/O formats will affect the filter frequency response. Conversely, the choice of N will also limit the quality of the filter, however large the I/O formats.

To address this difficulty, current mainstream design flows tend to expose all these parameters (including the internal formats that normally should be optimized by the tool). Figure 5.4 shows the parameter interface to MATLAB's filterbuilder tool included in its Signal Processing Toolbox, which goes from a FD specification of the problem to a synthesizable (VHDL or Verilog) hardware description.

Contributions and outline of the present work

Our main goal is to propose a design tool where near-optimal values of most implementation parameters can be deduced, in an automatic way, from 1) the FD filter specification and 2) the desired input/output formats of the signals. A nice side effect is a simplified user experience, since the user is required to provide only these parameters.

The method is automated and based on error analysis performed both in the frequency and time domains. It builds upon recent open-source efforts that address each of the three design steps with guarantees of numerical quality: equiripple designed filters using the Parks-McClellan algorithm (see Ch. 3 or [START_REF] Filip | A robust and scalable implementation of the Parks-McClellan algorithm for designing FIR filters[END_REF]) for step 1, Euclidean lattice-based coefficient quantization (see Ch. 4 or [START_REF] Brisebarre | A Lattice Basis Reduction Approach for the Design of Quantized FIR Filters[END_REF]) for step 2, and sum of products with constants (SOPC) operators [START_REF] De Dinechin | Sum-of-product architectures computing just right[END_REF] for step 3, available in the FloPoCo4 arithmetic operator generator.

FloPoCo (the name comes from Floating-Point Cores) is an open-source tool written in C++ which generates synthesizable VHDL hardware descriptions of arithmetic operators (e.g., multipliers, polynomial evaluators, dot products, etc.). It is largely targeted towards FPGAs and is thus a good choice for the present work.

The robustness results from Ch. 3 make it possible to address a broad class of FIR filters. Our quantization process from Ch. 4 usually gives near-optimal quantized coefficients, whereas MATLAB, for instance, uses by default a randomized process whose output quality is variable. Finally, the architecture from [START_REF] De Dinechin | Sum-of-product architectures computing just right[END_REF] offers a guarantee on the accuracy of the evaluation of the signal in the time domain.

This integration should be done with care because of the mutual impact of FD and TD parameters on the filter quality. We will discuss this interaction in Section 5.3. Section 5.4 shows that our tool leads to efficient architectures when compared to MATLAB-generated ones. Before that, Section 5.2 will survey relevant previous works on the subject.

Background and state of the art

If we focus on solutions that are able to generate hardware FIR filters starting from their FD specification, at the moment of writing this text, the most common choice is very probably MATLAB's Signal Processing toolbox. When working with FPGAs, the mainstream solution is to use vendor tools (from Xilinx, Altera or Actel). They provide FIR IP cores that mainly address step 3, relying on MATLAB/Simulink for coefficient generation and simulation [START_REF] Hwang | Building custom FIR filters using system generator[END_REF]. This justifies why we only compare to MATLAB in Section 5.4.

Open-source alternatives like GNURadio5 or the Scipy signal package6 essentially address only step 1. It is hoped that our present efforts could establish a missing link to FPGA back-end work [START_REF] Lotze | An FPGA-based cognitive radio framework[END_REF][START_REF] Marlow | An enhanced and embedded GNU radio flow[END_REF].

There have been numerous academic works targeting FPGAs or application-specific integrated circuits (ASICs) before the MATLAB hegemony. Unfortunately, none of these efforts (to our knowledge) describes an open-source tool. Among these, [START_REF] Yang | A functional silicon compiler for high speed FIR digital filters[END_REF], [START_REF] Ishikawa | Automatic layout synthesis for FIR filters using a silicon compiler[END_REF], [START_REF] Jain | FIRGEN: a computer-aided design system for high performance FIR filter integrated circuits[END_REF] address all three steps, but without explicit error analysis and no guarantees on the output quality: the two first steps are validated iteratively by simulation. The same holds for some recent work [START_REF] Smyk | FIReWORK: FIR filters hardware structures auto-generator[END_REF] whose main originality is to perform all computations using the Residue Number System (see for instance [START_REF] Taylor | Residue arithmetic a tutorial with examples[END_REF]). The work in [START_REF] Chan | A methodology for automatic hardware synthesis of multiplier-less digital filters with prescribed output accuracy[END_REF] is based on an error analysis that optimizes the formats subject to a prescribed output noise power.

Our method is novel in two respects. Firstly, all previous approaches rely on approximate double-precision computations and/or simulation to evaluate the quality of steps 1 and 2. By using the code from Ch. 3 and 4, we can, afterwards, if needed, provide guaranteed upper bounds on the obtained frequency domain errors (see discussion from Section 4.2.1 regarding the use of Sollya's supnorm command).

Secondly, all these previous methods (including the MATLAB-based approach) are based on shift-and-add constant multipliers (that is, multiplier circuits where one of the inputs is a constant and the other is a variable), thus avoiding the use of more expensive general purpose multipliers. Our work, on the other hand, uses the fused SOPC architecture of [START_REF] De Dinechin | Sum-of-product architectures computing just right[END_REF]. There, constant multipliers use an optimization of the KCM algorithm [START_REF] Chapman | Fast integer multipliers fit in FPGAs (EDN 1993 design idea winner)[END_REF], and are merged into a single bit array [START_REF] Brunie | Arithmetic core generation using bit heaps[END_REF]. A possible advantage of using the SOPC generator of [START_REF] De Dinechin | Sum-of-product architectures computing just right[END_REF] is that it determines automatically an optimal internal format to use for all the additions and multiplications from (5.3) such that the target output accuracy of the ỹ[k]'s is guaranteed, thus helping streamline the rest of the design process.

Integrated hardware FIR filter design

Let us denote the overall TD error of an FIR architecture as

ε k = | y[k] -y[k]|.
The accuracy of the architecture will therefore be defined as a bound ε on ε k . However, there is a deep relationship between ε and the output format. On the one hand, it is not possible to output more accuracy than the format can hold. On the other hand, it makes little sense to output less accuracy than the output format allows, especially in a hardware context where we pay for every bit. Therefore, in this work, the accuracy of the architecture is specified by the output format: if the least significant bit (LSB) of the output has weight 2 -p , then the architecture must be such that, for all allowable input signals and for all k, | y

[k] -y[k]| < ε = 2 -p .
Conversely, if an architecture is accurate to ε = 2 -p , then its output format will have a LSB of weight 2 -p .

The design process can thus be carried out in two ways (the input format is always a design parameter the user specifies):

1. A value of N and corresponding quantized coefficients for which the FD specification holds are chosen.

We compute the smallest output format such that the implemented filter is not affected by any rounding errors (this can always be done since all inputs and filter coefficients are finite precision values).

2. The user provides the output format (i.e., gives the target LSB). The tool then computes a small N and a set of quantized coefficients such that the FD specification holds and its output is accurate to the specified limit.

The first one easier to implement, but the second is probably more intuitive in a hardware-centered scenario, when I/O formats are part of the specification. We will thus focus only on this second use case.

Computing the optimal filter out of the I/O format specification

Figure 5.5 gives an idea of our automated design flow. The input and output formats and FD quality bounds are given by the user. It might happen that there is no sound solution with these constraints, in which case the user is alerted. The first step determines an acceptable real-coefficient minimax filter with small N . This is to limit the complexity of the implemented filter. The standard approach to determine N seems to be based on a formula of Kaiser (see for instance [START_REF] Oppenheim | Discrete-Time Signal Processing[END_REF]Ch. 7.7.4]; refinements of this guess are also presented by Shen and Strang [START_REF] Shen | The asymptotics of optimal (equiripple) filters[END_REF]). It usually gives a good starting estimate for N , which can then be incremented or decremented as necessary (see also [START_REF] Antoniou | Digital Signal Processing: Signals, Systems, and Filters[END_REF]).

In the next box (emulate HW), FloPoCo determines the internal format it will use to satisfy the TD constraints inherited from the I/O formats. We chose to also use this format to quantize the coefficients, since in many cases, the format of the filter coefficients does not impact in a significant way the resource consumption of the (KCM-based) constant multipliers, but does affect the FD quality of the filter. As suggested in the next paragraphs, this choice can be reevaluated later on if needed. Based on this coefficient format, the coefficients are quantized, still subject to the FD constraints. In general, this internal format seems to be sufficient in ensuring that the Euclidean lattice-quantized filter we obtain satisfies the FD specification. We have never encountered an example where this is not the case, but if needed, we can do one of the following (or a combination of the two):

h[i] increase N no increase intermediary format no implement h[i] • x[k -i] HW implem.
1. increase the coefficient and internal formats until the FD constraints are satisfied; 2. increment N and restart the design process.

The fact that we are not able to produce realistic design problems where the initial internal format is not sufficient seems to suggest this is not a concerning issue in practice.

Examples and results

As a working example, the default highpass filter specification of the filterbuilder command in MATLAB R2014B illustrates well the scope of our tool (other examples should provide very similar statistics in terms

Conclusion and future work

The main purpose of this chapter was to present a first attempt at a complete and automatic hardware design work flow for fixed-point FIR filters using the ideas and tools developed in the previous two chapters and the FloPoCo generator. A real-size filter implementation of guaranteed quality is obtained within several seconds: apart from requiring minimal user intervention, this tool produces results which are more accurate, almost twice as fast, and comparable in area with what can be generated with similar mainstream tools.

We have obtained this result thanks to a constant concern to minimize the size of computations in the resulting architecture, coupled with strict error evaluation techniques used by FloPoCo. The main issue that this work has raised is the relationship between quality specification in the frequency and time domains. We have, for both, well understood and well implemented error analysis procedures. However, we still do not really transfer the error analysis done in one domain to the other. Improving on this could allow a better balance of error contributions (approximation error in the FD and evaluation/rounding error in the TD) to the overall filter quality, hence even better efficiency. Short-term work also focuses on extending this approach to the hardware synthesis of infinite impulse response filters.

Rational minimax approximation problems

The greater danger for most of us lies not in setting our aim too high and falling short; but in setting our aim too low, and achieving our mark.

Michelangelo

For a long time, the theories of minimax approximation by rational functions and by polynomials evolved along a common axis, due in no small part to similar properties of best approximations in the two settings. In particular, the Remez exchange algorithm for linear minimax approximations (the focal point of Chapter 3 of this text), was extended by Werner [START_REF] Werner | Die konstruktive Ermittlung der Tschebyscheff-Approximierenden im Bereich der rationalen funktionen[END_REF] and Maehly [START_REF] Maehly | Methods for fitting rational approximations, Parts II and III[END_REF] to the rational case at the beginning of the 1960s, the latter referring to it as the first direct method.

Since its introduction, the rational Remez algorithm has played an important part in the design of efficient routines for the evaluation of special functions (see for instance the SPECFUN software package [START_REF] Cody | Algorithm 715: SPECFUN-a portable FORTRAN package of special function routines and test drivers[END_REF] and [START_REF] Gautschi | Computational Methods in Special Functions-A Survey[END_REF]Table 1]). Some computations from lattice field theory [START_REF] Kogut | Rational hybrid Monte Carlo algorithm for theories with unknown spectral bounds[END_REF], [START_REF] Wipf | Statistical Approach to Quantum Field Theory: An Introduction[END_REF]Ch. 15.7] also use it and there have been attempts to adapt the method in signal processing for the design of IIR filters [START_REF] Saramäki | An efficient Remez-type algorithm for the design of optimum IIR filters with arbitrary partially constrained specifications[END_REF][START_REF] Saramäki | Generalizations of classical recursive digital filters and their design with the aid of a Remez-type algorithm[END_REF][START_REF] Selesnick | New exchange rules for IIR filter design[END_REF][START_REF] Selesnick | Magnitude squared design of recursive filters with the Chebyshev norm using a constrained rational Remez algorithm[END_REF]. More recently, it is also used in nuclear physics, for burnup calculations [START_REF] Pusa | Numerical methods for nuclear fuel burnup calculations[END_REF].

It is perhaps appropriate to say that the exchange algorithm for computing best rational approximations is not as robust as its polynomial counterpart, for reasons we will discuss later on in the text. This is true, for instance, in the case of Chebfun's rational remez implementation, which is described by Pachón in his PhD thesis [START_REF] Pachón | Algorithms for Polynomial and Rational Approximation[END_REF]Ch. 6]. Recently, with M. Javed (Chebfun group, Oxford University), we have started investigating if we can introduce any algorithmic and/or implementation improvements to this code, so that it has a more scalable numerical behavior (a multiple precision prototype implementation is also in development). We are still in the early exploratory stages of this work and this chapter is meant to give a brief account of some of the things we have done so far and what challenges and problems are left to conquer. Because of this, it is much shorter and less polished than Ch. 3 or 4.

The setting

Similarly to before, we want to approximate functions

f ∈ C([a, b]). The goal is to find p ∈ R m [x] and q ∈ R n [x] such that f - p q ∞,[a,b] = max x∈[a,b] f (x) - p(x) q(x)
is minimized, with the assumption that q(x) has no zeros in [a, b]. If q has any zeros, they should also be zeros of p, in which case they can be factored out; we call the resulting rational function irreducible (up to constant factors). We then denote by R m,n = p(x) q(x) : deg p m, deg q n, p q is irreducible and q(x) > 0 over [a, b] the feasible set from which a solution to the rational minimax problem is to be searched for; zero has the irreducible form 0/1 and deg 0 = -∞. We also define the defect of p/q ∈ R m,n to be d = min {mdeg p, ndeg q}, giving us a way to measure how both numerator and denominator degree differ from their maximal allowed values. If d > 0 we call the rational approximation degenerate, otherwise it is nondegenerate or normal. As an example, consider 1/(1 + x 2 ) over the interval [-1, 1]. It has defect 0 in R 0,2 or R 1,2 and defect 1 in R 1,3 .

The existence and characterization of best rational approximations can be summarized by the following result, which is very similar to its polynomial equivalent: Theorem 6.1 (Uniqueness and alternation of minimax approximations). If f ∈ C([a, b]), then r = p /q is the unique best uniform approximation of f (up to a constant scaling factor) out of R m,n , if and only if fr equioscillates between at least m + n + 2d extreme points, with d being the defect of r in R m,n .

Proof. See for instance [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 24]. The existence of best rational approximations can be traced to Walsh [START_REF] Walsh | The existence of rational functions of best approximation[END_REF], while the uniqueness and alternation properties are due to Achieser [START_REF] Achieser | On extremal properties of certain rational functions[END_REF][START_REF] Achieser | Theory of Approximation[END_REF]. Theorem 6.1 is supplemented by a result due to de la Vallée Poussin [START_REF] De | Leçons sur l'approximation des fonctions d'une variable réelle[END_REF] which provides a lower bound on the minimax error [3, p. 52-53], analogous to Theorem 3.10:

The rational exchange algorithm

The second Remez algorithm as it applies to the rational approximation problem is very similar to Algorithm 2:

(1) Choose N = m + n + 2 points in [a, b] (call them x (k)

i , i = 0, . . . , N -1) with k set to the value 1.

(2) Determine h k and r k = p k q k ∈ R m,n to satisfy the system of equations If step (2) always succeeds during execution, then convergence to the best approximation is assured (see for instance [START_REF] Watson | Approximation theory and numerical methods[END_REF]Thm. 9.14]). If, in addition, regularity assumptions similar to those of [START_REF] Veidinger | On the numerical determination of the best approximation in the Chebyshev sense[END_REF] hold, then the convergence speed is quadratic [START_REF] Curtis | The construction of minimax rational approximations to functions[END_REF], just like with minimax polynomial approximation.

f (x (k) i ) -r k (x (
Contrary to the polynomial case however, the rational Remez algorithm can fail (both in theory and in practice). As mentioned in [START_REF] Selesnick | Magnitude squared design of recursive filters with the Chebyshev norm using a constrained rational Remez algorithm[END_REF], there are two theoretical reasons for this, but which have the same effect: at some iteration k, the reference x (k) does not allow for a r k ∈ R m,n solution of (6.3). They are:

• The best approximation r is in fact degenerate. Then either the best rational approximation on a reference set during execution is degenerate or the algorithm yields a sequence of approximations that approach degeneracy;

• Sensitivity to the initial reference set, the algorithm failing even though r is nondegenerate. On the other hand, if we start sufficiently close to the target minimax approximation, then the exchange algorithm will converge [36, Ch. V.6.B]. To our knowledge, it seems extremely difficult to determine such a starting approximant in general. When -1 < a < 1, then the corresponding best approximation r is nondegenerate, giving rise to an alternating set of 1 + 1 + 2 = 4 points. On the other hand, when a = -1, the best approximation is degenerate, since r = 1/2 verifies Theorem 6.1. Figure 6.3 shows what happens when a → -1 and we have near degenerate approximations. The coalescing of the two rightmost references hints at computational issues. Indeed, when using our rational Remez code for a = -0.99, it failed to produce a result except for when the initial reference (especially the last two nodes) was very close to the equialternating set. For a = -1, as expected, the algorithm did not even converge.

A possible way of accounting for (near) degeneracy is if we have knowledge of so-called square block structures in the Walsh table of f . Introduced in [START_REF] Walsh | On approximation to an analytic function by rational functions of best approximation[END_REF] by Walsh, it is a bi-dimensional array housing the best degree (m, n) approximations to f , where m indexes the rows and n the columns. If there are identical entries inside this table, it means that f is degenerate for certain degrees (m, n). For instance, in the case of even functions, the Walsh table contains blocks of 2 × 2 identical entries, that is, the minimax approximations of types (m, n), (m + 1, n), (m, n + 1), (m + 1, n + 1) are the same, when m and n are even. A similar property holds for odd functions (see also discussion in [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 24] and the references therein). Chebfun remez has an automated test for detecting degeneracy in even/odd functions. Other nontrivial examples and theoretical properties regarding degeneracy are explored by Ralston [START_REF] Ralston | Some aspects of degeneracy in rational approximations[END_REF].

The remainder of this section discusses how we perform each of the three steps and the issues we encountered in practice.

Initialization

A conclusion to draw from the previous paragraphs is the sensitivity of the rational exchange algorithm to the starting reference. There are several alternatives in the literature on how to perform step [START_REF] Abu-Al-Saud | Efficient wideband channelizer for software radio systems using modulated PR filterbanks[END_REF]. For instance, Curtis and Osborne [START_REF] Curtis | The construction of minimax rational approximations to functions[END_REF] suggest the use of Chebyshev nodes of the second kind scaled to [a, b], while Werner, Stoer and Bommas [START_REF] Werner | Rational Chebyshev approximation[END_REF] propose taking r 1 as the rational interpolant of f at the scaled roots of the Chebyshev polynomial T N . Another approach [START_REF] Hart | Computer Approximations[END_REF] is to first construct the best polynomial approximant of degree m + n (which should pose no problems); next, use the resulting equialternating reference as the initial guess for the degree (m + n -1, 1) problem. The degree of the numerator is successively reduced and the degree of the denominator is successively raised until the target (m, n) approximation is reached.

More recently, Pachón and Trefethen (see [START_REF] Pachón | Algorithms for Polynomial and Rational Approximation[END_REF]Ch. 6] and [START_REF] Pachón | Barycentric-Remez algorithms for best polynomial approximation in the Chebfun system[END_REF]) use Chebyshev-Padé and Carathéodory-Fejér rational approximations, which, when numerically computable, tend to be near minimax. A CF-based approach with a fall back to Chebyshev nodes is the current default in the rational Chebfun remez (CF approximation inside Chebfun is done through the cf command [START_REF] Van Deun | A robust implementation of the Carathéodory-Fejér method for rational approximation[END_REF]), a strategy which, at least for the moment, we also use in our code. Based on our experiments, sensitivity to the initial reference is not only common to near degenerate cases, but also for instance when trying to approximate functions which have complex-valued singularities inside or close to the interior of [a, b] and the reference values tend to cluster near those points at exponential rates (we especially looked at functions that were not everywhere differentiable on [a, b]). Example 6.4. Consider approximating the function f (x) = |x -0.4| sin (|x -0.2|) over [-1, 1] (not differentiable at x = 0.2 and x = 0.4) with rational interpolants of type (n, n) of increasing degree. Starting from degree (4, 4) we had convergence problems when starting with Chebyshev nodes; the same thing happened when we used the Remez algorithm implementation from the Computer Algebra system Maple (the minimax routine). Even using 1000 bits of precision (roughly 19 times more than what double values can store) did not ensure convergence with our multiple precision prototype. Using a CF-based initialization however, coupled with the changes we suggest in Section 6.2.3, we were able to go up to degree (8, 8) approximations using only double precision arithmetic inside Chebfun. For n 9, the numerically computed CF approximation was not usable. When we gave the same CF-based points to the multiple precision code, it also converged without problems.

It seems, however, that numerically, none of these approaches is sufficiently robust (see also experiments in [START_REF] Pachón | Algorithms for Polynomial and Rational Approximation[END_REF]Ch. 6.6]), with the caveat that when the CF and/or Chebyshev-Padé methods work, convergence is usually achieved very quickly, Example 6.4 being evidence of this. When the function starts possessing some regularity and any singularities are close to a or b, we noticed much less sensitivity to the starting reference. The extrema of the degree (8, 8) CF approximation to f were used as starting reference vector.

Determining the current approximant

For a simplified notation, let us drop the iteration index k in eq. ( 6.3) and look at how we can determine the rational interpolant r = p/q and levelled error h corresponding to an iteration of the exchange algorithm; to begin with, we consider both p and q expressed in the same basis {ϕ 0 , ϕ 1 , . . . , ϕ n , . . .} of R[x] as p(x) = m k=0 a k ϕ k (x) and q(x) = 1 + n k=1 b k ϕ k (x), where deg ϕ i = i. Since r ∈ R m,n , we can rewrite the system of equations as p(x i ) + (-1) i hq(x i ) = f (x i )q(x i ), i = 0, . . . , N -1, (

which in matrix notation gives

(D 2 -D 1 h)V 2 -V 1 b a = 0 (6.5) or V 1 a + hD 1 V 2 b = D 2 V 2 b (6.6)
where

a = [a 0 • • • a m ] t , b = [1 b 1 • • • b n ] t , (V 1 a) i = p(x i ), (V 2 b) i = q(x i ),
(D 1 ) i,i = (-1) i , (D 2 ) i,i = f (x i ).

D 1 and D 2 are both diagonal matrices and V 1 is a basis matrix of the form

V 1 =    ϕ 0 (x 0 ) ϕ 1 (x 0 ) • • • ϕ m (x 0 ) . . . . . . ϕ 0 (x N -1 ) ϕ 1 (x N -1 ) • • • ϕ m (x N -1 )   
with a similar structure for V 2 . Since {ϕ 0 , . . . , ϕ m } satisfies the Haar condition (see Definition 3.3), V 1 has full rank m + 1 and there exists a matrix Q ∈ R (n+1)×(m+n+2) also of full rank such that QV 1 = 0. Applied to (6.6), a is eliminated and we have a generalized eigenvalue problem in h and b QD 2 V 2 b = hQD 1 V 2 b. (6.7)

It can be shown that all of the n+1 eigenvalues h which verify (6.7) are real valued (see for instance [START_REF] Powell | Approximation Theory and Methods[END_REF]Ch. 10.2]) and at most one of the corresponding eigenvectors q gives rise to a pole free interpolant over [a, b] (this was first shown by Maehly in [START_REF] Maehly | Methods for fitting rational approximations, Parts II and III[END_REF]Sec. 7]).

Rational interpolation

It seems that in many references on the computational aspects of the rational exchange algorithm, the nonlinear set of equations (6.3) are not solved via the generalized eigenvalue problem explicitly, but by using Newton's method on (6.5) (see for instance [START_REF] Curtis | The construction of minimax rational approximations to functions[END_REF]Sec. 4] and [36, Ch. V.6.B]). The approach taken in Chebfun remez on the other hand, which we also continue to use, solves a form of eq. (6.7) by means of MATLAB's eig command. In order to explain how it works, we need some results introduced in [START_REF] Pachón | Algorithms for Polynomial and Rational Approximation[END_REF]Ch. 4] and [START_REF] Pachón | Fast and stable rational interpolation in roots of unity and Chebyshev points[END_REF] regarding rational interpolation problems, which we now summarize for convenience.

Consider the following instance of rational interpolation (known as the Cauchy interpolation problem): given two numerator and denominator degrees m, n ∈ N and n+m+1 pairwise distinct points x 0 , . . . , x m+n ∈ C and values f 0 , . . . , f m+n ∈ C, determine a rational function r = p/q, where p ∈ C m [x] and q ∈ C n [x] have no common factors other than constants, such that r(x i ) = p(x i ) q(x i ) = f i , i = 0, . . . , m + n. (6.8)

When q(x i ) = 0, i = 0, . . . , m + n, solving (6.8) is equivalent to the linear problem p(x i ) = f i q(x i ), i = 0, . . . , m + n, (6.9)

Working with (6.9) instead of (6.8) is a common strategy for the computation of rational interpolants. In case of the exchange algorithm it is also appropriate to consider (6.9) since the denominator of the trial approximant used at each iteration should not change sign over [a, b].

The approach for solving (6.9) on an arbitrary grid vector x = [x 0 • • • x m+n ] t ∈ C m+n presented by Pachón, Gonnet and van Deun in [START_REF] Pachón | Fast and stable rational interpolation in roots of unity and Chebyshev points[END_REF] consists of representing p and q via a family of polynomials {ϕ i } t , then (6.11) is equivalent to C C = diag(ĉ). In the following, for any k × k matrix A, A i:j with 0 i < j k, will denote the submatrix of size k × (ji + 1) formed with the columns i to j of A. The result used to solve the rational interpolation problem is When trying to approximate functions which have singularities close to or on [a, b], the reference sets x will tend to cluster near those points, many times adversely affecting the numerical quality of the barycentric formula for computing p and q and their ratio. Experimentally, we noticed better numerical behavior when using a rational barycentric representation of r (as mentioned in Section 3.7.1). We are currently working on trying to better understand the stability properties of this approach in the context of the exchange algorithm (a starting point is the error analysis on rational barycentric interpolation from Salazar Celis's PhD thesis [START_REF] Celis | Practical rational interpolation of exact and inexact data: theory and algorithms[END_REF]). To compute the barycentric weights, we retrieve them from the kernel of an appropriate matrix, which can be consulted in [START_REF] Berrut | Matrices for the direct determination of the barycentric weights of rational interpolation[END_REF]. We also use the subdivision strategy introduced in Section 3.8.2 to split [a, b] into subintervals where it is easier to retrieve the extrema of the current error function fr.

As hinted in Example 6.4, these two changes are currently included in the prototype ratRemez function from the feature-rational-remez branch1 of the main Chebfun repository. They are also available in the multiple precision prototype2 .

More examples

If there are no problems with solving the generalized eigenproblem (6.14) in double precision arithmetic (i.e., each iteration of the exchange algorithm generates a pole-free interpolant and the numerical solutions for h and b are accurate), the ratRemez function seems to scale a little bit better with m and n than the main Chebfun remez code. An example is the specification whose minimax error is given in Figure 6.3 which only converged when calling ratRemez, while computing the best R 4,3 minimax approximation for the same function was successful with both codes. In Maple, the minimax routine did not converge for the (4, 3) and (4, 4) problems, even when using 100 digits of accuracy.

Similar things happened when we considered f (x) = |x| over [-1, 1]; we were able to converge up to degree (10, 10) with a minimax error of about 2.69 • 10 -4 , while the unmodified code already failed for degree [START_REF] Ahsan | Two Novel Implementations of the Remez Multiple Exchange Algorithm for Optimum FIR Filter Design[END_REF][START_REF] Ahsan | Two Novel Implementations of the Remez Multiple Exchange Algorithm for Optimum FIR Filter Design[END_REF]. When we tried the R 12,12 problem, the eigensolver was not accurate enough in double precision arithmetic; it failed to produce a correct result even when we initialized the function with the minimax reference, which we were able to retrieve with our multiple precision exchange routine. For Maple, we had issues even for the degree (2, 2) instance.

Theoretically, it was Varga and Carpenter [START_REF] Varga | On the Bernstein conjecture in approximation theory[END_REF] that showed that the minimax error for polynomial approximations of |x| satisfies In the rational case however, we know that the errors of best approximations of type (n, n) to |x| satisfy E n,n (|x| ; [-1, 1]) ∼ 8e -π √ n , a result due to Stahl [197]. This result was in fact conjectured by Varga, Ruttan and Carpenter [START_REF] Varga | Numerical results on best uniform approximation of |x| on [-1, +1][END_REF] not long before, using a multiple precision (200 decimal digits) implementation of the rational Remez algorithm. The computations they performed took advantage of the fact that

E 2n,2n (|x| ; [-1, 1]) = E n,n ( √ x; [0, 1]),
and they actually used the exchange algorithm on the square root function, for n = 1, . . . , 40. We were also successful in reproducing their minimax error computations with our multiple precision exchange prototype (Figure 6.4 shows one of the error curves we obtained). Another well-studied example, which we briefly mentioned in the introduction of the present text, is the exponential function e x over (-∞, 0]. If for the previous example polynomials still had some approximation power, in this case we can do no better than an approximation error of 1/2, due to the constant function p = 1/2.

By considering rational functions however, things are much better. For type (0, n) approximations, Schönhage [START_REF] Schönhage | Zur rationalen Approximierbarkeit von e -x über [0, ∞[END_REF] showed that we have whereas for type (n, n) minimax approximations we know from Aptekarev [START_REF] Aptekarev | Sharp constants for rational approximations of analytic functions[END_REF] that, E n,n (e x ; (-∞, 0]) ∼ 2H n+1/2 , H = 1/9.2890354 . . . with H being known as Halphen's constant. Aptekarev's result follows earlier work of Gonchar and Rakhmanov [START_REF] Gonchar | Equilibrium distributions and degree of rational approximation of analytic functions[END_REF] on the asymptotic behavior of best approximations of the nth root function.

During the 1970s, the rate of convergence for (n, n) best approximations of the exponential function was thought to be O(9 -n ) and was known as the 1/9 conjecture. It was during the first half of the 1980s that H began to surface, through numerical experiments such as those performed by Trefethen and Gutknecht [START_REF] Trefethen | The Carathéodory-Fejér method for real rational approximation[END_REF] using the Carathéodory-Fejér method and by Carpenter, Ruttan and Varga [START_REF] Carpenter | Extended numerical computations on the "1/9" conjecture in rational approximation theory[END_REF], by again using a multiple precision implementation (with 230 decimal digits of precision) of the exchange algorithm for n = 0, . . . , 30.

We also repeated these last experiments with our own prototype code, but we doubled n, going up to n = 60 (total computation time for all degrees was about 8 hours on my Intel i7-3687U CPU Linux machine; the 1984 runtime [START_REF] Carpenter | Extended numerical computations on the "1/9" conjecture in rational approximation theory[END_REF] for the degree n = 30 instance took 15 CPU hours). The resulting minimax errors, outputted with digits of accuracy are listed in Table 6.1. For a better conditioning of the computations (see [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 25]), we actually computed the (n, n) minimax approximation of e 9(1-s)/(1+s) , s ∈ (-1, 1], (6.15) which maps to e x , x ∈ (-∞, 0] if we perform the change of variable x = 9 s -1 s + 1 .

For the exponential function, CF approximation for e 9(1-s)/(1+s) seems to be almost indistinguishable from the minimax solution [START_REF] Trefethen | Talbot quadratures and rational approximations[END_REF], all the while being much faster. The Chebfun double precision cf code can go up to degree (13, 13) on (6.15) without any issues. As a consequence, initializing the Chebfub remez and prototype ratRemez codes with this approximation leads to convergence in one or two iterations.

Conclusion & perspectives for future work

While the results we are able to achieve on the absolute value and exponential functions are impressive, we have nonetheless seen in this chapter that the rational exchange algorithm is much tougher to handle than its (weighted) polynomial cousin, usually breaking down for quite small numerator and denominator degrees. Our goal is to try and change this fact, even if it is only in incremental steps, with small ideas like those we advocated in Section 6.2.3 (i.e., better conditioned representations of r k and an a priori subdivision of the approximation domain to make the search for the next reference more robust).

The difficulties we encountered echo those set forth in [161, Ch. 6.5]:

• A trial reference leads to no pole free solution in (6.3). This problem can theoretically be solved if the initial reference is good enough. When CF does not work, how should we proceed? There are two directions that are possibly worth investigating:

(1) use near-best fixed pole rational interpolants and the roots of Chebyshev rational functions for the starting reference [START_REF] Van Deun | Eigenvalue problems to compute almost optimal points for rational interpolation with prescribed poles[END_REF][START_REF] Van Deun | Computing near-best fixed pole rational interpolants[END_REF][START_REF] Van Deun | Algorithm 882: Near-best fixed pole rational interpolation with applications in spectral methods[END_REF]. In order to use this approach, some knowledge on the position of the poles of f is needed;

(2) is there an algorithmic way to take advantage of Potential Theory results on the equilibrium distribution of the equialternating sets of best rational approximations and can this lead to a robust initialization routine? The reference values will tend to cluster near singularities.

• The ill-conditioned distribution of optimal references. Because of this reference clustering near singularities, evaluation of r will become complicated, since even the weights in a rational barycentric interpolation will begin to vary exponentially at moderately low degrees, usually well before the best approximation has an error anywhere close to machine precision (this was the case with the degree [START_REF] Aptekarev | Sharp constants for rational approximations of analytic functions[END_REF][START_REF] Aptekarev | Sharp constants for rational approximations of analytic functions[END_REF] approximation of |x| in the last example). Can other representations of rational functions be more robust in this case?

• Numerical problems when solving (6.3). A possible explanation for this is, as argued in [START_REF] Pachón | Algorithms for Polynomial and Rational Approximation[END_REF][START_REF] Pachón | Fast and stable rational interpolation in roots of unity and Chebyshev points[END_REF][START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF], the fast decay of the singular values of the right-hand side matrix of (6.13) which introduces artificial factors in r. What should we do in this case? This difficulty also manifests itself through the fact that determining the a and b coefficients of p and q is frequently "ill-posed", in the sense that the computed coefficients may vary quite a lot from the actual ones. In some cases though, the results obtained when evaluating p/q using these perturbed coefficients can be quite accurate due to a so-called phenomenon of error "autocorrelation", which is analyzed for instance by Litvinov [START_REF] Litvinov | Approximate construction of rational approximations and the effect of error autocorrection[END_REF].

It may well be the case that a fully robust implementation of the rational exchange algorithm is out of reach and other approaches are more fruitful. The other family of methods for computing best rational approximations that have proven to be useful in practice are based on linear programming and sprung from ideas set forth by Cheney and Loeb [START_REF] Cheney | Two new algorithms for rational approximation[END_REF]. They are known as differential correction algorithms (details and further references on them can be found for instance in [222, Ch. 9.5], [START_REF] Powell | Approximation Theory and Methods[END_REF]Ch. 10.4] and [36, Ch. 6.6.A]) and have the advantage of guaranteed convergence properties (not conditional as in the case of the rational Remez algorithm). On the other hand, differential correction approaches are slower and seem to be more sensitive to rounding errors than exchange methods [START_REF] Braess | Nonlinear approximation theory[END_REF]Ch. 6.6.B]. Hybrid methods that attempt to combine the benefits of both have also been proposed [START_REF] Belogus | DCR2: An improved algorithm for ∞ rational approximation on intervals[END_REF][START_REF] Kaufman | A combined Remes-differential correction algorithm for rational approximation[END_REF].

Still, the simplicity of the exchange algorithm has made it extremely interesting to study, both from a theoretical and practical point of view. We believe that, at least on the practical side of things, there may still be improvements to be made, [START_REF] Pachón | Algorithms for Polynomial and Rational Approximation[END_REF]Ch. 6] and the current text being evidence for this.

iii 2 . 1 T 4 . 7

 2147 0 to T 3 on [-1, 1]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 Error curve for the minimax approximation of x 2 over [0, 2] using the basis (x, e x ). . . . . . 3.2 Tolerance scheme and ideal frequency response for a lowpass filter. . . . . . . . . . . . . . . 3.3 Design example showcasing a transition band anomaly and how it can be removed. . . . . . 3.4 Degree n = 10 minimax approximation of f (x) = ln(x)e sin(x) in terms of relative error. . . . 3.5 Relative errors (correct significant digits) when computing the starting p for Example 3.20 with both types of barycentric formulas. Uniform initialization (Λ Rn[x],[-1,1] (x) 4.24973 • 10 14 ) is used. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 Relative errors (correct significant digits) when computing the starting p for Example 3.20 using both types of barycentric formulas. Reference scaling (Λ Rn[x],[-1,1] (x) 1.29773 • 10 5 ) is used. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7 Our interval subdivision strategy for computing the extrema of e(x). . . . . . . . . . . . . . 3.8 The value of the approximation error e on a small interval [0.247168, 0.24869] of X, for the minimax result satisfying the specification for Example 3.21. . . . . . . . . . . . . . . . . . 4.1 The Z 2 lattice with unit basis vectors e 1 = [1 0] T and e 2 = [0 1] T and its associated fundamental parallelepiped. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 The Z 2 lattice, now with basis vectors b 1 = [1 1] T and b 2 = [1 2] T and its fundamental parallelepiped. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 A lattice for which the 2 and ∞ SVP solutions (b and c respectively) are different. . . . . 4.4 Successive minima of a two-dimensional lattice (in the 2 norm). . . . . . . . . . . . . . . . 4.5 The relative lengths of successive Gram-Schmidt vectors before (left column) and after (right column) LLL-reduction, for Example 4.2. The top row uses the final reference set of p , the middle row is for the zeros of e and endpoints of X, while the last row corresponds to an n + 2-point AFP set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6 The relative lengths of successive Gram-Schmidt vectors for the design of a degree n = 62 type I filter adhering to specification B from Table 4.2, with 22-bit (21 bits for the fractional part) filter taps. The top row corresponds to the situation before any basis reduction algorithm was applied, whereas the middle row shows the effect of LLL reduction. BKZ (with block size β = 8) and HKZ reductions give the same result (bottom line). An AFP grid containing n + 2 elements was used. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The relative lengths of successive Gram-Schmidt vectors for the design of a degree n = 62 type I filter adhering to specification B from Table

85 5. 1

 851 Simplified depiction of a generic FPGA layout. . . . . . . . . . . . . . . . . . . . . . . . . . 90 5.2 An ideal FIR filter architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 5.3 An actual FIR filter architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 5.4 MATLAB design flow with all the parameters. The dashed ones can be computed by the tool or input by the user. The external minimizecoeffwl function can help compute the coefficient formats, while the quantized coefficients themselves can be computed using one of minimizecoeffwl, constraincoeffwl or maximizestopband. . . . . . . . . . . . . . . . . 91 5.5 Proposed design flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 6.1 Minimax approximation errors for Example 6.3 when a = -0.8 (top left), a = -0.9 (top right), a = -0.99 (bottom left) and a = -1 (bottom right). In all four cases the abscissa is linearly scaled to [-1, 1]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 6.2 Approximation errors after the first iteration of the exchange algorithm has been executed (left) and at the end of execution (right) for the degree (8, 8) best approximation of f (x) = |x -0.4| sin (|x -0.2|) , x ∈ [-1, 1]. The extrema of the degree (8, 8) CF approximation to f were used as starting reference vector. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 6.3 The error function for the best R 4,4 minimax approximation of f (x) = List of Tables 2.1 Parameters of the binary floating-point formats from the 754-2008 standard [107]. . . . . . 3.1 Link between the two representations used interchangeably in the rest of the text. . . . . . 3.2 Default weighting values for linear-phase FIR filters (x = cos(ω)). . . . . . . . . . . . . . . . 3.3 Number of reference values in each band for the bandstop specification of Example 3.19 before the first iteration and at the end of execution. . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Iteration count comparison for uniform/reference scaling/ AFP-based initialization . . . . . 3.5 Statistics for the exchange algorithm execution on Example 3.18. . . . . . . . . . . . . . . . 3.6 Statistics for the exchange algorithm execution on Example 3.19. . . . . . . . . . . . . . . . 3.7 Lebesgue constant evolution during the execution of the exchange algorithm (i.e., first, middle

  2.0 with -O3 -DNDEBUG level optimizations. . . . . . . . . . . . . . . . . . . . . . . . 4.1 Scaled basis functions for finite word length FIR design. . . . . . . . . . . . . . . . . . . . . 4.2 Type I filter specifications considered in [124]. . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Lattice basis reduction algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii viii LIST OF TABLES 4.4 Approximation error comparison for the three different discretization choices. LLL basis reduction is used. We have taken t 1 = 2, t 2 = n for n < 40 and t 1 = 1, t 2 = n/2 for n 40 to limit the vicinity search runtime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 4.5 Approximation error and execution times for LLL, BKZ and HKZ reduction. . . . . . . . . 83 4.6 Comparison with optimal results and the heuristic approach from [124]. . . . . . . . . . . . 84 4.7 Adaptive weighting improvements on the examples in Table 4.6. . . . . . . . . . . . . . . . 85 4.8 High degree type I FIR specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.9 High degree quantization results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 5.1 Virtex6 synthesis results and accuracy measurements for generated FIR filters. . . . . . . . 96 6.1 Rational minimax approximation errors for e x on (-∞, 0] of type (n, n), n = 1, . . . , 60. . . . 108

(

  ii) For n = 53248, determine p ∈ R n [x] expressed in the basis of Chebyshev polynomials of the first kind such that for X = [-1, cos 3 8192 π ] ∪ [cos 1 8192 π , 1], f (x) = 0, x ∈ [-1, cos 3 8192 π ], 1, x ∈ [cos 1 8192 π , 1],and w(x) = [(1 + x)/2] 1/2 , the weighted error max x∈X |w(x)(f (x)p (x))| is minimal.

Definition 2 . 2 .

 22 Given a weight w ∈ C([a, b]) strictly positive almost everywhere over [a, b], for any two functions f, g ∈ L 2 ([a, b], w(x), dx) let their inner product with respect to w be 1 f, g = b a f (x)g(x)w(x)dx.

4 .

 4 The weight functions for Chebyshev polynomials are special cases of the Jacobi weight function w(x) = (1x) α (1 + x) β , with α, β > -1 as parameters. The orthogonal polynomials they generate over [-1, 1] are known as Jacobi polynomials and are denoted with (P (α,β) n ) n 0 . Maybe the most well-known such family is that of the Legendre polynomials which are common in physics and correspond to α = β = 0 and w(x) = 1. Orthogonal polynomials possess L 2 optimality characteristics analogous to the minimax property of Chebyshev polynomials in Lemma 2.1 (see [146, Ch. 4.3]): Lemma 2.5. If (ϕ n ) n 0 is a family of orthogonal polynomials over [a, b], then: 1. the zero function is the best L 2 polynomial approximation of degree n -1 to ϕ n over [a, b]; 2. ϕ n is the best L 2 approximation to zero over [a, b] among polynomials of degree n with the same leading coefficient.

Definition 3 . 3 (

 33 Haar condition). Consider n + 1 functions ϕ 0 , . . . , ϕ n defined over [a, b]. We say that ϕ 0 , . . . , ϕ n satisfy the Haar condition iff a) ϕ 0 , . . . , ϕ n are continuous on [a, b]; b) the following equivalent statements hold: (i) any p = n k=0 α k ϕ k = 0 has at most n distinct zeros; (ii) if p ∈ span R (ϕ i ) 0 i n and p = 0, then if the number of zeros of p inside [a, b] is equal to j and k of these zeros are points inside (a, b) where p does not change sign, then j + k < n + 1;

Example 3 . 5 .

 35 Let w ∈ C([a, b]) be a function which does not have any zeros on [a, b]. Then, by the previous lemma, (w, wx, . . . , wx n ) satisfies the Haar condition. If f has no zeros on [a, b], then the relative error minimax polynomial approximation of f on X ⊆ [a, b] is equivalent to the minimax approximation of g

Example 3 . 7 .Remark 3 . 8 .

 3738 Consider the following:(a) the system (1, cos(x), sin(x), cos(2x), sin(2x), . . . , cos(nx), sin(nx)) of trigonometric polynomials verifies the Haar condition on all intervals [a, b] such that 0 a < b < 2π;(b) the Haar condition is valid for (sin(x), sin(2x), . . . , sin(nx)) over (0, π);(c) (1, cos(x), cos(2x), . . . , cos(nx)) satisfies the Haar condition on [0, π]. The system of Example 3.7 (c) is generally the one which is used for minimax FIR filter design, and as such it will be central to us in the sequel. By the change of variable y = cos(x), it is equivalent to taking the space generated by the Chebyshev polynomials of the first kind up to degree n, (T i (y)) 0 i n , on[-1, 1]. Other examples can also be found in[START_REF] Devore | Constructive Approximation[END_REF] Ch. 3.3] and[START_REF] Borwein | Polynomials and polynomial inequalities[END_REF] Ch. 3].

  which, based on the previous lemma, tells us that p k+1p k has at least n + 1 zeros in [a, b], provided that each double zero is counted twice. Since S n satisfies the Haar condition and property (ii) of Definition 3.3 holds for p k+1p k , this leads to p k = p k+1 . In particular, e k+1 (x k+1 i ) = e k (x k+1 i

Figure 3 . 1 :

 31 Figure 3.1: Error curve for the minimax approximation of x 2 over [0, 2] using the basis (x, e x ).

Figure 3 . 2 :

 32 Figure 3.2: Tolerance scheme and ideal frequency response for a lowpass filter.

Figure 3 . 3 :

 33 Figure 3.3: Design example showcasing a transition band anomaly and how it can be removed.

Figure 3 .

 3 Figure 3.3 shows an example of a three band, degree n = 38, type I minimax FIR filter with passband [0, 0.3π], stopband [0.33π, 0.5π], passband [0.6π, π] and corresponding weights 1, 10 and 2. A huge unwanted spike is clearly visible in the transition region between the stopband and the second passband. Such a scenario is possible because, in the case of multi-band filters, the minimax problem results in a so-called underdetermined approximation polynomial H(ω) over Ω, meaning that some of the local extrema of H(ω) over [0, π] can occur inside transition regions (see the discussion from[START_REF] Shpak | A generalized Remez method for the design of FIR digital filters[END_REF]).Such issues have been approached in different ways over the years. The most satisfactory solution seems to be the one advocated by Shpak and Antoniou[START_REF] Shpak | A generalized Remez method for the design of FIR digital filters[END_REF]. They propose extensions of Algorithm 2 for the design of maximal-ripple (MR) and extra-ripple (ER) filters. MR filters are those filters that have the maximum possible number of ripples in the magnitude response, while ER filters are those that have fewer ripples than the maximum, but more than the minimum n + 2 required by the equioscillation theorem. We will not go into details since such approaches are very similar to the classic multi-point exchange algorithm.The methods of Shpak and Antoniou completely eliminate or significantly reduce the underdetermined nature of H(ω) that affects multi-band designs obtained using the exchange algorithm, thus ensuring monotonicity of H inside transition regions. This desirable behavior on the transition bands comes at the cost of not having explicit control on the value of the approximation error inside the pass and stop bands.If we only need to contain the frequency response, we can adapt the initial specification using mild constraints on the problematic transition region[START_REF] Ahsan | Two Novel Implementations of the Remez Multiple Exchange Algorithm for Optimum FIR Filter Design[END_REF] Sec. 3]. For instance, by adding [0.51π, 0.59π] to Ω and extending D and W to take the values 0.5 and 0.25 on [0.51π, 0.59π], we obtain the second minimax filter from Figure3.3, where the transition region response is now between 0 and 1. There is only a minor loss in quality with respect to the initial design (the minimax error δ Ω grows from 0.1172 to 0.1205). Another more involved approach of a similar nature (i.e., forcing a design problem on [0, π] instead of Ω) is described in[START_REF] Cortelazzo | An alternate technique for min-max design of multiband finite impulse response digital filters[END_REF]. Grenez[START_REF] Grenez | Design of linear or minimum-phase FIR filters by constrained Chebyshev approximation[END_REF] describes a version of the exchange algorithm which can also take into account lower and upper bound functions on the approximant to be computed. This constraint barrier method can limit the size of any ripples that might appear in the frequency response, which means it can be used to eliminate transition band anomalies by forcing suitable bounds. The downside is that in this setting as well, the resulting filter is under-determined. A similar approach is given in[START_REF] Mccallig | Constrained ripple design of FIR digital filters[END_REF].Despite the focus on filter design problems, the routines we provide are more general. They can be used for arbitrary weighted minimax polynomial approximation problems involving multi-interval domains. Such a scenario arises, for instance, when minimizing the relative error of approximation for a function with

Figure 3 . 4 :

 34 Figure 3.4: Degree n = 10 minimax approximation of f (x) = ln(x)e sin(x) in terms of relative error.

Figure 3 .

 3 Figure 3.4 shows the minimax error (f (x)p(x))/ |f (x)| obtained by running our implementation of the exchange algorithm on this new two interval domain, together with the n + 2 = 12 equioscillation points around the extremal values ±6.32824 • 10 -13 .

Example 3 .

 3 18. A unit weight type I lowpass filter with [0, 0.4π] passband and [0.5π, π] stopband. Multiple degrees n are considered. Example 3.19. A type I, uniformly weighted, bandstop filter with passbands [0, 0.2π], [0.6π, π] and stopband [0.3π, 0.5π]. Several degrees n are used.

d

  and C(Y n ) grow at most polynomially with n. If C(Y n ) is bounded, then we speak of an admissible mesh (AM).

. 15 )Formula ( 3 . 14 )

 15314 is obtained from(3.13) since by looking at the representation of the constant function f (

Figure 3 . 5 :Figure 3 . 6 :

 3536 Figure 3.5: Relative errors (correct significant digits) when computing the starting p for Example 3.20 with both types of barycentric formulas. Uniform initialization (Λ Rn[x],[-1,1] (x) 4.24973 • 10 14 ) is used.

  , where: b k-1 = 2ka k + b k+1 , k = 1, . . . , m, and b m = b m+1 = 0. Similarly, if we take into account that dT m dx = mU m-1 , for m 1, we have

Figure 3 . 7 :

 37 Figure 3.7: Our interval subdivision strategy for computing the extrema of e(x).

13 remove x0 and xm-1 from x 14 else 15 for 16 m ← m - 2 17 x ← x 18 return x

 131415162 e i ← max (|e(x i )| , |e(x i+1 )|) , for i = 0, . . . , m -2. // remove a pair of values where the max of the absolute errors is smallest 12 if max (|e(x 0 )| , |e(x m-1 )|) < min(e) then an element e i = min(e), remove xi and xi+1 from x For our implementation, we have decided to use another multi-point strategy, inspired by [6, Sec. 4.1] and detailed in Algorithm 7. It is the most robust one we tested. It usually exhibits the same quadratic convergence behavior typical to the multi-point second Remez algorithm over an interval.

Figure 3 . 8 :

 38 Figure 3.8: The value of the approximation error e on a small interval [0.247168, 0.24869] of X, for the minimax result satisfying the specification for Example 3.21.

(4. 6 )

 6 which would still require testing 1.90512 • 10 16 combinations to retrieve a best set of coeffcient values.For reference, an optimal quantization in this case has coefficientsa 0 = 58, a 1 =40, a 2 = 7, a 3 = -12, a 4 = -6, a 5 = 5, a 6 = 5, a 7 = -2, a 8 = -4, a 9 = 0, a 10 = 3, a 11 = 1, a 12 = -2, a 13 = -1, a 14 = 1, a 15 = 1, a 16 = 0, a 17 = -1, a 18 = 0, a 19 = 1, a 20 = 0, a 21 = 0, a 22 = 0.

( 4 . 8 )

 48 2 https://www.gnu.org/software/glpk/ 3 https://gmplib.org/

Definition 4 . 4 (

 44 Lattice basis). If L = L(b 1 , . . . , b d ) is a R n lattice, then {b 1 , . . . , b d } is called a generating set of L. If all the b i 's are linearly independent, then they are called a basis of L, with d n being the dimension (or rank ) of L. If d = n, L is called full-rank.

Figure 4 . 1 ,

 41 shows this for Z 2 .

Figure 4 .

 4 2 also considers Z 2 , but uses a different basis.

e 1 e 2 0Figure 4 . 1 :

 241 Figure 4.1: The Z 2 lattice with unit basis vectors e1 = [1 0] T and e2 = [0 1] T and its associated fundamental parallelepiped.

b 1 b 2 0Figure 4 . 2 :

 242 Figure 4.2: The Z 2 lattice, now with basis vectors b1 = [1 1] T and b2 = [1 2] T and its fundamental parallelepiped.

Definition 4 . 7 (Figure 4 . 3 :Figure 4 . 4 :

 474344 Figure 4.3: A lattice for which the 2 and ∞ SVP solutions (b and c respectively) are different.

Definition 4 . 8 (

 48 Shortest Vector Problem (SVP)). Given a basis B of a rank d lattice L ⊂ R n , find a nonzero vector u ∈ L such that u = min v∈L\{0} v .

Theorem 4 . 10 (

 410 Minkowski). Let L ⊂ R n be a n-dimensional lattice and B = {x ∈ R n : x 1} the unit ball with respect to the norm • ; then there is a vector v ∈ L \ {0} such that v

Definition 4 . 12 (

 412 Gram-Schmidt orthogonalization). Let b 1 , . . . , b d be linearly independent vectors in R n ; their Gram-Schmidt orthogonalization (GSO) is the orthogonal family b 1 , . . . , b d defined as follows: b 1 = b 1 and more generally b i is the orthogonal projection of b i on the space orthogonal to the linear span of b 1 , . . . , b i-1 . Iteratively, we have

d

  i=1 α i b i being constructed incrementally as follows. First t is projected onto b d , giving the coefficient α d = t, b d / b d , b d . The target vector t gets updated to tα d b d and the process is repeated d -1 more times for each of the Gram-Schmidt vectors b d-1 , . . . , b 1 .

. 14 )

 14 Lemma 4.20. If G = [g ij ] = B T B, 0 i, j n, is the Gram matrix of the lattice basis B whose columns are the vectors of (4.14), then we haveg 00 = 1 4

Lemma 4 . 21 . 2 j=1b

 4212 The Gram-Schmidt orthogonalization b 0 , b 1 , . . . , b n of the basis vectors from (4.14) satisfies b k = b k -2 n + k -1 k k-2j , k = 1, . . . , n, By the GSO definition, b 0 = b 0 . Let us look at what happens for b 1 , b 2 , b 3 . We have b 1 = b 1 because b 1 ⊥b 0 , and thus b 1 2 2

Figure 4 . 5 :

 45 Figure 4.5: The relative lengths of successive Gram-Schmidt vectors before (left column) and after (right column) LLL-reduction, for Example 4.2. The top row uses the final reference set of p , the middle row is for the zeros of e and endpoints of X, while the last row corresponds to an n + 2-point AFP set.

and b n 2 2

 2

Figure 4 . 6 :

 46 Figure 4.6: The relative lengths of successive Gram-Schmidt vectors for the design of a degree n = 62 type I filter adhering to specification B from Table4.2, with 22-bit (21 bits for the fractional part) filter taps. The top row corresponds to the situation before any basis reduction algorithm was applied, whereas the middle row shows the effect of LLL reduction. BKZ (with block size β = 8) and HKZ reductions give the same result (bottom line). An AFP grid containing n + 2 elements was used.

Figure 4 .

 4 Figure 4.5 shows this for Example 4.2. For all three discretization choices we advocated, the initial GSO vectors b 0 , . . . , b 22 do not vary in length very much, meaning we are starting with a well-behaved basis. For

Figure 4 . 7 :

 47 Figure 4.7: The relative lengths of successive Gram-Schmidt vectors for the design of a degree n = 62 type I filter adhering to specification B from Table4.2, with 22-bit (21 bits for the fractional part) filter taps. The top row corresponds to the situation before any basis reduction algorithm was applied, whereas the bottom row shows the effect of LLL reduction. BKZ (with block size β = 8) and HKZ reductions give very similar results, which is why they are not shown. A grid of n + 2 equispaced points inside the convex hull of X was used.

  Problem 4.1, this translates to s = 2 b-1 and [m -, m + ] = [-2 b-1 , 2 b-1 ].

Figure 4 . 8 :

 48 Figure 4.8: Stopband attenuation for the minimax design of a given lowpass specification, alongside the 16-bit fixed-point designs of the error shaped approach and our LLL-based algorithm.

Figure 5 . 1 :

 51 Figure 5.1: Simplified depiction of a generic FPGA layout.

Figure 5 . 3 :

 53 Figure 5.3: An actual FIR filter architecture.

Figure 5 . 4 :

 54 Figure 5.4: MATLAB design flow with all the parameters. The dashed ones can be computed by the tool or input by the user. The external minimizecoeffwl function can help compute the coefficient formats, while the quantized coefficients themselves can be computed using one of minimizecoeffwl, constraincoeffwl or maximizestopband.

Figure 5 . 5 :

 55 Figure 5.5: Proposed design flow

Theorem 6 . 2 (

 62 de la Vallée Poussin). Let r = p/q ∈ R m,n with defect d andN = m + n + 2d. If at the points x 0 < x 1 < . . . < x N -1 in [a, b] we have f (x i )r(x i ) = (-1) i λ i , λ i = 0, i = 0, . . . , N -1and all λ i have the same sign, then, for all s ∈ R m,nmin i |f (x i )r(x i )| max i |f (x i )s(x i )| ,(6.1)and consequently mini |f (x i )r(x i )| fr ∞,[a,b] fr ∞,[a,b] . (6.2)

)

  k) i ) = (-1) i h k , i = 0, . . . , N -|h k | , i = 0, . . . , N -1, at least one point where fr k ∞,[a,b]is attained is included, and the sign of fr k alternates at these points. If the current approximation has converged to within a given threshold ε t > 0 (i.e.,f -r k ∞,[a,b] -h k f -r k ∞,[a,b]ε t ) return r k , else go to step (2) with k = k + 1.

Example 6 . 3 .

 63 Inspired by[START_REF] Watson | Approximation theory and numerical methods[END_REF] Ch. 9.3], let us considerf (x) = x 2 , [a, b] = [a, 1], m = n = 1.

Figure 6 . 1 :

 61 Figure 6.1: Minimax approximation errors for Example 6.3 when a = -0.8 (top left), a = -0.9 (top right), a = -0.99 (bottom left) and a = -1 (bottom right). In all four cases the abscissa is linearly scaled to [-1, 1].

Figure 6 . 2 :

 62 Figure 6.2: Approximation errors after the first iteration of the exchange algorithm has been executed (left) and at the end of execution (right) for the degree (8, 8) best approximation of f(x) = |x -0.4| sin (|x -0.2|) , x ∈ [-1, 1].The extrema of the degree[START_REF] Aksoy | Exact and approximate algorithms for the filter design optimization problem[END_REF][START_REF] Aksoy | Exact and approximate algorithms for the filter design optimization problem[END_REF] CF approximation to f were used as starting reference vector.

  deg ϕ i = i and the ϕ i are orthogonal with respect to the inner productf, g x := m+n k=0 f (x k )g(x k ),(6.10)meaningϕ i , ϕ j x = c i > 0 if i = j, 0 if i = j. (6.11) If we take the basis matrix C = [ϕ 0 (x)| • • • |ϕ m+n (x)] ∈ C (m+n+1)×(m+n+1) and ĉ = [c 0 • • • c m+n ]

Theorem 6 . 5 .Figure 6 . 3 :

 6563 Figure 6.3: The error function for the best R4,4 minimax approximation of f (x) =

E

  n (|x| ; [-1, 1]) ∼ β n , β = 0.2801 . . . , leading to a very modest O(n -1 ) rate of convergence, if we are to follow what we said in Section 3.6.1.

Figure 6 . 4 :

 64 Figure 6.4: The error function for the best R40,40 minimax approximation of f (x) = √ x over [0, 1].

  Digital filter design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Computer arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Minimax exchange algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 The second Remez algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2 The first Remez algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Our setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 The role of multi-interval domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.2 Four key examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Practical problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 Robustness issues: initialization is a key step . . . . . . . . . . . . . . . . . . . . . . 3.5.2 Scalability issues: speeding up the extrema search . . . . . . . . . . . . . . . . . . . 3.6 Initialization: two new heuristic approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1 Lagrange interpolation problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.2 Polynomial meshes and an AFP-based approach . . . . . . . . . . . . . . . . . . . . 3.6.3 A reference scaling idea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents 1 Introduction 1.1 Minimax approximation -outline of the thesis . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Technical prerequisites 2.1 Chebyshev technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Basic facts about Chebyshev polynomials . . . . . . . . . . . . . . . . . . . . . . . . 2.1.2 Chebyshev series and Chebyshev interpolants . . . . . . . . . . . . . . . . . . . . . . 2.2 2.2.1 Frequency domain representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.2 Discrete-time systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.3 Minimax FIR filter design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 2.3.1 Floating-point arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.2 Fixed-point arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Efficient tools for weighted minimax approximation 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Properties of best approximations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Unique best approximations: the Haar condition . . . . . . . . . . . . . . . . . . . . 3.2.2 When uniqueness is no longer guaranteed . . . . . . . . . . . . . . . . . . . . . . . . 3.3 3.6.4 Numerical examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7 Computing the current approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

  a, b] (i.e., if f ∈ L 2 ([a, b], w(x), dx), then

	x	LIST OF TABLES
		Acronyms 1
		Introduction
		All exact science is dominated by the idea of approximation.
		Bertrand Russel
	FIR	finite impulse response
	IIR	infinite impulse response
	FPGA	Field Programmable Gate Array
	DCT	Discrete Cosine Transform
	FFT	Fast Fourier Transform
	DTFT	Discrete-Time Fourier Transform
	IDTFT	Inverse Discrete-Time Fourier Transform
	LTI	linear-time invariant
	CCDE	constant-coefficient difference equation
	CSD	canonic signed digit
	MR	maximal-ripple
	ER	extra-ripple
	AFP	approximate Fekete point
	DLP	discrete Leja point
	AM	admissible mesh
	WAM	weakly admissible mesh
	CPR	Chebyshev-proxy root-finder
	DSP	digital signal processing
	MILP	miced integer linear programming
	CVP	closest vector problem
	SVP	shortest vector problem
	GSO	Gram-Schmidt orthogonalization
	LLL	Lenstra-Lenstra-Lovász
	HKZ	Hermite-Korkine-Zolotarev
	BKZ	block Korkine-Zolotarev
	LUT	look-up table
	CLB	configurable logic block
	IP	intellectual property
	FD	frequency domain
	TD	time domain
	HW	hardware
	SOPC	sum of products with constants
	ASIC	application-specific integrated circuit
		ix xi

b a |f (x)| 2 w(x)dx < ∞).

Table 2 . 1 :

 21 Parameters of the binary floating-point formats from the 754-2008 standard[START_REF]IEEE 754-2008, Standard for Floating-Point Arithmetic[END_REF].

	Name binary16	binary32 (single precision)	binary64 (double precision)	binary128 (quad precision)
	p	11	24			53	113
	e max	+15	+127			+1023	+16383
	e min	-14	-126			-1022	-16382
	• m = |M | • β 1-p is called the normal significand (or mantissa). M is an integer, called the integral significand, represented in radix β, |M | β p -1. This means that m has one digit before the radix point and at most p -1 digits after it; and
	• e is called the exponent, an integer such that e min e min < 0 < e max are given.	e	e max , where the bounding exponents

Table 3 . 1 :

 31 Link between the two representations used interchangeably in the rest of the text.

  P3 any sequence of supersets of a WAM whose cardinalities grow polynomially with n is a WAM with the same constant C(Y n );P4 a finite union of WAMs is a WAM for the corresponding union of compacts, C(Y n ) being the maximum of the corresponding constants;P5 any X satisfying a Markov polynomial inequality like ∇p ∞,X M n r p ∞,X has an AM with O(n rd ) points; P6 the least squares solution p n of Problem 3.27 for

invariant under affine mapping; P2 any sequence of unisolvent interpolation sets whose Lebesgue constant grows at most polynomially with n is a WAM, with C(Y n ) taking the value of the Lebesgue constant itself;

Table 3 .

 3 2: Default weighting values for linear-phase FIR filters (x = cos(ω)).

Table 3 .

 3 3: Number of reference values in each band for the bandstop specification of Example 3.19 before the first iteration and at the end of execution.

		n = 50 n = 100 n = 200
	[0, 0.2π]	14/13	26/26	51/51
	[0.3π, 0.5π] 14/15	26/31	51/59
	[0.6π, π]	24/24	50/45	100/92

Table 3 .

 3 4: Iteration count comparison for uniform/reference scaling/ AFP-based initialization

	Example 3.18	Example 3.19	Example 3.20	Example 3.21
	Degree Iterations Degree	Iterations	Degree Iterations	Degree	Iterations
	n = 50	11/4/6	n = 50	14/14/4
	n = 80	8/3/4	n = 80	13/3/12	n = 520	12 * /3/1	n = 53248 NC/3/NC
	n = 100	9/8/3	n = 100 23 * /18/16
	the larger designs of Examples 3.20 and 3.21. For

Table 3 . 5 :

 35 Statistics for the exchange algorithm execution on Example 3.18.

Table 3 . 6

 36

: Statistics for the exchange algorithm execution on Example 3.19.

Table 3 .

 3 7: Lebesgue constant evolution during the execution of the exchange algorithm (i.e., first, middle and last iteration). The starting reference set is computed using uniform intialization.

	Example 3.18	Example 3.19	Example 3.20
	n = 100	n

Table 3 .

 3 8: Lebesgue constant evolution when the reference scaling approach described in Section 3.6 is used.

	5 9	10 10 8.31678 • 10 6 4.00568 • 10 6	1 12 23	3.00467 • 10 15 7.45988 • 10 7 1.35889 • 10 7	1 6 12	4.24973 • 10 14 6.11242 • 10 5 1.38665 • 10 5
		Example 3.18		Example 3.19		Example 3.20
		n = 100		n = 100		n = 520
	Iteration Λ Rn[x],[-1,1] (x) Iteration Λ Rn[x],[-1,1] (x) Iteration Λ Rn[x],[-1,1] (x)
	1 4 8	5.98098 • 10 6 4.68392 • 10 6 4.00763 • 10 6	1 9 18	4.12072 • 10 8 1.04020 • 10 7 1.35728 • 10 7	1 2 3	1.29773 • 10 5 1.38250 • 10 5 1.38015 • 10 5

Table 3 .

 3 9: Lebesgue constant evolution when the AFP-based approach described in Section 3.6 is used.

	Example 3.18	Example 3.19	Example 3.20
	n = 100	n

2

  Inside x, for each maximal subset of consecutive elements where the error has the same sign, keep only one with largest absolute error.

	6	remove x0 from	x
	7	else
	8	remove xm-1 from	x

3 m ← size(x) // if no numerical problems occur, it should be that m n + 2 // if the extra number of values in x is odd, remove the first or last element 4 if mn -2 ≡ 1 (mod 2) then // take the one with largest absolute error among them 5 if |e(x 0 )| < |e(x m-1 )| then 9 m ← m -1 // if the number of extra elements is even, iteratively remove pairs of successive // values, so that the alternation property still holds 10 while m > n + 2 do 11 construct e ∈ R m-1 s.t.

Table 3 .

 3 10: Relative error of h k with respect to δX for Example 3.18, n = 100.

	Iteration k	δ X -h k δ X
	1	0.999999
	2	0.999969
	3	0.999376
	4	0.990968
	5	0.908509
	6	0.595295
	7	0.127555
	8 9 10 11	7.53014 • 10 -3 5.20205 • 10 -5 1.85449 • 10 -9 3.26333 • 10 -18

Table 3 .

 3 11: Relative error of h k with respect to δX for Example 3.19, n = 100.

	Iteration k	δ X -h k δ X
	1	1
	3	1.00045
	5	1.0609
	7	1.56985
	9	1.74337
	10 11 12 13 14 15	1.35944 • 10 -1 3.75978 • 10 -2 2.34496 • 10 -3 7.34568 • 10 -6 7.8493 • 10 -11 5.45774 • 10 -20

Upon convergence, we compute the coefficients (α i ) 0 k n of the final approximant p k obtained from Step 4 in Algorithm 2. As we saw in Section 2.1.2, we can do this in a numerically stable way with a quadratic number of computations by using formula

(3.19

) and Clenshaw's algorithm or in O(n log n) operations with a DCT-based interpolation scheme. Just like in Section 3.8.2, the total cost is dictated by how we evaluate the barycentric form of p k (x) at the n-th order Chebyshev nodes: O(n 2 ) operations, since we use formula (3.18) at each node. If we instead used again the multipole evaluation scheme of

[START_REF] Dutt | Fast algorithms for polynomial interpolation, integration, and differentiation[END_REF]

, we would require O(n log(n/ε)) operations (fast polynomial evaluation + DCT-based Chebyshev interpolation).

Table 3 .

 3 [START_REF] Aptekarev | Sharp constants for rational approximations of analytic functions[END_REF]: Runtime (real time) comparisons of our IEEE-754 double-precision implementation of the second Remez algorithm with those available in GNURadio 3.7.8.1 (also written in C++), MATLAB R2014b, the one from SciPy 0.16.1 (python code) and two other MATLAB implementations. The same machine, a quad core 3.6 GHz 64-bit Intel Xeon(R) E5-1620 running Linux 4.1.12 (15.9), was used for all the tests. The average execution times (in seconds) of running each piece of code 50 times, are given. When a routine did not converge to the minimax result, NC was used in place of the execution time. The a/b entries in the last column correspond to the two implementations described in[START_REF] Ahsan | Two Novel Implementations of the Remez Multiple Exchange Algorithm for Optimum FIR Filter Design[END_REF].

	Example (degree)	Uniform	GNURadio MATLAB SciPy	[6]
		(sequential)
	3.18 (n = 50)	0.0034	0.0029	0.0532	0.0711 0.0384/0.0098
	3.18 (n = 80)	0.0045	0.0068	0.1174	0.2587 0.0416/0.0316
	3.18 (n = 100)	0.0073	NC	0.1491	0.3511 0.0451/0.0396
	3.19 (n = 50)	0.0022	0.0023	0.0681	0.0971 0.0395/0.0174
	3.19 (n = 80)	0.0069	NC	0.2002	0.3492 0.0761/0.0293
	3.19 (n = 100)	0.0301	NC	NC	NC	0.2599/0.0521
	3.20 (n = 520)	0.2375	NC	NC	NC	1.1691/2.7011
	3.21 (n = 53248)	NC	NC	NC	NC	NC/NC

Table 4 .

 4 1: Scaled basis functions for finite word length FIR design.

	FIR Type				ϕ 0 (x), ϕ 1 (x), ϕ 2 (x), . . . , ϕ n (x)
	I	W (ω) s	,	2W (ω) cos(ω) s	,	2W (ω) cos(2ω) s	, . . . ,	2W (ω) cos(nω) s
	II	2W (ω) cos ω 2 s	,		2W (ω) cos 3ω 2 s		,	2W (ω) cos 5ω 2 s	, . . . ,	2W (ω) cos (2n+1)ω 2 s
	III	2W (ω) sin(ω) s	,	2W (ω) sin(2ω) s	,	2W (ω) sin(3ω) s	, . . . ,	2W (ω) sin((n + 1)ω) s
	IV	2W (ω) sin ω 2 s	,	2W (ω) sin 3ω 2 s		,	2W (ω) sin 5ω 2 s	, . . . ,	2W (ω) sin (2n+1)ω 2 s

Table 4 . 2

 42

: Type I filter specifications considered in

Table 4 .

 4 4: Approximation error comparison for the three different discretization choices. LLL basis reduction is used. We have taken t1 = 2, t2 = n for n < 40 and t1 = 1, t2 = n/2 for n 40 to limit the vicinity search runtime.

	Filter	Extrema error	Zeros + band edges error	AFP error	LLL runtime	Vicinity search runtime	Total runtime
	A35/8	0.032645	0.030013	0.040432	0.00065	1.03	3.4
	A45/8	0.031887	0.030556	0.030864	0.00094	2.22	7.1
	A125/21 B35/9	1.25956 • 10 -5 0.095081	1.25384 • 10 -5 0.091226	1.28772 • 10 -5 0.095081	0.02229 0.00061	17.01 1.03	53 3.5
	B45/9	0.064344	0.073617	0.061486	0.00121	2.25	7.4
	B125/22 C35/8	3.33786 • 10 -5 0.021751	3.45306 • 10 -5 0.019169	3.24349 • 10 -5 0.02235 0.017871 0.00064	17.1 0.79	53.8 3
	C45/8	0.023437	0.020912	0.016096	0.00176	1.7	5.8
	C125/21 1.62125 • 10 -6 D35/9 0.040518	1.93359 • 10 -6 0.038283	2.21053 • 10 -6 0.032914	0.07971 0.00092	12.9 0.78	41.4 2.8
	D45/9	0.027056	0.040024	0.027148	0.00167	1.7	5.7
	D125/22 E35/8	2.10324 • 10 -6 0.039796	2.00989 • 10 -6 0.034046	2.25242 • 10 -6 0.040618	0.07715 0.00044	12.8 0.98	41.5 3.3
	E45/8	0.032895	0.029713	0.037960	0.00083	2.1	6.9
	E125/21	1.2857 • 10 -5	1.28243 • 10 -5	1.24587 • 10 -5 0.01719	16.5	51.8

Table 4 .

 4 5: Approximation error and execution times for LLL, BKZ and HKZ reduction.

	Filter	LLL error	BKZ error	HKZ error	LLL runtime	BKZ runtime	HKZ runtime
	A35/8	0.030013	0.030013	0.030013	0.00065 0.00081 0.00089
	A45/8	0.030556	0.030556	0.030556	0.00094 0.00156 0.00166
	A125/21 B35/9	1.25384 • 10 -5 0.091226	1.25168 • 10 -5 0.095081	1.22264 • 10 -5 0.02229 0.03418 0.07814 0.095081 0.00061 0.00108 0.00105
	B45/9	0.061486	0.0639243	0.065839	0.00121 0.00171 0.00211
	B125/22 3.24349 • 10 -5 C35/8 0.017871	3.3449 • 10 -5 0.019169	3.3449 • 10 -5 0.019169	0.02235 0.03242 0.21234 0.00064 0.00123 0.00116
	C45/8	0.016096	0.016096	0.021371	0.00176 0.00331 0.00318
	C125/21 D35/9	1.62125 • 10 -6 0.032914	1.57285 • 10 -6 0.0358513	118 0.00092 0.00186 0.00124 1.56468 • 10 -6 0.07971 0.15751 0.0358513
	D45/9	0.27056	0.0280512	0.027056	0.00167 0.00321 0.00331
	D125/22 E35/8	2.00989 • 10 -6 0.034046	1.77774 • 10 -6 0.034046	1.94256 • 10 -6 0.034046	0.07715 0.18441 0.00044 0.00068 0.00078 115
	E45/8	0.029713	0.0301061	0.032895	0.00083 0.00128 0.00187
	E125/21	1.24587 • 10 -5	1.24587 • 10 -5	1.21758 • 10 -5 0.01719 0.04123	0.867
	Table

Table 4 .

 4 6: Comparison with optimal results and the heuristic approach from[START_REF] Kodek | Telescoping rounding for suboptimal finite wordlength FIR digital filter design[END_REF].

	Filter	Minimax δ X	Optimal δ opt	Naive rounding δ naive	Telescoping δ tel	Lattice reduction δ lattice
	A35/8	0.01595	0.02983	0.03266	0 .03266	0.030013	LLL
	A45/8 A125/21 † 8.054 • 10 -6 1 .077 • 10 -5 0.02962 7.132 • 10 -3 B35/9 0.05275 0.07709	0.03701 1.620 • 10 -5 0.15879	0 .03186 1 .179 • 10 -5 0 .07854	0.030556 1.222 • 10 -5 0.09122	LLL HKZ LLL
	B45/9	0.02111	0.05679	0.11719	0 .06641	0.06148	LLL
	B125/22 † 2.498 • 10 -5 2 .959 • 10 -5 C35/8 0.01787 2.631 • 10 -3 C45/8 0.01609 6.709 • 10 -4 C125/21 ‡ 1.278 • 10 -8 1.564 • 10 -6 D35/9 0.01043 0.03252	6.198 • 10 -5 0.04687 0.03046 8.203 • 10 -6 0.12189	3 .293 • 10 -5 0 .01787 0 .02103 2 .1 • 10 -6 0 .03368	3.243 • 10 -5 LLL 0.01787 LLL 0.01609 LLL 1.564 • 10 -6 HKZ 0.0329 LLL
	D45/9 D125/22 ‡ 4.142 • 10 -8 2.239 • 10 -3 E35/8 0.01761	0.02612 1.777 • 10 -6 0.03299	0.10898 3.425 • 10 -5 0.04692	0 .02859 2 .16 • 10 -6 0 .03404	0.02705 1.777 • 10 -6 BKZ LLL 0.03404 LLL
	E45/8 E125/21 † 7.884 • 10 -6 1 .034 • 10 -5 0.02887 6.543 • 10 -3	0.03571 1.479 • 10 -5	0 .03403 1 .127 • 10 -5	0.02971 1.217 • 10 -5	LLL HKZ
	Inside Table

  1, 1.2, 1.3, 1.4, 1.5}.

		-80			Parks-McClellan design
		-90		LLL-based quantization Error shaped quantization
		-100
	Amplitude (dB)	-130 -120 -110
		-140
		-150
		-160
		2	2.2	2.4	2.6	2.8	3
				Radian frequency (ω)

Table 4 .

 4 7: Adaptive weighting improvements on the examples in Table 4.6.

	Filter	Minimax δ X	Optimal δ opt	Naive rounding δ naive	Telescoping δ tel	LLL reduction δ LLL
	A125/21 † 8.054 • 10 -6 1 .077 • 10 -5 B35/9 0.05275 0.07709	1.620 • 10 -5 0.15879	1 .179 • 10 -5 0 .07854	1.155 • 10 -5 0.07854
	E125/21 † 7.884 • 10 -6 1 .034 • 10 -5	1.479 • 10 -5	1 .127 • 10 -5	1.133 • 10 -5

Table 4 .

 4 8: High degree type I FIR specifications.

Table 4 . 9 :

 49 High degree quantization results.

	Filter	Degree n	Coefficient bit size b	Minimax E	Naive rounding E naive	LLL reduction E LLL
	F G H I J K	800 600 250 300 180 150	18 16 16 18 16 21	8.64 • 10 -4 4.78 • 10 -3 1.67 • 10 -4 4.67 • 10 -3 1.77 • 10 -3 2.99 • 10 -6	3.31 • 10 -3 1.24 • 10 -2 5.79 • 10 -3 6.56 • 10 -3 6.19 • 10 -3 7.68 • 10 -5	1.24 • 10 -3 6.73 • 10 -3 1.71 • 10 -3 4.91 • 10 -3 3.11 • 10 -3 2.15 • 10 -5

Table 6 .

 6 1: Rational minimax approximation errors for e x on (-∞, 0] of type (n, n), n = 1, . . . , 60. n E n,n (e x ; (-∞, 0]) n E n,n (e x ; (-∞, 0]) 1 6.683104216185046347061 • 10 -1 31 6.439041065521390118176 • 10 -31 2 7.358670169580529280013 • 10 -3 32 6.932444346272943657112 • 10 -32 3 7.993806363356878288081 • 10 -4 33 7.463619283376389623748 • 10 -33 4 8.652240695288852348224 • 10 -5 34 8.035458036521132725158 • 10 -34 5 9.345713153026646476754 • 10 -6 35 8.651074112710932240980 • 10 -35 6 1.008454374899670707935 • 10 -6 36 9.313819316267808643033 • 10 -36 7 1.087497491375247960867 • 10 -7 37 1.002730199532148674598 • 10 -36 8 1.172265211633490717795 • 10 -8 38 1.079540668419148048255 • 10 -37 9 1.263292483322314146095 • 10 -9 39 1.162231524864483662593 • 10 -38 1.361120523345447749871 • 10 -10 40 1.251252964917550487127 • 10 -39 1.466311194937487140668 • 10 -11 41 1.347089644624453421663 • 10 -40 1.579456837051238771487 • 10 -12 42 1.450263318089079447854 • 10 -41 1.701187076340352966416 • 10 -13 43 1.561335677432057988000 • 10 -42 1.832174378254041275156 • 10 -14 44 1.680911410106628688161 • 10 -43 1.973138996612803428626 • 10 -15 45 1.809641490212876992183 • 10 -44 2.124853710495223748800 • 10 -16 46 1.948226721724903899404 • 10 -45 2.288148563247891960405 • 10 -17 47 2.097421552916174407673 • 10 -46 2.463915737765169274831 • 10 -18 48 2.258038182743982444147 • 10 -47 2.653114658063312766926 • 10 -19 49 2.430950981542696891201 • 10 -48 2.856777383549093706691 • 10 -20 50 2.617101250085849882192 • 10 -49 3.076014349505790506914 • 10 -21 51 2.817502342918495410770 • 10 -50 3.312020500551318690751 • 10 -22 52 3.033245183843618403323 • 10 -51 3.566081860636424584770 • 10 -23 53 3.265504203580495204747 • 10 -52 3.839582582168132126936 • 10 -24 54 3.515543731910406302247 • 10 -53 4.134012517285363006271 • 10 -25 55 3.784724879098481327846 • 10 -54 4.450975355730424689793 • 10 -26 56 4.074512944043172953905 • 10 -55 4.792197375888904189931 • 10 -27 57 4.386485389471399102518 • 10 -56 5.159536858257132654665 • 10 -28 58 4.722340427583360413152 • 10 -57 5.554994213751622674642 • 10 -29 59 5.083906262873225056042 • 10 -58 5.980722882849695437271 • 10 -30 60 5.473151042428354389685 • 10 -59

In the sequel, the context will make it clear what w weight function is being used.

See https://github.com/sfilip/firpm for the accompanying C++ code

http://www.chebfun.org/examples/approx/FiltersCF.html

see https://github.com/sfilip/fquantizer

norm within an approximation factor of 2 O(d/k) in time O(2 k poly (d)). This is showcased in Table4.3 for the basis reduction algorithms we presented here. We remark the fact that for β = 2, the BKZ algorithm is akin to LLL, whereas for β = d, it is identical to HKZ.Table4.3 discusses worst-case complexities and approximation factors. The average behavior of LLL is also studied experimentally in[START_REF] Nguyen | LLL on the average[END_REF]; roughly speaking, on average, LLL retains a c d approximation

see http://perso.ens-lyon.fr/silviuioan.filip/icassp.html for the accompanying C++ source code

https://www.altera.com/

http://www.xilinx.com/

http://flopoco.gforge.inria.fr

http://gnuradio.org

http://docs.scipy.org/doc/scipy/reference/signal.html

https://github.com/chebfun/chebfun/tree/feature-rational-remez

https://github.com/sfilip/ratremez

Example 4.2. Consider a degree n = 22 type I polynomial filter adhering to specification A from Table 4.2. The coefficients of its associated transfer function are 8-bit fixed-point values with 7 bits used for the fractional part. Using the language of Problem 4.1, we are searching for integer values a i ∈ [-2 7 , 2 7 ] such that

is minimal, where, based on Tables 3.1 and 4.1, we have x = cos(ω), X = [-1, 0] ∪ [cos(0.4π), 1], ϕ 0 (x) = 1 2 7 , ϕ i (x) = Ti(x) 2 6 , 1 i 22, f (x) = W (ω)D(ω) = D(ω). Let us start by taking a pessimistic δ 0.03701, the error of the naive rounding of the minimax solution with real valued coefficients ( i.e., each coefficient of the minimax solution is rounded to the imposed format using the rule in expression (2.16)). We use as discretization a 2 • (22 + 2) = 48-point weakly admissible mesh consisting of 24 appropriately scaled Chebyshev nodes on each of the two intervals making up X. We obtain the projection bounds [a - 0 , a + 0 ] = [START_REF] Chan | A methodology for automatic hardware synthesis of multiplier-less digital filters with prescribed output accuracy[END_REF][START_REF] Cody | Chebyshev rational approximations to e -x in [0, +∞) and applications to heat-conduction problems[END_REF], [a - 1 , a + 1 ] = [START_REF] Brisebarre | Efficient polynomial L ∞ -approximations[END_REF][START_REF] Brunie | Arithmetic core generation using bit heaps[END_REF]

decreasing the number of test combinations to 1.48176 • 10 17 . Now, if we double the discretization size m + 1 to 96 ( i.e., a 48-point Chebyshev grid on each subinterval of X), but still take δ 0.02963, the projection intervals will be

This tells us that the quantity

, the product of the Gram determinants of the bases (b 1 ), (b 1 , b 2 ), . . . , (b 1 , b 2 , . . . , b d ), decreases by a factor δ < 1 each time we perform a swap. It can be shown that D is lower bounded by a positive value depending only on L, meaning the number of swaps performed must be finite.

The LLL algorithm stands as one of the most important results in lattice theory. It is effective in producing bases with relatively short vectors in many practical situations at a running time which is polynomially bounded by the rank and dimension of the lattice. If the basis elements have integer entries and B = max 1 i d b i 2 , then the bit-complexity required to LLL-reduce a lattice is O(d 5 n log 3 B).

The original version of the LLL algorithm assumes all computations are done in exact arithmetic and is virtually never used. This is because most of the computation time is spent on the GSO part of the algorithm and using exact arithmetic means the µ i,j 's will have bit sizes up to O(d log B), making their exact computation quite costly. That is why in practice, the GSO computations of the LLL algorithm are always done using floating-point arithmetic, which, if performed with O(d) precision, can produce a provably correct result. We note in particular the work of Nguyen and Stehlé [START_REF] Nguyen | Floating-point LLL revisited[END_REF], [START_REF] Nguyen | The LLL Algorithm -Survey and Applications[END_REF]Ch. 5], whose L 2 floating-point version of the LLL algorithm we use for our problems and has a bit complexity of O(d 4 n log B(d + log B)).

HKZ-reduction

A very strong reduction notion, with better properties than what we have presented so far is Definition 4.17 (HKZ-reduction). An ordered basis {b

Their appeal is mainly due to the fact that:

for all 1 i d.

Proof. See for instance [START_REF] Lagarias | Korkin-Zolotarev bases and successive minima of a lattice and its reciprocal lattice[END_REF]Sec. 3].

Despite this, the use of HKZ-reduced bases is limited due to no known polynomial-time algorithms to compute them. For lattices of small rank though, it is practical to enumerate all short vectors (see for instance [START_REF] Galbraith | Mathematics of public key cryptography[END_REF]Ch. 18.4] and the references therein for short lattice vector enumeration techniques) and hence, compute a HKZ-reduced basis.

BKZ-reduction

Schnorr [START_REF] Schnorr | A Hierarchy of Polynomial Lattice Basis Reduction Algorithms[END_REF] introduced the block Korkine-Zolotarev (BKZ) lattice basis reduction algorithm. It combines the LLL algorithm with the computation of HKZ-reduced bases for small-rank projections of the original lattice. Its output is generally of better quality than that of a LLL-reduced basis. The small rank is usually denoted with β, 2 β d and is called the block size. We will not go into any details regarding the BKZ algorithm since it is out of the scope of the present text.

To summarize these last two subsections, dealing with lattice basis reduction and/or the SVP problem is a matter of compromises. A popular (yet oversimplified) rule of thumb in the community is that for any value of the parameter k, 1 k d, one can solve (given the current state of the art) an SVP instance in the Kannan's embedding For this approach, given a basis (b 1 , . . . , b d ) of L ⊂ R n and the target vector t ∈ R n , we form a d + 1-rank lattice L ⊂ R n+1 generated by the basis vectors

where γ is a real parameter to be chosen later on. Now, if x ∈ R n+1 is a short vector of the lattice L , then there exist integers u 1 , . . . , u d+1 such that x = d i=1 u i b i + u d+1 t and hence

Since x is assumed to be short (for instance, a vector in a reduced basis of L ), then

The key question becomes how to choose γ. For a sufficiently large γ, small vectors in L will tend to have a 0 last coordinate, except in a reduced basis of L , where at least one vector needs to have a nonzero last coordinate. If we take γ max d i=1 b i 2 , then as soon as |u d+1 | = 0, we will have x 2 γ b i 2 for all i d. So, as reducing bases tends to produce shorter vectors, if c 1 , . . . , c d is a reduced basis of L, we can expect that for all j d, c j 2 < γ. Now consider c 1 , . . . , c d+1 to be a reduced basis of L . As any vector x ∈ L with a nonzero last coordinate will have x 2 > c j 2 for all j, we expect that c j = [c j 0]

T for j d. Hence c d+1 has to have a nonzero last coordinate. As γ is large, we assume this last coordinate to be ±γ, otherwise, by expressing c d+1 like in (4.13), the term γ 2 u 2 d+1 is large and it is likely that some shorter vector will be found by the reduction process. Thus, from c d+1 we will often be able to deduce a vector close to t.

In our experiments, the (heuristic) choice γ = max d i=1 b i 2 yielded a vector with u d+1 = ±1 in all cases. In particular, if d = n and we perform LLL-reduction on the initial basis of L , then the embedding technique can be shown to produce the same output as Babai's nearest plane algorithm [START_REF] Galbraith | Mathematics of public key cryptography[END_REF]Ex. 18.3.3]. We also note that Kannan's description in [START_REF] Kannan | Minkowski's Convex Body Theorem and Integer Programming[END_REF] is somewhat different, since it deals with another context and needs the target vector t to be rather close to L -an assumption that we cannot make about our current setting.

For the rest of the chapter, when talking about approximately solving a CVP instance, we will be doing so using the embedding technique. This choice is motivated by the fact that the result we get is generally on par or better than what we would obtain with the nearest plane method, but also because it is extremely straightforward to implement.

FIR filter design using the FPminimax algorithm

We have already seen that, given a linear phase FIR specification in terms of target number of taps and the associated degree, their fixed-point format (m -, m + , s), filter type, Ω, D(ω) and W (ω), we can express the weighted L ∞ design problem in the context of Problem 4.1 with the F i formats as subsets of integers.

Having done that, the overall steps of the heuristic approach we mentioned in Section 4.2.2 are:

1. use the second Remez algorithm to obtain an infinite precision solution p to Problem 4.1;

2. choose m + 1 n + 1 points z 0 , . . . , z m ∈ X to approximately interpolate p ;

3. solve the resulting CVP problem (4.9) by using Kannan's embedding technique with the LLL, BKZ or HKZ algorithm and retrieve the filter coefficients. Note that we need to check that the obtained of efficiency and resource consumption). It is a highpass FD specification with Ω = [0, 0.45π] ∪ [0.55π, π] and

The error bounds are specified as a passband ripple below 1dB (δ p 0.0575) and a stopband attenuation of at least 60dB (δ s 10 -3 ). We take the input format to be that of signed values (w i , f i ) = (16, 15) with total width of 16 bits, out of which 15 of them are fractional bits (meaning the values will be inside the interval [-1, 1), with the one bit not in the fractional part acting as sign bit). The output has f o = p = 15 fractional bits.

In order to compare the performance of our tool with respect to MATLAB's filterbuilder from the hardware point of view, we generated and synthesized several filters that are supposed to adhere to the given specification. Syntheses were performed with Xilinx ISE 14.7, using the Virtex6 xc6vcx75t-2ff484 FPGA as a target device, with design goals set to balanced. Based on our discussion from Section 5.1.1, the performance of the designs is measured in FPGA resource consumption (number of look-up tables (LUT) and registers (Reg.)) and maximum operating frequency at a given latency (number of cycles required to compute a result from the moment the corresponding input was given).

MATLAB's overwhelming choice

The first two parts of Table 5.1, obtained using MATLAB's filterbuilder, show how runtime performance and resource utilization depend on the coefficient and internal fixed-point formats that the user gives. Using a too large internal (and coefficient) format leads to wasted resources with respect to the output format (first part of the table and second line in the second part). A too small internal format with respect to the coefficient and input formats (first and third line in the second part of the table) will also lead to wasted resources and an inaccurate output, due to all the roundings done internally to fit to the desired format.

The third part of the table is obtained using MATLAB's minimizecoeffwl routine, which tries to minimize the coefficient wordlengths, while still respecting the initial FD constraints. We had to leave the graphical interface to do this, hence the expert mode nomenclature in Table 5.1. The list of MATLAB commands used to generate those two quantizations are: % FD specification for the filter f = fdesign.highpass('Fst,Fp,Ast,Ap',0.45,0.55,60,1); Hd = design(f,'equiripple'); % Apply the Matlab quantization tools to reduce the coefficient % wordlengths as much as possible, while still satisfying the FD % specification (can change the filter length) % this line outputs a length N=49 filter with 10-bit coefficients Hq = minimizecoeffwl(Hd); % another quantization which uses the same number of coefficients % as the double precision filter % we obtain N=45 and a 12-bit coefficient quantization Hq2 = minimizecoeffwl(Hd,'MatchrefFilter',true); On most executions of the previous code, for Hq we obtained a stopband attenuation of about 60.15dB and a passband ripple of 0.79dB. The analogous values for Hq2 were approximately 60.2dB and 0.88dB. At another level of comparison, when we tried to mimic the behavior of these two calls to minimizecoeffwl using our coefficient quantization approach, we got N = 43 with stopband attenuation 60.2dB and passband ripple 3449L + 717R 2 @ 207 MHz † : Ouput error analysis for these architectures shows that ε 2 -10 . For all the others it seems to be the case that ε 2 -15 , as specified.

0.97dB for the 12-bit coefficient format. For 10-bit coefficient quantization, the values were N = 47, 60.2dB for the stopband attenuation and 0.79dB for the passband ripple.

In terms of resource use and frequency characteristics, we remark that the two expert mode filters are best among the MATLAB suite of trials (i.e., smallest resource consumptions at the highest frequencies).

All these trials are illustration of the complexity incurred by the vast design parameter space. They show that both coefficient and internal formats should be optimized jointly. Such an exploration of the parameter space takes time. Besides, MATLAB does not seem to readily provide implementation accuracy data (ε or an equivalent signal/noise measure) at the end of the code generation process. We have already mentioned that with our approach, ε = 2 -p is guaranteed by the error analysis from [START_REF] De Dinechin | Sum-of-product architectures computing just right[END_REF].

Running the proposed algorithm

Our tool starts by determining a minimal N for which the FD specification remains satisfied when the filter has real coefficients. The filterbuilder result is a type I filter with N = 45 coefficients. We on the other hand, find a type I filter with N = 43.

Then, FloPoCo's SOPC kernel determines that it needs an internal format with 21 fractional bits. A filter with coefficients quantized to this format is then found: its passband ripple is smaller than 0.9 dB and its stopband attenuation is larger than 61 dB, matching the FD specification.

Automating the choice leads to better performance

The last line of Table 5.1 presents data about the filter generated using our approach (the total runtime was less than one minute). It is comparable in resource use to filters generated with MATLAB in expert mode, while being obtained automatically and is about twice as fast. The results are much better than those obtained using only MATLAB's graphical user interface.

The better frequency of our architecture (207MHz as opposed to the maximum of 104MHz for the other filters) essentially comes from a better implementation of the summation (using a bit heap data structure in our approach as opposed to rows of additions in the MATLAB-generated code).

However, this comparison of resource use and runtime performance shows where there is room for improvement in our approach. An expert user of MATLAB is able to take advantage of smaller quantization formats for the coefficients, which our current architectural choice inside FloPoCo is unable to exploit efficiently. This will be improved in future versions of our tool. Theorem 6.6. Let p ∈ C m [x] and q ∈ C n [x] satisfy (6.9). Then p and q are of the form p(x) = (psv)(x) and q(x) = (qsv)(x), where • p and q are relatively prime polynomials, unique up to normalization, and of exact degrees m and n, 0 m m, and 0 n n,

• s is a monic polynomial of degree δ s , where 0 δ s δ = min(mm, nn), whose zeros are the interpolation points x j such that q(x j ) = 0, and

which is equivalent to saying that the number of zero singular values of Z is equal to the number of common factors of p/q (other than those of s).

Proof. See [START_REF] Pachón | Fast and stable rational interpolation in roots of unity and Chebyshev points[END_REF]Thm. 4.1] and the references therein.

We recognize δ to be the defect of p/q. Numerical problems with rational interpolation seem, in many cases, to be traceable to v, whose degree is equal to the nullity of Z. They are due to the numerical rank-deficiency of Z which manifests itself through the fast decay of Z's singular values (see discussions from [START_REF] Pachón | Fast and stable rational interpolation in roots of unity and Chebyshev points[END_REF]Sec. 4] and [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 26]) when m and n increase.

Going back to the rational exchange algorithm, we can interpret (6.4) as a rational interpolation problem with weighted deviations [START_REF] Maehly | Methods for fitting rational approximations, Parts II and III[END_REF] (if we consider the levelled error h a constant):

Using Theorem 6.5, we construct the Vandermonde-type matrix

, where the ϕ i polynomials are orthogonal with respect to the inner product

where D ∈ R N ×N is a diagonal matrix with (D) (i,i) = f (x i ) -(-1) i h. Eq. (6.13) gives rise to the generalized eigenvalue problem (equivalent to (6.7))

C m+1:N -1 FC 0:n b = h C m+1:N -1 ∆C 0:n b, (

where both F and ∆ are diagonal matrices with (F) (i,i) = f (x i ) and (∆) (i,i) = (-1) i . A discussion on some computational aspects of determining C is given in [START_REF] Pachón | Fast and stable rational interpolation in roots of unity and Chebyshev points[END_REF]Sec. 3.3]. For the moment, we compute it as the orthogonal part of the QR decomposition of an N × N Vandermonde-type matrix whose columns are polynomials of an arbitrary basis evaluated over x.

As mentioned before, at most one eigenpair of (6.14) will give rise to a bounded r over [a, b]. Inside Chebfun remez, for each eigenpair, the values q(x i ) are computed, and one of them where the entries of q(x) have the same sign is chosen. In many of the cases we applied the algorithm on, when such a pair exists, it is unique, although in the future we should probably replace this tactic with a more robust test.

Updating the reference set

Once the current rational interpolant is determined, we need to find the local maxima of |f -r| to construct the next reference set, analogous to what we did in Section 3.8 for the polynomial case.

The way this is done in the implementation of the remez code from [START_REF] Pachón | Algorithms for Polynomial and Rational Approximation[END_REF]Ch. 6] is that, once the appropriate h and b are computed, it is not hard to determine p(x) and q(x). These values then serve to construct barycentric polynomial representations of p and q on the current reference x, which are then given to Chebfun to construct chebfuns of p and q. The local maxima of |f -r| are now retrieved as the roots of the chebfun representation of q 2 fqp + pq using the roots command [START_REF] Trefethen | Approximation Theory and Approximation Practice[END_REF]Ch. 18].