This is intended as a drop-in replacement for
- A modern C/C++ toolchain
- CMake >= 3.15
- Rust >= 1.62
muFFT is built with straight CMake. Use add_subdirectory
in your project.
muFFT uses the C99 and C++ ABI for complex numbers, interleaved real and imaginary samples, i.e.:
struct complex_float {
float real;
float imag;
};
C99 complex float
from <complex.h>
and C++ std::complex<float>
from
<complex>
can safely be used with muFFT.
The muFFT library is licensed under the permissive MIT license, see COPYING and preambles in source files for more detail.
Note that the muFFT-bench
and muFFT-test
binaries link against FFTW3 for
verification purposes, a GPLv2+ library. If you choose to distribute either of
these binaries, muFFT source must be provided as well. See COPYING.GPLv2 for
details. These binaries are non-essential, and are only intended for use during
development and verification, and not for distribution.
There is currently no dedicated sample code for muFFT. See test.c
, bench.c
and the documentation for reference on how to use the API. The various test and
benchmark routines flex most of the API. It it also a good way to see how the
API calls match up to equivalent FFTW3 routines.
All muFFT APIs have unit tests. muFFT output is verified against the FFTW library. The convolution API is verified against a straight O(N^2) convolution.
The FFTW3 library must be present on your system via pkg-config when building
this. Note that FFTW3 (as of writing) is licensed under GPLv2+. The
muFFT-test
binary falls under licensing requirements of GPLv2 as per FFTW
license.
muFFT can be benchmarked using FFTW as a reference.
Gflops values reported are based on the estimated number of flops consumed by a generic complex FFT, which is 5.0 * N * log2(N). Values reported should be taken with a grain of salt, but it gives a reasonable estimate for throughput. Average time consumed by a single FFT is reported as well.
To run the benchmark:
./muFFT-bench 1000000 64 # 1 million iterations of various N = 64 FFTs variants
./muFFT-bench 10000 64 64 # 10k iterations of 64-by-64 2D FFT
./muFFT-bench # Run various 1D and 2D benchmarks
The benchmark for 1D tests various things:
- Complex-to-complex transform
- Real-to-complex and Complex-to-real in one iteration (typical convolution scenario)
- Mono convolution, stereo convolution
The FFTW3 library must be present on your system via pkg-config when building
this. Note that FFTW3 (as of writing) is licensed under GPLv2+. The
muFFT-bench
binary falls under licensing requirements of GPLv2 as per FFTW3
license.