🌐 Website · 📚 Documentation ·
A pure-Go (no cgo) FFT library, the numpy.fft / scipy.fft equivalent for
Go. Complex and real transforms of any length, N-D transforms, numpy's
n/norm/axes, the DCT and DST, single precision, windows and frequency
helpers, with no dependency on the FFTW3 C library.
It runs on the six 64-bit Go targets (amd64, arm64, riscv64, loong64, ppc64le,
s390x). The passes of its Stockham engine run as AVX2 and AVX-512 kernels on
amd64 and NEON kernels on arm64, generated by
go-asmgen and bit-identical to the Go code they
replace. Since v0.28.0, Options{FMA: true} opts into fused multiply-add
kernels on amd64: as accurate, not bit-identical, and up to 1.22× faster.
| Repo | What it is |
|---|---|
| fft | the library: go get github.com/go-fft/fft@latest (v0.28.x, Go 1.27.1 or later; use v0.26.3 or later, see below) |
| docs | the documentation site (Hugo + Relearn), served at /docs/ |
| go-fft.github.io | the landing page (Hugo) |
| brand | logo, icons and social images |
Use v0.26.3 or later. v0.25.0 to v0.26.2 return wrong N-D results, silently, on Intel CPUs with AVX-512 when an axis other than the last has a length 9·p (v0.26.3 release notes).
Measured against FFTW, numpy and scipy on three GCC Compile Farm hosts (Zen 3,
Neoverse-N1, Cascade Lake), with every transform first checked against
numpy.fft. At v0.27.0, go-fft is faster than FFTW on all 24 rows on
Neoverse-N1, within 5% of it or faster on 18 on Zen 3 (faster on 17) and on 15
on Cascade Lake (faster on 14, every 2-D row among them), and at or above numpy.fft and scipy.fft on all 24 rows on every host. With the
opt-in FMA plans (v0.28.0), complex 1,024 on Cascade Lake runs at 0.94× FFTW's
time (1.19× by default). The tables, raw runs and the dated optimization rounds, including
what was tried and dropped, are in
BENCHMARKS.md and on the
performance page.
Report a vulnerability privately, through the library's security advisories. SECURITY.md says what counts and lists the audits.
