SpharmonicKit

SpharmonicKit is a collection of routines, written in C, which implement discrete Legendre and spherical harmonic transforms by a number of different algorithms. For certain algorithms, code for the inverse transform is also provided. Included as well are routines for spherical convolutions.

The Legendre transforms in the Kit require that a function of bandwidth B be sampled on the 2B-many Chebyshev points and not the B-many Gaussian points. Therefore, the number of samples needed is twice the function's bandwidth. This implies that for the spherical transforms in the Kit, a function of bandwidth B is sampled on the equiangular 2Bx2B grid on the sphere.

Some of the algorithms implemented in this package are based on the work of Driscoll and Healy. A preprint that offers a detailed development and description of the algorithms implemented in SpharmonicKit is here.

Caveat emptor - this is research code only and has not been hardened. All the code works quite well on DEC Alpha workstations using OSF1 Versions 3.2 and 4.0. Some code has also been tested and successfully run on Pentium-based GNU/Linux workstations, SGI workstations using IRIX 5.3 and IRIX 6.4, Sun workstations using SunOS 4.1.2 1, an HP Exemplar X-Class running SPP-UX 5.2.1, and even a NeXTstation Color Turbo running NeXTStep 3.3!

We would also like to mention that there exists other software for performing spherical transforms. Details on other possibilities may be found here.

What's New Preprints Source Code Other Possibilities

What's New

(updated 23 Apr 2008)

Bug fix (23 Apr 2008) A user has recently identified a bug which exists in a source file found in the SpharmonicKit 2.7, S2kit 1.0 and SOFT 2.0 distributions. (I.e. Slight variations of this file are included in all three distributions.) Fortunately, the fix is an easy one. The bug's description and cure may be found in this document.

SOFT 2.0 released (16 Sept 2007) Yes, another shameless plug. SOFT 2.0, a collection of code for taking Fourier transforms of functions defined on SO(3), has been released and is available here. The major difference between this release and the v.1.0 is that the user, with the help of FFTW, is no longer restricted to doing transforms at powers-of-2 bandwidths.

Version 1.0 of S2kit released (20 Feb 2004) S2kit is a lite version of SpharmonicKit. (Hence the shorter name.) It is a collection of routines, written in C, which implement discrete Legendre and spherical harmonic transforms. In addition to code being cleaned up, S2kit is lite mainly for two reasons.

Firstly, it uses only two types of discrete Legendre transform (DLT) algorithms: the naive and semi-naive algorithms. These algorithms are described in the preprint below, as well as this document which is included with the S2kit distribution.

Secondly, S2kit absolutely requires version 3 of FFTW. The routines in FFTW are more efficient than our home-grown code, and, perhaps more importantly, the user is no longer restricted to doing transforms at powers-of-2 bandwidths (which is the case with SpharmonicKit).

Version 2.7 released (19 Feb 2004) Bug fix - Thanks to feedback from a user, another (and hopefully last) scaling error was identified and fixed. This time, it was in a routine having to do with convolutions.

Details of the fix may be found in the CHANGES file which accompanies the distribution.

Version 1.0 of SOFT released (15 Nov 2003) Code for taking Fourier transforms of functions defined on SO(3), aka the Rotation Group, is available here. (Yes, this is a shameless plug.) Included within this distribution are examples of how the code may be used, e.g. correlating, and rotating, functions defined on the sphere.

Version 2.6 released (July 2003) Bug fix - Thanks to feedback from a user, an ancient scaling discrepancy has been identified and corrected. Internally, the normalizations are all consistent with one another and hence, as far as the code is concerned, correct.

Details of the fix may be found in the CHANGES file which accompanies the distribution.

Version 2.5 released Version 2 of SpharmonicKit has been updated and modified to allow use of a variation of FFTPACK, the freely available library of Fortran routines from NCAR. Use of this modified library is encouraged (though not required) because its FFT and DCT routines are noticeably more efficient than those which come with SpharmonicKit. If the user does not wish to use the modified FFTPACK, it should now be (easily) possible for the user to replace our FFT and DCT routines with their own optimized ones.

Further information concerning the modified FFTPACK, the modified software itself, and substituting other FFT and DCT routines, is available here.

Preprints Available

The following preprint offers a detailed development and description of the algorithms implemented in SpharmonicKit. Related to this work, the following describes Fourier transforms of tensor fields on the 2-sphere:

The Source Code

All things being equal, if all one wants to do is somehow perform forward and inverse spherical harmonic transforms, the typical user will probably find S2kit easier to use than SpharmonicKit. As implemented, the naive and semi-naive algorithms are straightforward and (we feel) relatively easy to understand. If one wishes to explore the nuances of the Driscoll-Healy based algorithms, then SpharmonicKit is obviously what one wants.

The naive and semi-naive DLT algorithms are both O(B^2), and the "classic" Driscoll-Healy algorithm is O(B\log^2 B). However, in terms of real time, i.e. looking at the clock on the wall, the naive and semi-naive algorithms may be faster. It depends on the problem size. There also appears to be dependence on architecture. Discussion of these issues, as well as timing results of these and modified Driscoll-Healy algorithms, may be found in the preprint.

SpharmonicKit SpharmonicKit is free software and is distributed under the terms of the GNU General Public License.

This is the README file from SpharmonicKit 2.7. The source code is available in the following formats:
  • .tgz (around 2.4 megs)
  • .zip (around 2.5 megs)

S2kit S2kit is free software and is distributed under the terms of the GNU General Public License.

This document explains the contents of S2kit 1.0. (It is also included within the distribution.) The source code is available in the following formats:
  • .tar.Z (around 1.1 megabytes)
  • .tar.gz (around 935 kilobytes)
  • .zip (around 960 kilobytes)
Don't forget that S2kit requires Version 3 of FFTW!

Important Note: You should not combine the contents of S2kit with SpharmonicKit in the same directory. While files may share the same name, their contents are almost assuredly different.

FFTPACK SpharmonicKit has been designed to allow use of a modified version of FFTPACK. The FFT and DCT routines in FFTPACK are more efficient than the ones contained in SpharmonicKit. Their use increases the overall efficiency of the Legendre and spherical transforms and is therefore encouraged. Easy substitution of our FFT and DCT routines with other, optimized versions that the user may have should also be possible.

Information regarding how FFTPACK has been modified for use in SpharmonicKit is available here.

Other Possibilities



There have been 62043 visitors since 18 Jun 2004. They mean you no harm. Visitor Map
(Visitors to our spherical page)

Return to Fast Fourier Analysis on Groups.


Last modified: 15 June 2008