A Python binding for the eFFT library
Project description
We introduce eFFT, an efficient method for the calculation of the exact Fourier transform of an asynchronous event stream. It is based on keeping the matrices involved in the Radix-2 FFT algorithm in a tree data structure and updating them with the new events, extensively reusing computations, and avoiding unnecessary calculations while preserving exactness. eFFT can operate event-by-event, requiring for each event only a partial recalculation of the tree since most of the stored data are reused. It can also operate with event packets, using the tree structure to detect and avoid unnecessary and repeated calculations when integrating the different events within each packet to further reduce the number of operations.
⚙️ Installation
eFFT is provided as a header-only file for easy integration and relies solely on C++ standard and Eigen3 libraries.
Note: FFTW3 served as the benchmark for testing and evaluation. To enable it, define
EFFT_USE_FFTW3during compilation (e.g.,-DEFFT_USE_FFTW3).
📦 Dependencies
For C++ usage, the following dependencies are required:
- C++ compiler with C++17
- CMake ≥ 3.20.0
- Eigen ≥ 3.4.0
- FFTW3 ≥ 3.3.8 (optional; see
EFFT_USE_FFTW3) - (dev-only) GTest, Google Benchmark
For Python usage, dependencies are defined in python/pyproject.toml and the build dependencies are fetchable via python/CMakeLists.txt.
🖥️ Usage
Here's a minimal working example:
eFFT<128> efft; // Instance
efft.initialize(); // Initialization
Stimulus e(1, 1, true); // Event insertion
efft.update(e); // Insert event
efft.getFFT(); // Get result as Eigen matrix
And another example handling event packets:
eFFT<128> efft; // Instance
efft.initialize(); // Initialization
Stimuli events;
events.emplace_back(1, 1, true); // Insert event
events.emplace_back(2, 2, true); // Insert event
events.emplace_back(3, 3, false); // Extract event
efft.update(events); // Insert event
efft.getFFT(); // Get result as Eigen matrix
Please refer to the official documentation for more details.
🐍 Python Bindings
The eFFT library also provides Python bindings for seamless integration into Python-based workflows. These bindings are built using nanobind and offer the same functionality as the C++ library. You can build and install the bindings using the following commands:
cd python
pip install .
However, you can also use PyPI to install the package directly:
pip install efft
Here's an example of how to use the Python bindings:
from efft import Stimulus, Stimuli, eFFT
efft = eFFT(128) # Create an eFFT instance with a frame size of 128
efft.initialize()
event = Stimulus(1, 1, True) # Insert a single event
efft.update(event)
fft_result = efft.get_fft() # Retrieve the FFT result
events = Stimuli() # Insert multiple events
events.append(Stimulus(2, 2, True))
events.append(Stimulus(3, 3, False))
efft.update(events)
fft_result = efft.get_fft() # Retrieve the updated FFT result
📜 Citation
If you use this work in an academic context, please cite the following publication:
R. Tapia, J.R. Martínez-de Dios, A. Ollero eFFT: An Event-based Method for the Efficient Computation of Exact Fourier Transforms, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024.
@article{tapia2024efft,
author={Tapia, R. and Martínez-de Dios, J.R. and Ollero, A.},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
title={{eFFT}: An Event-based Method for the Efficient Computation of Exact {Fourier} Transforms},
year={2024},
volume={46},
number={12},
pages={9630-9647},
doi={10.1109/TPAMI.2024.3422209}
}
📝 License
Distributed under the GPLv3 License. See LICENSE for more information.
📬 Contact
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file efft-1.0.4.tar.gz.
File metadata
- Download URL: efft-1.0.4.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2362b58964c123db877c4395fafd0dbd12aa037842e7d9619ccc3a8bed3f22f
|
|
| MD5 |
59a624796b629c6b337dfe6e00b8e923
|
|
| BLAKE2b-256 |
a13081abe0d5d00b21b1ae39bcf56e6a3e1f83443f9c79567e014e5f49fea434
|
Provenance
The following attestation bundles were made for efft-1.0.4.tar.gz:
Publisher:
cd.yaml on raultapia/efft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
efft-1.0.4.tar.gz -
Subject digest:
c2362b58964c123db877c4395fafd0dbd12aa037842e7d9619ccc3a8bed3f22f - Sigstore transparency entry: 940562462
- Sigstore integration time:
-
Permalink:
raultapia/efft@c1112ce84a8212de8faf8a0c2dbebdd8003844b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/raultapia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@c1112ce84a8212de8faf8a0c2dbebdd8003844b4 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file efft-1.0.4-cp314-cp314-macosx_15_0_arm64.whl.
File metadata
- Download URL: efft-1.0.4-cp314-cp314-macosx_15_0_arm64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.14, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
552ec304e747b386afd006247884ffaefba8f1e1320567894f7fa20be2feeeac
|
|
| MD5 |
e2fdb8894b46bbb2660c2a3f1c69c5c5
|
|
| BLAKE2b-256 |
624d485274bea9b0a23e04e0305e537d36fda2f00a46b68d9944125c73829675
|
Provenance
The following attestation bundles were made for efft-1.0.4-cp314-cp314-macosx_15_0_arm64.whl:
Publisher:
cd.yaml on raultapia/efft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
efft-1.0.4-cp314-cp314-macosx_15_0_arm64.whl -
Subject digest:
552ec304e747b386afd006247884ffaefba8f1e1320567894f7fa20be2feeeac - Sigstore transparency entry: 940562469
- Sigstore integration time:
-
Permalink:
raultapia/efft@c1112ce84a8212de8faf8a0c2dbebdd8003844b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/raultapia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@c1112ce84a8212de8faf8a0c2dbebdd8003844b4 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file efft-1.0.4-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: efft-1.0.4-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e260805276620e06ff7e0c2868c441b328b11dc19829efd6be47ed82ef2f3e7
|
|
| MD5 |
ec47632030bf6aa8aa5ab20396d06b21
|
|
| BLAKE2b-256 |
2995bdd73b3e7184523a48de16c390f1c2b2b5af19a4e3825430c22d4a24538d
|
Provenance
The following attestation bundles were made for efft-1.0.4-cp312-cp312-win_amd64.whl:
Publisher:
cd.yaml on raultapia/efft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
efft-1.0.4-cp312-cp312-win_amd64.whl -
Subject digest:
2e260805276620e06ff7e0c2868c441b328b11dc19829efd6be47ed82ef2f3e7 - Sigstore transparency entry: 940562468
- Sigstore integration time:
-
Permalink:
raultapia/efft@c1112ce84a8212de8faf8a0c2dbebdd8003844b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/raultapia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@c1112ce84a8212de8faf8a0c2dbebdd8003844b4 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file efft-1.0.4-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: efft-1.0.4-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eebf57dc792ea6bddd4e1e949d44482bc0702561673199c99f4b698602e5559
|
|
| MD5 |
64be066fceff4383b9815fef37def471
|
|
| BLAKE2b-256 |
f9f33e3ddcd423f227b49030b62bfc6d69f28fb51a8d87fc0ddcb914f9920750
|
Provenance
The following attestation bundles were made for efft-1.0.4-cp312-cp312-manylinux_2_34_x86_64.whl:
Publisher:
cd.yaml on raultapia/efft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
efft-1.0.4-cp312-cp312-manylinux_2_34_x86_64.whl -
Subject digest:
8eebf57dc792ea6bddd4e1e949d44482bc0702561673199c99f4b698602e5559 - Sigstore transparency entry: 940562465
- Sigstore integration time:
-
Permalink:
raultapia/efft@c1112ce84a8212de8faf8a0c2dbebdd8003844b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/raultapia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@c1112ce84a8212de8faf8a0c2dbebdd8003844b4 -
Trigger Event:
workflow_run
-
Statement type: