Welcome to SpharaPy

What is SpharaPy?

SpharaPy is a Python implementation of the new approach for spatial harmonic analysis (SPHARA) that extends the classical spatial Fourier analysis to non-uniformly positioned samples on an arbitrary surface in \(\mathbb{R}^3\), see also [Graichen et al., 2015]. The basis functions used by SPHARA are determined by eigenanalysis of the discrete Laplace–Beltrami operator defined on a triangular mesh specified by the spatial sampling points. The Python toolbox SpharaPy provides classes and functions to determine the SPHARA basis functions, to perform data analysis and synthesis (SPHARA transform) as well as classes to design spatial filters using the SPHARA basis.

Besides the computation of SPHARA bases and SPHARA transforms, SpharaPy also provides tools for the design and application of spatial filters in the SPHARA domain. The module spharapy.spectral_filters implements ideal, Gaussian and Butterworth transfer functions (low-pass, high-pass and band-pass) which can be combined with spharapy.spharafilter.SpharaFilter to build customized SPHARA-based spatial filters.

Besides the computation of SPHARA bases and SPHARA transforms, SpharaPy also provides tools for the design and application of spatial filters in the SPHARA domain. The module spharapy.spectral_filters implements ideal, Gaussian and Butterworth transfer functions (low-pass, high-pass and band-pass) which can be combined with spharapy.spharafilter.SpharaFilter to build customized SPHARA-based spatial filters.

Requirements and installation

Required packages:
  • numpy (>=1.23.5)

  • scipy (>=1.14)

  • matplotlib (>=3.6)

To install, simply use:

$ pip3 install spharapy

Examples and Usage

Minimal examples are contained in the source code of the package. For more detailed examples please have a look at the tutorials.

Citing SpharaPy

If you find this toolbox useful and if you publish results that were obtained using SpharaPy, it would be appreciated if you could cite the following publications:

  • Graichen, U., Eichardt, R., & Haueisen, J. (2019). SpharaPy: A Python toolbox for spatial harmonic analysis of non-uniformly sampled data. SoftwareX, 10, Article 100289. https://doi.org/10.1016/j.softx.2019.100289

  • Graichen, U., Eichardt, R., Fiedler, P., Strohmeier, D., Zanow, F., & Haueisen, J. (2015). SPHARA – A generalized spatial Fourier analysis for multi-sensor systems with non-uniformly arranged sensors: Application to EEG. PLOS ONE, 10 (4), e0121741. https://doi.org/10.1371/journal.pone.0121741