Metadata-Version: 2.4
Name: flexft
Version: 0.1.0
Summary: Flexible-grid approximations to continuous Fourier transforms
Project-URL: Homepage, https://github.com/tomsturges/FlexFT
Project-URL: Repository, https://github.com/tomsturges/FlexFT
Project-URL: Issues, https://github.com/tomsturges/FlexFT/issues
Author-email: Thomas <thomas.sturges@kit.edu>
License-Expression: MIT
License-File: LICENSE
Keywords: bluestein,continuous-fourier-transform,fft,fourier-transform,jax
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Requires-Dist: jax>=0.4.28
Requires-Dist: numpy>=1.26
Provides-Extra: dev
Requires-Dist: ipykernel>=6.29; extra == 'dev'
Requires-Dist: ipython>=8.37.0; extra == 'dev'
Requires-Dist: ipywidgets>=8.1.8; extra == 'dev'
Requires-Dist: jupyter>=1.1.1; extra == 'dev'
Requires-Dist: jupyterlab>=4.5.6; extra == 'dev'
Requires-Dist: jupytext>=1.19.1; extra == 'dev'
Requires-Dist: matplotlib>=3.7; extra == 'dev'
Requires-Dist: nbstripout>=0.9.1; extra == 'dev'
Description-Content-Type: text/markdown

# FlexFT

FlexFT evaluates finite-sum approximations to continuous Fourier transforms on
uniform input and output grids whose spacings can be chosen independently. It
uses the Bailey--Swarztrauber fractional DFT/Bluestein convolution, implemented
with JAX FFTs.

For samples on

```text
x[n] = x0 + (n - floor(N / 2)) * dx
```

the forward transform returns approximations on

```text
k[m] = k0 + (m - floor(N / 2)) * dk.
```

## Installation

```bash
pip install flexft
```

## Quick start

```python
import jax.numpy as jnp
from flexft import flexft, iflexft

N = 256
dx = 0.05
dk = 0.02
x = (jnp.arange(N) - N // 2) * dx
f = jnp.exp(-(x**2))

F = flexft(f, dx=dx, dk=dk)
f_inverse_approximation = iflexft(F, dk=dk, dx=dx)
```

Omit `dk` in the forward transform to use the FFT-compatible spacing
`1 / (N * dx)`. Conversely, omit `dx` in the inverse transform to use
`1 / (N * dk)`.

For repeated transforms with unchanged grids, construct and reuse `FlexFT` or
`IFlexFT`; this reuses the precomputed convolution kernel.

See the documentation for the derivation, shifted grids, 2D transforms, and
more examples.
