Discrete Periodic Extension Using an Approximate Step Function∗
Total Page:16
File Type:pdf, Size:1020Kb
SIAM J. SCI. COMPUT. c 2014 Society for Industrial and Applied Mathematics Vol. 36, No. 2, pp. A668–A692 DISCRETE PERIODIC EXTENSION USING AN APPROXIMATE STEP FUNCTION∗ NATHAN ALBIN† AND SUREKA PATHMANATHAN‡ Abstract. The discrete periodic extension is a technique for augmenting a given set of uniformly spaced samples of a smooth function with auxiliary values in an extension region. If a suitable extension is constructed, the interpolating trigonometric polynomial found via an FFT will accurately approximate the original function in its original interval of definition. The discrete periodic extension is a key construction in the algorithm FC-Gram (Fourier continuation based on Gram polynomials) algorithm. The FC-Gram algorithm, in turn, lies at the heart of several recent efficient and high- order-accurate PDE solvers. This paper presents a new flexible discrete periodic extension procedure that performs at least as well as the FC-Gram method, but with somewhat simpler constructions and significantly decreased setup time. Key words. Fourier series, nonperiodic functions, Fourier continuation AMS subject classifications. 42A15, 65T40, 65T50 DOI. 10.1137/130932533 1. Introduction. The purpose of this paper is to offer a straightforward ap- proach for addressing the approximation problem illustrated in Figure 1. In the figure, the solid curve represents a smooth function f(x) on the interval [0, 1], and the solid circular dots represent N samples of f at uniformly spaced nodes in this interval. The problem addressed in this paper is summarized as follows: Main problem: By using only the first d and last d data points, how does one produce an additional M function values in an interval [1,b] with the property that the trigonometric polynomial interpolant of all N + M samples on [0,b] provides a highly accurate approximation of f(x) in the interval [0, 1]? In the figure, the trigonometric polynomial interpolant is represented by the union of the solid and dashed curves. For illustration purposes, the sizes of N, M,andd in the schematic are smaller than the values for these numbers used in practice. In the numerical comparisons presented in section 5, for example, M = 25, d = 10, and N ≥ 100. The algorithm presented can be viewed conceptually as a method for efficiently producing, for any choice of N ≥ d, a sparse (N +M)×N matrix Eper which maps the N samples of the original function to the N + M samples of its periodic extension. The sparseness of the matrix operator derives from the fact that only 2d samples are used to produce the extension, regardless the size of N. As will be shown 2 (see (2.8)), Eper has a very simple structure with only N +2d nonzero entries. Such a matrix, Eper, can be quite useful in practice, as it allows the high-precision approximation of a nonperiodic function f and its derivatives by means of FFT-based interpolation of the extended vector. Moreover, due to the sparsity of Eper and the efficiency of the FFT, the resulting algorithm will have O(N log N) complexity. The ∗Submitted to the journal’s Methods and Algorithms for Scientific Computing section August 12, 2013; accepted for publication (in revised form) November 27, 2013; published electronically April 10, 2014. http://www.siam.org/journals/sisc/36-2/93253.html †Department of Mathematics, Kansas State University, Manhattan, KS 66506 ([email protected]. edu). ‡Department of Mathematics and Statistics, Texas Tech University, Lubbock, TX 79409-1042 ([email protected]). A668 DISCRETE PERIODIC EXTENSION A669 d points d points N points M points 0 1 b Fig. 1. Schematic diagram of the main problem described in section 1. construction of Eper is modeled after a simple three-step procedure for solving the continuum version of the main problem: given a function f(x)onaninterval,how can one extend it to a smooth, periodic function f˜(x) on a slightly larger interval? The paper is organized as follows. The remainder of the introduction describes the solution to the continuum ex- tension problem and places the discrete extension problem in context with related constructions. Section 2 introduces the new discrete periodic extension algorithm, and section 3 explores the approximation properties of the new extensions. Section 4 discusses some of the finer details involved in implementing the described algorithm, section 5 presents numerical experiments demonstrating the effectiveness of the exten- sion in approximation, and section 6 summarizes the main conclusions of this work. 1.1. Periodic extension: Fourier methods for nonperiodic functions. The problem of periodic extension can be stated as follows. Problem 1. Let f be a smooth function defined on an interval [0, 1].Asmooth, periodic function f˜ on a larger interval [0,b] ⊃ [0, 1] is called a periodic extension of f if f˜(x)=f(x) for all x ∈ [0, 1]. In this paper, “smooth” will frequently be used as a general term representing some unspecified degree of differentiability. The reader desiring a more formal defini- tion may interpret “smooth” as C∞ or Cp with p ≥ 10. The solution of Problem 1 plays an important role in the generalization of FFT- based computational methods to the nonperiodic setting. Suppose that f is a smooth 1 function on the interval [0, 1]. In general, although the partial Fourier sums PN f, where N/2 b 2πikx/b PN f(x)= fˆke , k=−N/2 do converge pointwise to f on the open interval (0, 1), they do not converge uniformly. More significantly in the context of the present paper, if f is sampled at N uniformly spaced points in the interval (0, 1), then the interpolating trigonometric polynomial 1 IN f,where N/2−1 b 2πikx/b (1.1) IN f(x)= ake k=−N/2 with coefficients ak found by means of the FFT, will not provide a good approximation of f as a result of the associated Gibbs “ringing” artifacts. A670 NATHAN ALBIN AND SUREKA PATHMANATHAN However, if f can be smoothly extended to a periodic function f˜ with periodicity b on a larger interval [0,b], then the partial Fourier sums PN f˜ will converge uniformly and rapidly at a rate controlled by the smoothness of f˜. This implies that f can be b accurately approximated on its domain [0, 1] by the restriction of IN f˜ for sufficiently large N. Such constructions have numerous applications, including their use in high- order derivative approximations for numerical PDEs solvers [3, 4, 8, 11, 20, 22, 23]. 1.2. Periodic extension in the continuum. The periodic extension problem defined in Problem 1 may be more accurately termed periodic extension in the contin- uum in order to distinguish it from the discrete analogue discussed at the beginning of this paper and revisited in section 1.3. The distinction—which motivates the present paper—is that in the continuum version of the problem, one wishes to extend a func- tion to a periodic function on a larger interval, while in the discrete version, one wishes to extend a vector of discrete samples of a function to a vector of discrete samples of a smooth periodic function on a larger interval. The problem of continuum periodic extension (or approximate extension) has been treated in [1, 2, 6, 13], as well as in the related results presented in [7, 14]. In fact, although they are targeted at the case when f is already known on an ex- tended interval, the presentations in [7, 14] provide strong motivation for the last two steps of the following three-step periodic extension procedure. This procedure for the continuum problem, in turn, motivates the discrete constructions to follow. Smooth extension. Let f be a smooth (Cp) function on the interval [0, 1], that is, f along with several of its derivatives are continuous and bounded on [0, 1]. By using the Taylor polynomial approximations of f at x =0andx = 1, it is trivial to extend f as a smooth function on all of R, as in Figure 2(a). In what follows, E represents such a smooth extension operator. In other words, given a smooth function f on [0, 1], Ef is a smooth function on all of R with the property that Ef(x)=f(x)forx ∈ [0, 1]. In the present paper, we restrict our attention to the extension operator produced by the dth-degree Taylor polynomial approximation (with d<p) defined as follows: ⎧ ⎪ ∈ ⎪f(x)forx [0, 1] ⎪ d ⎨ (j) xj f (0) j! for x ∈ (−∞, 0) (1.2) Ef(x)= j=0 ⎪ ⎪ d j ⎪ (j) (x−1) ⎩ f (1) j! for x ∈ (1, ∞) j=0 Windowing. Once the function f is smoothly extended to Ef, the extension can easily be given compact support by multiplication with a smooth windowing function, W , as shown in Figure 2(b). Provided W is chosen with the properties that W (x)=1 for x ∈ [0, 1] and W (x)=0forx/∈ (−δ, 1+δ), the window can be combined with the extension operator to form a new windowed extension operator EW with the following properties (see Figure 2(c)): EWf = W ·Ef, EWf(x)=f(x)forx ∈ [0, 1], supp (EWf) ⊆ [−δ, 1+δ]. Periodization. Finally, the compactly supported smooth extension EWf can be periodized into a smooth, periodic extension Eperf with period b>0 through the DISCRETE PERIODIC EXTENSION A671 -δ 1+δ -δ 1+δ 3 1 2 0.8 1 0.6 0 0.4 -1 0.2 -2 0 -3 -0.5 0 0.5 1 1.5 -0.5 0 0.5 1 1.5 (a) (b) -δ 1+δ b 3 3 2 2 1 1 0 0 -1 -1 -2 -2 -3 -3 -0.5 0 0.5 1 1.5 -0.5 0 0.5 1 1.5 (c) (d) Fig.