A high-performance FFT library for Go, ported from RustFFT.
Status: v0.5.0 - 100% Algorithm Parity Achieved!
- 100% scalar algorithm parity with RustFFT (NEW in v0.5.0!)
- RadixN algorithm for multi-factor composites (NEW in v0.5.0!)
- Rader's algorithm for optimized primes
- ANY size is O(n log n) via Bluestein's
- 28 total algorithms (20 butterflies + Radix-4 + RadixN + Rader's + more)
- Zero allocations with scratch buffer reuse
- Thread-safe - concurrent usage supported
- SIMD support (future enhancement for 2-8x speedup)
package main
import (
"github.com/10d9e/gofft"
)
func main() {
// Create a planner
planner := gofft.NewPlanner()
// Plan a forward FFT of size 1024
fft := planner.PlanForward(1024)
// Create and process data
buffer := make([]complex128, 1024)
// ... fill buffer with data ...
fft.Process(buffer)
}v0.5.0: 100% ALGORITHM PARITY!
- RadixN: Optimizes multi-factor composites (60, 120, 84, ...)
- Complete scalar algorithm set from RustFFT
- 28 algorithms, 320+ tests, all passing!
v0.4.0: Rader's algorithm for primes
v0.3.2: Bluestein's for ANY size
Pure Go (no SIMD) on Apple M3 Pro:
- Size 1024: 12 μs (0 allocs)
- Size 4096: 59 μs (0 allocs)
- Prime 1009: O(n log n) via Bluestein's ✨
- Size 1000: O(n log n) via Bluestein's ✨
2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, ...
2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 16, 17, 19, 23, 24, 27, 29, 31, 32
6, 10, 12, 14, 15, 18, 20, 21, 24, 28, 30, 36, 40, 42, 48, 54, 56, 60, 72, 80, 84, 90, 96, 100, 120, ...
All primes from 3 to 97 use Rader's algorithm
Large primes, sizes with prime factors >7 - ALL O(n log n)!
# Build
go build ./...
# Run tests (all passing!)
go test -v
# Run benchmarks
go test -bench=. -benchmem
# Try the examples
go run cmd/example/main.go- 100% ALGORITHM PARITY - Complete RustFFT scalar port!
- RadixN Algorithm: Multi-factor decomposition for composites
- 320+ tests passing (up from 256)
- 28 algorithms implemented
- Optimized for ALL size categories
- V0.5.0_100PERCENT_COMPLETE.md - 100% parity milestone! 🏆
- V0.4.0_RELEASE_NOTES.md - v0.4.0 release notes
- API_REFERENCE.md - Detailed API documentation
100% SCALAR ALGORITHM PARITY with RustFFT!
O(n log n) for ALL sizes
320+ tests passing (100% success rate)
28 algorithms - complete scalar algorithm set