City University of New York (CUNY) CUNY Academic Works

Publications and Research Kingsborough Community College

2008

A -based Method for Overcoming the Gibbs Phenomenon

Nataniel Greene CUNY Kingsborough Community College

How does access to this work benefit ou?y Let us know!

More information about this work at: https://academicworks.cuny.edu/kb_pubs/76 Discover additional works at: https://academicworks.cuny.edu

This work is made publicly available by the City University of New York (CUNY). Contact: [email protected] AMERICAN CONFERENCE ON APPLIED (MATH '08), Harvard, Massachusetts, USA, March 24-26, 2008

A Wavelet-based Method for Overcoming the Gibbs Phenomenon

NATANIEL GREENE Department of Mathematics and Computer Science Kingsborough Community College, CUNY 2001 Oriental Boulevard, Brooklyn, NY 11235 UNITED STATES [email protected]

Abstract: The Gibbs phenomenon refers to the lack of which occurs in many orthogonal basis approximations to piecewise smooth functions. This lack of uniform convergence manifests itself in spurious oscillations near the points of discontinuity and a low order of convergence away from the discontinuities. Here we describe a numerical procedure for overcoming the Gibbs phenomenon called the inverse wavelet reconstruction method. The method takes the Fourier coefcients of an oscillatory partial sum and uses them to construct the wavelet coefcients of a non-oscillatory wavelet .

Key–Words: Gibbs phenomenon, , Gegenbauer reconstruction, inverse polynomial reconstruction.

1 Introduction wavelet is a function L2 (R) satisfying: 2 1 (x) dx = 0 (1) Fourier and orthogonal polynomial series are known for their highly accurate expansions for smooth func- Z1 tions. In fact it is known that the more derivatives and a function has, the faster the approximation will con- () 1 d < ; (2) verge. However, when a function possesses jump-  1 discontinuities the approximation will fail to converge Z1 bj j uniformly. In addition, spurious oscillations will where here is the of . The cause a loss of accuracy throughout the entire do- function is also known as an analyzing wavelet main. This lack of uniform convergence is known as or a motherb wavelet since any function f L2 (R) the Gibbs phenomenon. Methods for post-processing can be expressed as a continuous sum of translations2 approximations which suffer from the Gibbs phenom- and dilations involving according to the continuous enon include the Gegenbauer reconstruction method wavelet transform. The continuous wavelet transform of Gottlieb and Shu [7,9,10], the method of Pade is given by approximants due to Driscoll and Fornberg [2], the method of spectral molliers due to Gottlieb and Tad- 1=2 1 t b (W f)(b; a) = a f (t) dt mor [8] and Tadmor and Tanner [17, 18], the in- j j a verse polynomial reconstruction method of Shizgal Z1   and Jung [13,14,15,16], and the Freund polynomial and the inverse continuous wavelet transform is given reconstruction method of Gelb and Tanner [6]. These by reconstruction methods can be combined with an ef- 1 (t) fective method for edge-detection developed by Gelb 1 1 b;a f (x) = [(W f)(b; a)] 2 dadb and Tadmor [3,4,5,6], to yield an exponentially accu- C a Z1 Z1 rate reconstruction of the original function. In this (3) paper we describe a new numerical method for over- where 1=2 t b coming the Gibbs phenomenon following the work of (t) = a b;a j j a Shizgal and Jung, called the inverse wavelet recon-   struction method. and We begin with a brief review of the essential de- () C = 1 d: nitions of wavelets which we will need. Recall that a  Z1 bj j

ISSN: 1790-5117 408 ISBN: 978-960-6766-47-3 AMERICAN CONFERENCE ON APPLIED MATHEMATICS (MATH '08), Harvard, Massachusetts, USA, March 24-26, 2008 A discrete wavelet series is given by The Fourier coefcients f (n) can be expressed in terms of Gegenbauer- coefcients as follows. 1 1 b f (x) = cj;k j;k (x) (4) 1 1 inx j= k= f (n) = f (x) e dx X1 X1 2 1 Z 1 where the discrete wavelet series coefcients are given b 1 1 = f  (m) C (x) e inxdx by 2 m 1 m=0 k 1 Z X cj;k = (W f) ; 1 2j 2j 1  b 1  inx   = f (m) Cm (x) e dx 2 1 and m=0  Z  j=2 j X j;k (x) = 2 2 x k . 1 b  = f (m) cm;n (7) For more information see, for example, Chui [1]. We m=0 X will make use of wavelet series for our reconstruction b  technique further on. The connection coefcients cm;n are given by

1  1  inx 2 The Inverse Wavelet Reconstruc- cm;n = Cm (x) e dx (8) 2 1 tion Method Z and can be computed numerically. An explicit for-  2.1 Inverse Polynomial Reconstruction mula for cm;n was derived by this author, Greene [11, 12], and is given for the cases n = 0 and n = 0 re- One numerical technique for dealing with the prob- spectively by: 6 lem of the Gibbs phenomenon is the inverse polyno- mial reconstruction method of Shizgal and Jung [13, [m=2] m 2j 14, 15, 16]. Their inverse method is itself an alter-  ( i) cm;n = Jm 2j+ 1 (n) (9) native approach to the original direct Gegenbauer re- p 2 j=0 2n construction method of Gottlieb and Shu [7, 9, 10]. X 1 3 In the inverse method, one solves a system of linear  2 j ()m j 2 m 2j equations for the Gegenbauer polynomial reconstruc- 3 1  j! 2 m j 2 m 2j tion coefcients in terms original Fourier coefcients, ( 1 ) () whose expansion suffers from the Gibbs phenomenon. 2 m=2 m= 2   3 ; m even The inverse polynomial reconstruction method begins c = j!( 2 ) (10) m;0 8 m=2 with a Fourier partial sum < 0; m odd. N The inverse polynomial: reconstruction procedure is inx SN f (x) = f (n) e : (5) obtained by truncating the innite series above and n= N solving the system of equations X b The function also has a Gegenbauer- expansion 2N given by f (n) = f  (m) c , n = N:::N: (11) m;n m=0 X 1   b b f (x) = f (m) Cm (x) One then computes the Gegenbauer reconstruction ap- m=0 X proximation b where 2N 1 S f (x) = f  (m) C (x) : (12)  1  2  1=2 2N m f (m) =  f (x) Cm (x) 1 x dx m=0 hm 1 X Z  (6) b andb 2.2 Inverse Wavelet Reconstruction (m + 2)  + 1 We explore here an analogous approach which seeks h = 1=2 2 : m m! (2) ()(m + ) to reconstruct the original function in terms of 

ISSN: 1790-5117 409 ISBN: 978-960-6766-47-3 AMERICAN CONFERENCE ON APPLIED MATHEMATICS (MATH '08), Harvard, Massachusetts, USA, March 24-26, 2008 wavelets. We begin with a Fourier partial sum as be- Alternatively, one may solve the system

fore and assume that the function f (x) can also be M L expressed as a discrete wavelet series: f (n) = cm;l m;l (n) (17) m= M l= L 1 1 X X f (x) = cm;l m;l (x) where b b m= l= X1 X1 n = N:::N; and N = 2ML + M + L: (18) where 1 and then compute cm;l = f (x) m;l (x)dx M L Z1 and SM;Lf (x) = cm;l m;l (x) : (19) m=2 m (x) = 2 (2 x l) : m= M l= L m;l X X We now derive a formula expressing the Fourier coef- The condition in (18) is due to the fact that we cients in terms of wavelet coefcients. are solving a system of 2N + 1 equations in (2M + 1) (2L + 1) unknown wavelet coefcients. In 1 1 inx order for the system to be invertible we must have f (n) = f (x) e dx 2 1 2N +1 = (2M + 1) (2L + 1) or N = 2ML+M +L: Z 1 A detailed proof of convergence is the subject of con- b 1 1 1 = c (x) e inxdx current work. However, we illustrate the apparent 2 m;l m;l Z 1 m= l= convergence for certain wavelets with some numeri- X1 X1 1 cal examples. 1 1 1 = c (x) e inxdx m;l 2 m;l m= l=  Z 1  X1 X1 3 Numerical Results 1 1 = c (n) (13) m;l m;l Numerical experiments show that the inverse wavelet m= l= X1 X1 reconstruction approach does yield accurate and uni- b The inverse wavelet reconstruction method is ob- form approximations for a variety of wavelet families. tained by truncating the doubly innite sum described We illustrate this with three wavelet families: Poisson above and solving for the wavelet coefcients. We wavelets given by suggest solving the following system of equations. 1 (x) = 2 ; (20) M 1 L 1  (1 + x ) f (n) = cm;l m;l (n) (14) Mexican hat wavelets given by m= M l= L X X 2 2 x2=2 b b (x) = 1 x e ; (21) where p31=4 and Morlet wavelets given by  n = N:::N 1; and N = 2ML (15) 1 2 (x) = cos x e x =2: (22) for the wavelet coefcients cm;l: One then computes 2 the wavelet reconstruction approximation   For each case we begin with a of 2N = M 1 L 1 16; 36; 64; 100 expansion coefcients of an analytic 1 SM;Lf (x) = cm;l m;l (x) : (16) non-periodic test function f(x) = 4 tan (x) whose m= M l= L partial sum suffers from the Gibbs phenomenon. We X X then compute the corresponding wavelet series recon- The terms m;l (n) are the nth Fourier coefcients of structions. We chose the number of Fourier coef- m;l (x) : Since we are solving a system of 2N equa- cients such that N = 2ML and M = L: The absolute tions in (2Mb ) (2L) = 4ML unknown wavelet coef- error of these reconstructions, f(x) SM;Lf (x) , cients, in order for the system to be invertible we must are displayed in the gures provided.j For the threej have 2N = 4ML or N = 2ML: It is this conven- wavelets shown the Morlets perform the best for a tion which we will use for our numerical implemen- xed number of Fourier coefcients, the Mexican tation below, owing to the simplicity of the relation hat wavelets perform comparably, though slightly less N = 2ML: well, and the Poisson wavelets perform the least well.

ISSN: 1790-5117 410 ISBN: 978-960-6766-47-3 AMERICAN CONFERENCE ON APPLIED MATHEMATICS (MATH '08), Harvard, Massachusetts, USA, March 24-26, 2008

Figure 3: The absolute error of a Poisson wavelet re- construction based on 16, 36, 64, and 100 Fourier co- Figure 1: The graphs illustrate the Gibbs phenomenon efcients. for a 16 term Fourier partial sum. The 16 Fourier coefcients are used to reconstruct a 16 term Morlet wavelet series accurate to four decimal places.

Figure 4: The absolute error of a Mexican hat wavelet Figure 2: The absolute error of a Morlet wavelet re- reconstruction based on 16, 36, 64, and 100 Fourier construction based on 16, 36, 64, and 100 Fourier co- coefcients. efcients.

ISSN: 1790-5117 411 ISBN: 978-960-6766-47-3 AMERICAN CONFERENCE ON APPLIED MATHEMATICS (MATH '08), Harvard, Massachusetts, USA, March 24-26, 2008 4 Conclusions [9] D. Gottlieb and C.-W. Shu, On the Gibbs Phe- nomenon and its Resolution, SIAM Rev., Vol. 39, The numerical results indicate that the inverse wavelet 1997, pp. 644-668. reconstruction method yields an accurate and uni- [10] D. Gottlieb and C.-W. Shu, A General Theory formly converging reconstruction approximation for for the Resolution of the Gibbs Phenomenon, a variety of wavelets. Current work underway in- in: Tricomi's Ideas and Contemporary Applied cludes a study of the technique for a broader spec- Mathematics, National Italian Academy of Sci- trum of wavelets, reconstruction from series other ence, 1997. than Fourier series, such as orthogonal polynomials or [11] N. Greene, On the Recovery of Piecewise wavelets, comparison with other methods, an analytic Smooth Functions from their Integral Trans- estimation of error and proof of convergence. forms and Spectral Data, Ph.D. Dissertation, SUNY Stony Brook, 2004. Acknowledgements: This research was supported in part by a PSC-CUNY Research Award (grant No. [12] N. Greene, Fourier Series of Orthogonal Poly- 60106-35 36). nomials, in: Proceedings of the American Con- ference on Applied Mathematics, Cambridge, Massachusetts, USA, March 24-26, 2008. References [13] J.-H. Jung, and B. D. Shizgal, Generalization of the Inverse Polynomial Reconstruction Method [1] C. K. Chui, An Introduction to Wavelets, Acad- in the Resolution of the Gibbs Phenomenon, J. emic Press, San Diego, 1992. Comp. Appl. Math., v. 172, n.1, 2004, pp.131- 151. [2] T. A. Driscoll, and B. Fornberg, A Pade-based [14] J.-H. Jung, and B. D. Shizgal, Inverse polyno- Algorithm for Overcoming the Gibbs Phenom- mial reconstruction of two dimensional Fourier enon, Numerical Algorithms, 26, 2001, pp. 77- images, J. Scientic Computing, v.25, n.3, 2005, 92. pp. 367-399. [3] A. Gelb, and E. Tadmor, Detection of Edges in [15] B. D. Shizgal and J.-H. Jung, Towards the reso- Spectral Data, Appl. Comp. Harmonic Anal., 7, lution of the Gibbs Phenomena, J. Comput. Appl. 1999, pp. 101-135. Math., 16, 2003, pp. 41-65. [4] A. Gelb, and E. Tadmor, Detection of Edges in [16] R. Pasquetti, On Inverse methods for the Resolu- Spectral Data II. Nonlinear Enhancement, SIAM tion of the Gibbs Phenomenon, Journal of Com- J. Numer. Anal., Vol. 38, No. 4, 2000, pp. 1389- putational and Applied Mathematics, Vol. 170, 1408. no. 2, 2004, pp. 305-315. [5] A. Gelb, and E. Tadmor, Spectral Reconstruc- [17] E. Tadmor and J. Tanner, Adaptive Molliers - tion of Piecewise Smooth Functions from their High Resolution Recovery of Piecewise Smooth Discrete Data, Mathematical Modeling and Nu- Data from its Spectral Information, J. Founda- merical Analysis, 36:2, 2002, pp. 155-175. tions of Comp. Math. 2, 2002, 155-189. [6] A. Gelb, and J. Tanner, Robust Reprojection [18] E. Tadmor and J. Tanner, Adaptive Filters for Methods for the Resolution of the Gibbs Phe- Piecewise Smooth Spectral Data, IMA J. Numer- nomenon., Applied Computational and Har- ical Anal., Vol. 25, 4, 2005, pp. 635-647. monic Analysis, Vol. 20, 1, 2006, pp. 3-25. [7] D. Gottlieb, C.-W. Shu, A. Solomonoff, and H. Vandeven, On the Gibbs's Phenomenon I: Re- covering Exponential Accuracy from the Fourier Partial Sum of a Nonperiodic Analytic Function, J. Comput. Appl. Math., 43, 1992, pp. 81-92 . [8] D. Gottlieb, and E. Tadmor, Recovering Point- wise Values of Discontinuous Data within Spec- tral Accuracy, in: Progress and Supercomputing in Computational Fluid Dynamics, Proceedings of a 1984 U.S.-Israel Workshop, Progress in Sci- entic Computing, Vol. 6 (E. M. Murman and S. S. Abarbanel eds.), Birkhauer, Boston, 1985, pp. 357-375.

ISSN: 1790-5117 412 ISBN: 978-960-6766-47-3