Skip to main content
Log in

On computation and use of Fourier coefficients for associated Legendre functions

  • Original Article
  • Published:
Journal of Geodesy Aims and scope Submit manuscript

Abstract

The computation of spherical harmonic series in very high resolution is known to be delicate in terms of performance and numerical stability. A major problem is to keep results inside a numerical range of the used data type during calculations as under-/overflow arises. Extended data types are currently not desirable since the arithmetic complexity will grow exponentially with higher resolution levels. If the associated Legendre functions are computed in the spectral domain, then regular grid transformations can be applied to be highly efficient and convenient for derived quantities as well. In this article, we compare three recursive computations of the associated Legendre functions as trigonometric series, thereby ensuring a defined numerical range for each constituent wave number, separately. The results to a high degree and order show the numerical strength of the proposed method. First, the evaluation of Fourier coefficients of the associated Legendre functions has been done with respect to the floating-point precision requirements. Secondly, the numerical accuracy in the cases of standard double and long double precision arithmetic is demonstrated. Following Bessel’s inequality the obtained accuracy estimates of the Fourier coefficients are directly transferable to the associated Legendre functions themselves and to derived functionals as well. Therefore, they can provide an essential insight to modern geodetic applications that depend on efficient spherical harmonic analysis and synthesis beyond [\(5~\times ~5\)] arcmin resolution.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7

Similar content being viewed by others

References

  • Cheong HB, Park JR, Kang HG (2012) Fourier-series representation and projection of spherical harmonic functions. J Geod 86:975–990

    Article  Google Scholar 

  • Claessens SJ (2005) New relations among associated legendre functions and spherical harmonics. J Geod 79:398–406

    Article  Google Scholar 

  • Dilts G (1985) Computation of spherical harmonic expansion coefficients via FFT’s. J Comput Phys 57:439–453

    Article  Google Scholar 

  • Elovitz M (1989) A test of a modified algorithm for computing spherical harmonic coefficients using an FFT. J Comput Phys 80:506–511

    Article  Google Scholar 

  • Fukushima T (2012) Numerical computation of spherical harmonics of arbitrary degree and order by extending exponent of floating point numbers. J Geod 86:271–285

    Article  Google Scholar 

  • Gruber C (2011) A study on the Fourier composition of the associated Legendre functions; suitable for applications in ultra-high resolution, (Scientific Techncial Report STR; 11/04). Deutsches GeoForschungsZentrum (GFZ)

  • Gruber C, Novák P, Sebera J (2011) FFT-based high-performance spherical harmonic transformation. Stud Geophys Geod 55:489–500

    Article  Google Scholar 

  • Heiskanen WA, Moritz H (1967) Physical & geodesy. W.H. Freeman Company, San Francisco

    Google Scholar 

  • Hobson EW (1955) The theory of spherical and ellipsoidal harmonics. Chelsea Publishing Company, New York

    Google Scholar 

  • Hofsommer DJ, Potters ML (1960) Table of fourier coefficients of associated legendre functions, report R 478. KNAW, Computational Department of the Mathematical Centre, Amsterdam

    Google Scholar 

  • Holmes SA, Featherstone WE (2002) A unified approach to the clenshaw summation and the recursive computation of very high degree and order normalised associated legendre functions. J Geod 76:279–299

  • Jekeli C, Lee JK, Kwon JH (2008) On the computation and approximation of ultra-high-degree spherical harmonic series. J Geod 81:603–615

    Article  Google Scholar 

  • Kaula WM (1966) Theory of satellite geodesy. Blaisdell Pub. Co., Waltham

    Google Scholar 

  • Koop R, Stelpstra D (1989) On the computation of the gravitational potential and its first and second order derivatives. Manuscripta Geodaetica 14:373–382

    Google Scholar 

  • Sneeuw N, Bun R (1996) Global spherical harmonic computation by two-dimensional fourier methods. J Geod 70:224–232

    Article  Google Scholar 

  • Sansone G (1959) Orthogonal functions. Reprint: Dover Publications Inc, 31 East 2nd Street, Mineola, NY11501. Orig. published: Interscience (pure and applied mathematics: vol. 9)

  • Wagner CA (1983) Direct determination of gravitational harmonics from low–low GRAVSAT Data. J Geophys Res 88(B12):309–321

Download references

Acknowledgments

The authors have obtained valuable hints from Prof. Nico Sneeuw, Universität Stuttgart that have helped to improve the manuscript substantially. The software comparison was conducted with minor modifications concerning under-/overflow to software written by Nico Sneeuw at IAPG, TU-Munich 1994.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Christian Gruber.

Appendices

Appendix 1

To demonstrate how the Fourier coefficient round-off errors will infiltrate the functional domain, we consider Bessel’s inequality. Following Sansone (1991), we can use the theorem:

“Let {\(f_k\)} be a sequence of orthonormal functions in \(\sigma \), F square integrable in \(\sigma \)  and {\(a_{k}\)} the sequence of Fourier coefficients with respect to {\(f_k\)},

$$\begin{aligned} a_k = \int _\sigma F f_k~\mathrm{d}\sigma , \quad (k = 1,2,\ldots ), \end{aligned}$$
(33)

then the series

$$\begin{aligned} \sum \limits _{k=0}^\infty a_k^2 \end{aligned}$$
(34)

is convergent, and, moreover, the \(a_k\) will satisfy Bessel’s inequality:

$$\begin{aligned} \sum \limits _{k=0}^\infty a_k^2 \ \leqq \int _\sigma F^2~\mathrm{d}\sigma .\text {''} \end{aligned}$$
(35)

Concerning the round-off errors \(\epsilon \) of our coefficients, we put:

$$\begin{aligned} b_k= & {} a_k +~\epsilon _k, \end{aligned}$$
(36)

and for the square residuals of the finite series

$$\begin{aligned} \phi = \int _\sigma \! \left[ P_{lm} -\! \sum \limits _{k=0}^N b_k~f_k \right] ^2\!\!\!\!\mathrm{d}\sigma . \end{aligned}$$
(37)

Note that \(\sigma \in [0;2\pi ],\) although the Legendre functions \(P_{lm}\) are known to be square integrable (i.e., they form another orthonormal system) only in \([0; \pi ]\). However, we need only a well-defined subset of the sequence of orthonormal functions \(f_k' \subset f_k\), where the Fourier integrals may be used to obtain the appropriate coefficients \(a_{lmk}\). These are (Eq. 1):

$$\begin{aligned} f_k' = \left\{ \begin{array}{llll} \cos k\, \vartheta &{} \quad (m- \text {even},&{}~l,k - &{}\text {even}),\\ \sin k\, \vartheta &{} \quad (m- \text {odd},&{}~l,k - &{}\text {even}),\\ \cos k\, \vartheta &{} \quad (m- \text {even},&{}~l,k - &{}\text {odd}),\\ \sin k\, \vartheta &{} \quad (m- \text {odd},&{}~l,k - &{}\text {odd}). \end{array} \right. \end{aligned}$$
(38)

In all other cases, \(\int \limits _0^{2\pi } P_{lm}~f_k~\mathrm{d}\sigma \) are not guaranteed to be solved correctly. We then continue for the subset \(f_k'\) and obtain

$$\begin{aligned} \phi&= \int _\sigma P_{lm}^2~\mathrm{d}\sigma + \sum _{k=0}^N b_k^2 \int _\sigma f^{'2}_k\nonumber \\&\quad + 2\sum _{k\ne n} b_k~b_n \int _\sigma f'_k~f'_n~\mathrm{d}\sigma - 2\sum _{k=0}^N b_k \int _\sigma P_{lm}~f'_k~\mathrm{d}\sigma \nonumber \\&= \int _\sigma P_{lm}^2~\mathrm{d}\sigma + \sum \limits _{k=0}^N b^2_k -2\sum _{k=0}^N b_k~ a_k \nonumber \\&= \int _\sigma P_{lm}^2~\mathrm{d}\sigma + \sum \limits _{k=0}^N (a^2_k+ 2 a_k~\epsilon _k + \epsilon ^2_k) \nonumber \\&\quad - 2\sum \limits _{k=0}^N (a^2_k+ a_k~\epsilon _k) \nonumber \\&= \int _\sigma P_{lm}^2~\mathrm{d}\sigma - \sum \limits _{k=0}^N a^2_k + \sum \limits _{k=0}^N\epsilon ^2_k, \end{aligned}$$
(39)

where

$$\begin{aligned} \int _\sigma f_k f_n~\mathrm{d}\sigma = 0,\quad k \ne n; \quad \int _\sigma f^2_k~\mathrm{d}\sigma = 1. \end{aligned}$$
(40)

Because the error-free solution is defined by

$$\begin{aligned} \int _\sigma \left[ P_{lm} - \sum \limits _{k=0}^N a_k~f_k' \right] ^2 \mathrm{d}\sigma \equiv 0, \end{aligned}$$
(41)

we obtain for the square residuals

$$\begin{aligned} \phi = \sum \limits _{k=0}^N\epsilon ^2_k, \end{aligned}$$
(42)

which corresponds to what we have been investigating throughout Eqs. (2427) and also in Eq. (28) and can thus be considered as corresponding deviation in the functional domain.

Appendix 2

The dynamical scaling works as follows: the sectorial Legendre function \((l=m)\) serves as starting value and is subject to numerical underflow such that extended exponent values have to be stored. In the course of the recursive computations of the respective degrees, the external exponents are then partially re-applied before overflow values occur until the scales have fully dissolved.

$$\begin{aligned}&\mathrm {\% { S}_c\ vector\ of\ external\ scales\ with \ dimension:}\ \theta \\&\mathrm {\% \ { p}\ \ vector\ of\ Legendre \ Functions} \nonumber \end{aligned}$$
$$\begin{aligned} \begin{array}{llll} &{} p &{} = \ \mathrm {init\ } &{} \mathrm {\% factorials} \\ \mathrm {for} &{} i &{}= \ 1\ :\ m \\ &{} p &{} = \ p \cdot \sin \theta \\ &{} ip &{} = \ \mathrm {find}(\log | p | < -700) &{} \mathrm { \%underflow?}\\ &{} \mathrm {if} &{} \mathrm {not\ empty (ip)} &{} \\ &{} \quad s_{c} &{} = \ \mathrm {round}( \log |p(ip)| ) &{} \mathrm {\% extract\ exponent} \\ &{} \quad p(ip) &{} = \ p(ip) \cdot 2^{-s_{c}} &{} \mathrm {\% and\ apply\ scaling} \\ &{} \quad S_c(ip) &{} = \ S_c(ip) + s_{c} &{} \mathrm {\% update \ scale} \\ &{} \mathrm {end\ if} &{}&{}\\ \mathrm {end} &{}&{}&{} \end{array} \end{aligned}$$

During l-recursion, the Legendre functions are then re-scaled in the following way:

$$\begin{aligned} \begin{array}{llll} \mathrm {for} &{} l &{}= m+1: \mathrm {lmax} &{} \nonumber \\ &{} p &{} = func(p_{-1}, p_{-2}) &{} \%l-\mathrm {recursion}\\ &{} p_{-2} &{}= p_{-1} &{}\\ &{} p_{-1} &{}= p &{}\\ &{} ip &{}= \mathrm {find}(\log |p| > 700) &{} \mathrm {\% overflow?} \\ &{} \mathrm {if} &{} \mathrm {not \ empty (ip)} &{}\\ &{} \quad s_c &{}= \max ( -700, S_c(ip) ) &{} \mathrm {\%partial \ scale}\\ &{} \quad p_{-1}(ip) &{} = p_{-1}(ip) \cdot 2^{s_c} &{} \mathrm {\% dissolve \ scaling}\\ &{} \quad p_{-2}(ip) &{} = p_{-2}(ip) \cdot 2^{s_c} &{} \\ &{} \quad S_c(ip)&{} = S_c(ip) - s_c &{} \mathrm {\% update \ scale}\\ &{} \mathrm {end\ if} &{}&{}\\ &{}p &{}= p_{-1} \cdot 2^{S_c} &{} \mathrm {\%final\ re-scale}\\ \mathrm {endif}. \end{array} \end{aligned}$$

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Gruber, C., Abrykosov, O. On computation and use of Fourier coefficients for associated Legendre functions. J Geod 90, 525–535 (2016). https://doi.org/10.1007/s00190-016-0891-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00190-016-0891-z

Keywords

Navigation