On some quasi-periodic approximations

. Trigonometric approximation or interpolation of a non-smooth function on a ﬁnite interval has poor convergence properties. This is especially true for discontinuous functions. The case of inﬁnitely diﬀerentiable but non-periodic functions with discontinuous periodic extensions onto the real axis has at-tracted interest from many researchers. In a series of works, we discussed an approach based on quasi-periodic trigonometric basis functions whose periods are slightly bigger than the length of the approximation interval. We proved validness of the approach for trigonometric interpolations. In this paper, we apply those ideas to classical Fourier expansions.


Introduction
We consider the problem of accurate reconstruction of a smooth but nonperiodic function f on [−1, 1] by the finite number of its Fourier coefficients {f n } N n=−N , where f n = 1 2 It is well known (see [1,2] with references therein) that the solution of the problem by the truncated Fourier series is noneffective due to slow point-wise convergence on (−1, 1) and the Gibbs phenomenon at x = ±1 which causes nonuniform convergence on [−1, 1]. Even when f is infinitely differentiable but non-periodic, the maximum convergence rate is Similar problems are well-known [1,3] for accurate reconstruction of a smooth but non-periodic function f on [−1, 1] by its point-values f (x k ) on a uniform grid {x k } ∈ [−1, 1]. In particular, when the problem can be reformulated in terms of the discrete Fourier coefficients {f n } N n=−N , wheref Similar to the truncated Fourier series, degradation of the convergence due to non-periodicity exists also for the classical trigonometric interpolation Different approaches are known for convergence acceleration of the truncated Fourier series or trigonometric interpolation for non-periodic smooth functions. We refer to [4][5][6][7][8][9][10][11][12][13][14][15][16][17] with references therein for a detailed review of different methods.
In this paper, we consider a quasi-periodic approach suggested in [18] for trigonometric interpolations. In a series of works [19][20][21][22], we explored its point-wise and L 2 (−1, 1)-convergence, and behavior at the endpoints x = ±1. We named it as quasi-periodic (QP-) interpolation and outlined its benefits compared to the classical trigonometric interpolation.
with period 2/σ which tends to 2 as N → ∞. Explicit formula for the QP-interpolation can be derived by the following simple transformation. Consider a new function f * (t) defined on [−σ, σ] by the following change of variable This implies interpolation of f * (t) on the grid while interpolating f (x) on the grid (1). Thus, the QP-interpolation actually interpolates f * (t) on the grid t k and is exact for e iπnt , |n| ≤ N .
The main goal of this paper is the application of this idea to convergence acceleration of the truncated Fourier series.
The paper is organized as follows. Section 1 shortly describes the idea of the QP-interpolation. Section 2 considers extension of the approach to the classical Fourier series. Sections 3 and 4 describe different possibilities of application of the quasi-periodic basis functions to trigonometric approximations. Section 5 proves that the Fourier coefficients of the quasi-periodic basis functions can be sufficiently well approximated by the classical coefficients. Section 6 makes conclusions, and Section 7 refers to some future works.

Quasi-Periodic Approximation
Assume f is a smooth but non-periodic function on [−1, 1] such that We consider extension f * of f on a bigger interval [−1, 1] ⊂ [−a, a] for some a > 1: Now, f * can be approximated by the truncated Fourier series on the interval [−a, a] where If the extension onto the interval [−a, a] is performed such that f * ∈ C k [−a, a] and f * (j) (a) = f * (j) (−a), j = 0, . . . , k, then the approximation S * N (f, x) on [−1, 1] will be more precise compared to S N (f, x).
Below, we discuss different approaches for function extensions. Following the idea of the QP-interpolation, we take (although other values for parameter a can be considered) and write S * N (f, x) and f * n as follows Then, we rewrite F n,m as follows Note that m = −1 corresponds to σ = a = 1, and S N,−1 (f, x) coincides with the truncated Fourier series which can be used for periodic functions.
Further, we will discuss approaches for calculating the first and last terms in (2). Note that the preliminary problem statement was the recovery of a function defined on [−1, 1] by its finite number of the classical Fourier coefficients {f n } N n=−N . However, the QP-approximation requires the knowledge of the finite number of quasi-periodic coefficients {f n,m } N n=−N . Another problem is that the latest depend on N and should be calculated each time when N is changed. Thus, we will discuss the problem of approximation of the QP-coefficients via classical Fourier coefficients. The approximation precision can be controlled by a parameter q and can be selected such that to preserve the convergence qualities of the QP-approximation.
We will consider two different approaches for a function extension. Next section discusses extensions based on linear combinations of some functions like polynomials, quasi-polynomials, etc. Algorithm A considers the simplest approach and performs extensions by a linear combination of exponential functions. The unknown coefficients in the linear combination can be found as a solution of a system of linear equations. Section 3 considers implicit extensions via values of function f on a grid outside of [−1, 1] for approximation of the first and last terms of (2) by some quadrature formulas. Further, those unknown data values will be determined from the solution of a system of linear equations. The grid should be non-uniform in case of Gaussian quadrature (Algorithm B) and uniform (Algorithm C) while using more simple rules. Algorithm C allows an explicit solution of the corresponding system with the Vandermonde matrix. As a result, we get an explicit formula for the QP-approximation which allows investigation of its convergence more accurately. Then, according to (2), we can rewrite coefficients F n,m as follows We propose the determination of the unknown coefficients c lef t j and c right j , j = 0, . . . , m from the following system of linear equations assuming that the set of supporting functions {ψ(j, x)} m j=0 is selected such that the system has a unique solution. By vanishing the last Fourier coefficients, we hope that the corresponding extension will be periodic and relatively smooth to accelerate the convergence of the QP-approximation.
Throughout the paper, we only experiment with the following specific function which is infinitely differentiable but non-periodic. Approximation by the truncated Fourier series is poor with O(N −1 ) inside the interval and O(1) on the entire interval as N → ∞. Fig. 1 shows the corresponding results for N = 256 and N = 512. The left graphs correspond to interval [−0.8, 0.8] and the right graphs to the entire interval [−1, 1]. QP-approximation performs extension of (6) from [−1, 1] to interval [−1/σ, 1/σ] and approximates the function on the latest interval by the truncated Fourier series. Fig. 2 shows the corresponding extension for N = 512 and m = 7. The blue curve corresponds to the original function and the red one to its extension. We see that the extension is periodic and almost smooth. Fig. 3 shows the absolute errors by Algorithm A for function (6). We see tremendously faster convergence rate compared to the classical Fourier series inside the interval of approximation. Although, on the entire interval the convergence rate is still O(1), the constant of the corresponding asymptotic error is much smaller.

Extensions by Unknown Data Points
As we mentioned above, the extensions can also be provided implicitly. It means that the values of the left and right extensions for some grid points can be estimated without providing the explicit extensions. Fig. 4 illustrates this idea, where ±x 0 , ±x 1 , . . . , ±x m are some 2m + 2 grid points (uniform or non-uniform) outside the interval [−1, 1]. We use these values to approximate the integrals in (2) by a quadrature formulas: and Now, we rewrite (2) as follows: We denote f lef t (−x j ) and f right (x j ) by c lef t j and c right j , respectively, and find them from the following system of linear equations assuming that w j and x j are chosen appropriately.

Algorithm B: Nonuniform Grid for the Gaussian Quadrature
The most accurate should be the Gaussian quadrature with the corresponding non-uniform grid. In particular, we apply the well known Gauss-Legendre quadrature rule with (m+1) points, where x j is the j-th root of the Legendre polynomial P m+1 (x), i.e.,

Algorithm C: Uniform Grid for the Rectangle Rule
The idea is similar to Algorithm B, but instead of he Gauss-Legendre quadrature, we apply the simplest rectangle rule with the uniform grid and weights Further, Denoting we get the following system of linear equations The solutions {c lef t j } and {c right j } of system (7) will lead to the modified coefficients Fig. 7 shows the extension of the function (6) corresponding to Algorithm C for N = 512 and m = 7. Fig. 8 shows the absolute errors while approximating the same function by Algorithm C for N = 256, N = 512 and m = 7. Although the extension is periodic, but visually the smoothness is smaller compared to the previous extensions. As a result, the absolute errors are worse compared to the corresponding absolute errors of Algorithms A and B. However, approximation by Algorithm C has several benefits. Firstly, we will show that system (7) has Vandermonde matrix leading to the uniqueness of the corresponding solution. Secondly, the Vandermonde matrix leads to the explicit solution of the system and to the explicit form of the QPapproximation. Thirdly, fast and robust algorithms for calculation of the corresponding inverse matrix allow fast implementation even for big values of m. Fourthly, Algorithm C will help to estimate the convergence rate of the corresponding QP-approximation while it should be more problematic for Algorithms A and B.

Approximation of the Quasi-Periodic Fourier Coefficients by the Classical Ones
The main goal was reconstruction of a function on [−1, 1] by a finite number of its Fourier coefficients {f n } N n=−N . However, the QP-approximation deals with Fourier quasi-periodic coefficients {f n,m } N n=−N . In this section, we discuss the problem of approximation of the quasi-periodic Fourier coefficients by their classical counterparts. We consider the Lanczos representation [4,5,23] for this purpose.
Let f ∈ C q [−1, 1], q ≥ 0. By A k (f ) denote the exact value of the jump in the k-th derivative of f at the endpoints Consider the following representation of the approximated function where B k are 2-periodic extensions of the Bernoulli polynomials with the Fourier coefficients

and Φ is a 2-periodic function on the real line with the Fourier coefficients
Note that f (x) ≡ Φ(x) for x ∈ [−1, 1] when q = 0. Note also that the smoothness of Φ on the real line is directly connected with the value of q.
Theorem 1 Let f (q+1) ∈ AC[−1, 1], q ≥ 0. Then the following asymptotic expansion holds as N → ∞ and |n| ≤ N : for even values of q, and for odd values of q.
Proof. The following asymptotic expansions hold for the classical Fourier coefficients f n and Φ n , n → ∞. The last expansion leads to the following asymptotic estimate for the error Let us estimate the infinite series on the right-hand side of (11). Applying differentiation with respect to a parameter, we get Let q be even. The following asymptotic estimates hold as N → ∞ which concludes the proof of (9). Similarly, for the odd values of parameter q, we have which concludes the proof of (10). Fig. 9 shows the accuracies of approximations for different values of N , m and q in logarithmic scale (see (6)). According to Theorem 1, as bigger is the value of q, the more precise is the approximation of the quasiperiodic coefficients. The accuracy of the approximation depends on the parameter q. Its value should be selected such that the approximation of the quasi-periodic coefficients does not degrade the convergence properties of the QP-approximation. Fig. 10 shows the graphs of absolute errors by algorithm A with approximate quasi-periodic coefficients. The top graphs of Fig. 10 corresponds to the approximations with q = 0. In this case, the quality of the approximation by Algorithm A is heavily impacted by the poor approximation of the coefficients. The middle graphs correspond to q = 1 and show better performance, although they are still far from the quality of the approximation with the exact coefficients. Only the bottom graphs corresponding to q = 2 have the same performance as Algorithm A with the exact coefficients. As it was expected, the accuracy can be improved by increasing q and similar results can be obtained as in case of exact coefficients. Assume that the acceptable value of parameter q = q 0 is selected. The next milestone is an approximation of jumps A k (f ) when they are unknown. Approximations can be derived from the following system of linear equations (see [24] with references therein) According to the results of [24] A Then, (13) which can be used in (11). The first term in the right-hand side of (13) is of the order O(N −q 0 −1 ) when |n| > N . The same order has the second term. It means that the convergence rate of Theorem 1 will remain valid, but with another constant of the asymptotic error. To get the same constant, we need to approximate jumps by system (12) with q = q 0 + 1 and drop the last jump.

Some Extensions
Up to now, it was assumed that the parameter m in the QP-approximations was fixed. As all three Algorithms A, B, and C require solution of systems of linear equations with 2m + 2 unknowns, it is reasonable to keep m small to deal with systems of small sizes. However, explicit solution of the system of Algorithm C via the inverse of the Vandermonde matrix allows utilization of large values of m which will provide with improved accuracy away from the singularities x = ±1.
A practical solution can also be achieved by using the well-known Björk-Pereyra algorithm [25]. This O((2m + 2) 2 )-algorithm has a number of beneficial properties. In particular, under certain mild hypotheses [26], the magnitude of the corresponding numerical errors depends only on the machine precision used and is independent of the condition number of the matrix.
Thus, either using the explicit formulas or the mentioned algorithm, m can be tended to infinity together with N .
Quasi-periodicity requires limiting m by the condition m = o(N ). We experiment with m = [ √ N ] (integer part), and the corresponding results show in Fig. 11 for function (6). For each graph, we show the value of N and the corresponding value of m. The left column of the figure corresponds to the results for interval [−0.8, 0.8]. We see benefits of the quasi-periodic approach. The right column shows the behavior of the absolute errors around the point x = 1. We detected identical behavior around the point x = −1. Although, the error is not decreasing much while m is increasing, it is obviously affecting the L 2 -error.
Another opportunity for improving the convergence is application of the polynomial correction approach to the QP-approximations. Paper [27] describes this approach for the QP-interpolations. Our experiments show that it similarly works for the QP-approximations.
The convergence of the QP-interpolation [22] depends on the following property of differentials It means that for an arbitrary f which does not satisfy (14), a polynomial should be subtracted such that a new function satisfies (14). In [27], the following decomposition was considered where and polynomials µ k,q (x) and ν k,q (x) (see [27]) are such that Function G can be successfully approximated by the QP-approximation. We denote the corresponding QP-approximation by S N,m,q (f, x): For the realization of the approximation S N,m (G, x), the Fourier quasiperiodic coefficients of G can be computed from (15).  Since the exact values of jumps A − k (f ) and A + k (f ) are unknown, the corresponding approximations can be derived from the following system of linear equations G n,m = 0, |n| = N − q + 1, . . . , N, where G n,m are the quasi-periodic coefficients of G. Figs. 12 and 13 show the absolute errors by S N,m,q for q = 1 and q = 2, respectively (see (6)). As in Fig. 11, we took m = [ √ N ]. Comparison of the figures shows that polynomial corrections improve the convergence not only away from the singularities x = ±1, but also for the entire interval.
For example, let us consider the graphs corresponding to N = 4096 and m = 64.
The absolute error on interval [−1, 1] for the QP-approximation is 0.003. We saw that it was impossible to improve neither by increasing N nor m. After the polynomial correction with q = 1, the error is 8 × 10 −27 . After the polynomial correction with q = 2, the error is 2 × 10 −33 .

Conclusion
The problem considered in the paper is in a function reconstruction on a finite interval by the finite number of its Fourier coefficients. Natural approach of reconstruction can be application of the truncated Fourier series which uses periodic trigonometric basis functions whose periods exactly match the length of the approximation interval. Those approximations are very powerful for functions whose periodic extensions from a finite interval onto the real axis are smooth or, preferably, infinitely differentiable. As a result, those expansions have poor convergence properties for infinitely differentiable but non-periodic functions with unequal values at the endpoints of the interval of approximation f (−1) = f (1).
QP-approximation considers trigonometric expansions with "basis" functions whose periods are slightly bigger than the length of the interval of the approximation Thus, they diminish the affect of the mentioned non-periodicity and result in better convergence properties away from the endpoints. At the endpoints, the convergence rate is O(1), N → ∞ as in the case of classical Fourier expansions, however the constant of the asymptotic error is smaller. For   QP-approximation, approximated functions should be extended from [−1, 1] to a slightly bigger interval whose length matches the period of the "basis" functions. Those extensions can be provided differently which lead to Algorithms A, B, and C. Extensions require a solution of some systems of linear equations that lead to almost smooth and periodic extensions. In the case of Algorithm C, the system has the Vandermonde matrix, and the uniqueness of the corresponding solution is easy to prove. In case of Algorithms A and B, we have only experimental validation of the approaches.

Future Work
The investigation of the convergence of Algorithms A, B, and C should be the next. For fair comparisons, it is better to have asymptotically exact estimates for the corresponding convergence rates. Most likely, those estimates will be derived for Algorithm C which has almost explicit formulation in terms of the inverse of the Vandermonde matrix. Investigations should be performed both for the entire interval of the approximation and away from the endpoints. The application of all these ideas to the modified trigonometric basis, which was intensively investigated in a series of papers [28][29][30][31][32], is also interesting.