Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
raultapia committed Jun 29, 2024
0 parents commit 964bc0f
Show file tree
Hide file tree
Showing 9 changed files with 1,441 additions and 0 deletions.
Binary file added .github/assets/efft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Documentation

on:
push:
branches: [ main ]

jobs:
build-documentation:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Doxygen
uses: mattnotmitt/[email protected]
with:
doxyfile-path: ./Doxyfile
working-directory: .

- name: Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/html/
publish_branch: gh-pages
32 changes: 32 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test

on:
push:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Dependencies
run: |
sudo apt install libgtest-dev
sudo apt install libeigen3-dev
sudo apt install fftw3-dev
- name: Build
run: |
git clone https://github.com/raultapia/efft
mkdir -p efft/build
cd efft/build
cmake ..
make
- name: Test
run: |
cd efft/build
make test
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.20.0)
project(efft)

find_package(Eigen3 REQUIRED)

include(GoogleTest)
enable_testing()
add_executable(efft-unit-tests ${PROJECT_SOURCE_DIR}/tests/efft.cpp)
target_link_libraries(efft-unit-tests PRIVATE gtest gtest_main pthread)
target_link_libraries(efft-unit-tests PRIVATE fftw3)
target_include_directories(efft-unit-tests PRIVATE include)
target_compile_definitions(efft-unit-tests PRIVATE EIGEN_STACK_ALLOCATION_LIMIT=0)
target_compile_definitions(efft-unit-tests PRIVATE EFFT_USE_FFTW3)
gtest_discover_tests(efft-unit-tests)
8 changes: 8 additions & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
PROJECT_NAME = eFFT
PROJECT_BRIEF = "An efficient method for the calculation of the exact Fourier transform of an asynchronous event stream"
USE_MDFILE_AS_MAINPAGE = ./README.md
DOXYGEN_EXCLUDE_PATTERNS = */tests/*
GENERATE_HTML = YES
USE_MATHJAX = YES
RECURSIVE = YES
OUTPUT_DIRECTORY = ./docs/
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<div align="center" style="margin-bottom: 10px;">
<a href="https://github.com/raultapia/efft">
<img width="500" src="https://github.com/raultapia/efft/blob/main/.github/assets/efft.png?raw=true" alt="efft">
</a>
</div>
<p align="justify" class="brief">
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.
</p>

## ⚙️ Installation
eFFT is provided as a header-only file for easy integration and relies solely on C++ standard and [Eigen3](https://eigen.tuxfamily.org/) libraries.

> [!NOTE]
> [FFTW3](https://fftw.org/) served as the benchmark for testing and evaluation. To enable it, define `EFFT_USE_FFTW3` during compilation (e.g., `-DEFFT_USE_FFTW3`).

## 🖥️ Usage
Here's a minimal working example:
```cpp
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:
```cpp
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](https://raultapia.github.io/efft/) for more details.

## 📜 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.
```bibtex
@article{tapia2022asap,
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}
}
```

## 📝 License

Distributed under the GPLv3 License. See [`LICENSE`](https://github.com/raultapia/efft/tree/main/LICENSE) for more information.

## 📬 Contact

[Raul Tapia](https://raultapia.com) - [email protected]
Loading

0 comments on commit 964bc0f

Please sign in to comment.