Skip to main content

Flexible-grid approximations to continuous Fourier transforms

Project description

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

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

the forward transform returns approximations on

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

Installation

pip install flexft

Quick start

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flexft-0.1.0.tar.gz (185.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flexft-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file flexft-0.1.0.tar.gz.

File metadata

  • Download URL: flexft-0.1.0.tar.gz
  • Upload date:
  • Size: 185.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flexft-0.1.0.tar.gz
Algorithm Hash digest
SHA256 783e6ae15c3758ae79303d6ac6bac02d93354c5bc861b82a2465eb894fee1cab
MD5 fad612241c5b0d36c3650ca31b49fc50
BLAKE2b-256 094a8a44e2f1a44d920a89cd9f10c70b753da3af3810b9ac3ea006b3db9885aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for flexft-0.1.0.tar.gz:

Publisher: publish.yml on tomsturges/FlexFT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flexft-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: flexft-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flexft-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 442dde9eb599b8aa320ccb490e1db5f89890adfc1339b1fd0da98e21f7a18596
MD5 ab941158b31dcb9ea7a56caa5c2d6963
BLAKE2b-256 211fc63b57b22265269d327d22f79ca65c04b25a581665ab64cc76aec2ff5a9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for flexft-0.1.0-py3-none-any.whl:

Publisher: publish.yml on tomsturges/FlexFT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page