{"id":42051952,"url":"https://github.com/cool-japan/oxifft","last_synced_at":"2026-01-26T07:02:11.717Z","repository":{"id":332897618,"uuid":"1125259203","full_name":"cool-japan/oxifft","owner":"cool-japan","description":"OxiFFT is a 99% Rust port of FFTW3, the world's most respected FFT library. It brings FFTW's sophisticated algorithms, planning system, and performance optimizations to the Rust ecosystem while leveraging Rust's safety guarantees and modern language features.","archived":false,"fork":false,"pushed_at":"2026-01-16T04:45:05.000Z","size":297,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-16T19:50:03.807Z","etag":null,"topics":["fft","fftw","fftw3","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cool-japan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-30T12:09:58.000Z","updated_at":"2026-01-15T16:48:30.000Z","dependencies_parsed_at":"2026-01-16T20:01:39.012Z","dependency_job_id":null,"html_url":"https://github.com/cool-japan/oxifft","commit_stats":null,"previous_names":["cool-japan/oxifft"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cool-japan/oxifft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cool-japan%2Foxifft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cool-japan%2Foxifft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cool-japan%2Foxifft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cool-japan%2Foxifft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cool-japan","download_url":"https://codeload.github.com/cool-japan/oxifft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cool-japan%2Foxifft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28769212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T06:37:25.426Z","status":"ssl_error","status_checked_at":"2026-01-26T06:37:23.039Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fft","fftw","fftw3","rust","rust-lang"],"created_at":"2026-01-26T07:01:45.035Z","updated_at":"2026-01-26T07:02:11.699Z","avatar_url":"https://github.com/cool-japan.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OxiFFT\n\n[![Crates.io](https://img.shields.io/crates/v/oxifft.svg)](https://crates.io/crates/oxifft)\n[![Documentation](https://docs.rs/oxifft/badge.svg)](https://docs.rs/oxifft)\n[![License](https://img.shields.io/crates/l/oxifft.svg)](https://github.com/cool-japan/oxifft#license)\n[![Downloads](https://img.shields.io/crates/d/oxifft.svg)](https://crates.io/crates/oxifft)\n\n**Pure Rust implementation of FFTW (Fastest Fourier Transform in the West)**\n\nOxiFFT is a 99% Rust port of FFTW3, the world's most respected FFT library. It brings FFTW's sophisticated algorithms, planning system, and performance optimizations to the Rust ecosystem while leveraging Rust's safety guarantees and modern language features.\n\n## Features\n\n### Core FFT Functionality\n- **Pure Rust**: No C dependencies, no FFI, no bindgen (Pure Rust Policy compliant)\n- **Full Algorithm Support**: Cooley-Tukey, Rader, Bluestein, Direct O(n²)\n- **Transform Types**: Complex DFT, Real FFT (R2C/C2R), DCT/DST variants, DHT\n- **Multi-Dimensional**: 1D, 2D, 3D, and N-D transforms\n- **Batch Processing**: Efficient vector-rank handling for multiple transforms\n- **SIMD Optimization**: SSE2, AVX, AVX2, AVX-512, ARM NEON, ARM SVE, WebAssembly SIMD\n- **Threading**: Rayon integration for parallel execution\n- **Wisdom System**: Plan caching and persistence for repeated transforms\n- **Precision Support**: f16, f32, f64, and f128 floating-point types\n\n### Advanced Features (Beyond FFTW)\n- **Sparse FFT**: O(k log n) complexity for k-sparse signals using FFAST algorithm\n- **Pruned FFT**: Input/output pruning for partial computation, Goertzel algorithm\n- **Streaming FFT**: Short-Time Fourier Transform (STFT) with window functions\n- **Compile-time FFT**: Const FFT for fixed-size arrays (sizes 2-1024)\n- **Non-uniform FFT (NUFFT)**: Type 1/2/3 transforms with Gaussian gridding\n- **Fractional Fourier Transform (FrFT)**: Chirp decomposition for fractional orders\n- **Convolution**: FFT-based linear/circular convolution and correlation\n- **Automatic Differentiation**: Forward and backward mode gradients for FFT operations\n- **GPU Acceleration**: CUDA (NVIDIA) and Metal (Apple) backends\n- **MPI Distributed Computing**: 2D/3D/N-D distributed FFTs with slab decomposition\n- **WebAssembly**: Browser-compatible FFT with WASM SIMD support\n\n## Project Status\n\n✅ **Core FFT functionality is COMPLETE**\n✅ **357 unit tests + doc tests passing** (100% pass rate)\n✅ **Zero clippy warnings** (all features)\n✅ **Performance optimized** (9/15 composite sizes faster than RustFFT)\n\nSee [PROJECT_STATUS.md](./PROJECT_STATUS.md) for comprehensive status, [oxifft.md](./oxifft.md) for architecture blueprint, and [TODO.md](./TODO.md) for detailed roadmap.\n\n## Usage\n\n```rust\nuse oxifft::{Complex, Direction, Flags, Plan, Plan2D, RealPlan};\n\n// Simple 1D Complex FFT\nlet input: Vec\u003cComplex\u003cf64\u003e\u003e = vec![Complex::new(1.0, 0.0); 256];\nlet mut output: Vec\u003cComplex\u003cf64\u003e\u003e = vec![Complex::zero(); 256];\n\nlet plan = Plan::dft_1d(256, Direction::Forward, Flags::MEASURE).unwrap();\nplan.execute(\u0026input, \u0026mut output);\n\n// 2D Complex FFT\nlet plan_2d = Plan2D::new(64, 64, Direction::Forward, Flags::ESTIMATE).unwrap();\nlet input_2d = vec![Complex::zero(); 64 * 64];\nlet mut output_2d = vec![Complex::zero(); 64 * 64];\nplan_2d.execute(\u0026input_2d, \u0026mut output_2d);\n\n// Real-to-Complex FFT\nlet real_input: Vec\u003cf64\u003e = vec![0.0; 256];\nlet mut complex_output: Vec\u003cComplex\u003cf64\u003e\u003e = vec![Complex::zero(); 129]; // n/2 + 1\n\nlet plan_r2c = RealPlan::r2c_1d(256, Flags::MEASURE).unwrap();\nplan_r2c.execute_r2c(\u0026real_input, \u0026mut complex_output);\n```\n\n### Guru Interface (Maximum Flexibility)\n\n```rust\nuse oxifft::{Complex, IoDim, Tensor, GuruPlan, Direction, Flags};\n\n// Batch of 100 transforms, each 512-point\nlet dims = Tensor::new(vec![IoDim::contiguous(512)]);\nlet howmany = Tensor::new(vec![IoDim::new(100, 512, 512)]);\n\nlet plan = GuruPlan::dft(\u0026dims, \u0026howmany, Direction::Forward, Flags::MEASURE).unwrap();\n\nlet input = vec![Complex::zero(); 512 * 100];\nlet mut output = vec![Complex::zero(); 512 * 100];\nplan.execute(\u0026input, \u0026mut output);\n```\n\n### Wisdom Management\n\n```rust\nuse oxifft::wisdom;\n\n// Export/import wisdom\nwisdom::export_to_file(\"my_wisdom.txt\")?;\nwisdom::import_from_file(\"my_wisdom.txt\")?;\nwisdom::forget();\n```\n\n### Advanced Features Examples\n\n#### Sparse FFT (for k-sparse signals)\n```rust\nuse oxifft::{sparse_fft, SparsePlan};\n\n// Signal with only 10 non-zero frequency components\nlet signal = vec![Complex::new(1.0, 0.0); 1024];\nlet k = 10; // Expected sparsity\n\n// One-shot API: O(k log n) instead of O(n log n)\nlet result = sparse_fft(\u0026signal, k);\nfor (freq_idx, value) in result.indices.iter().zip(result.values.iter()) {\n    println!(\"Frequency {}: {:?}\", freq_idx, value);\n}\n\n// Plan-based API for repeated use\nlet plan = SparsePlan::new(1024, k, Flags::ESTIMATE).unwrap();\nlet result = plan.execute(\u0026signal);\n```\n\n#### Streaming FFT (STFT for real-time processing)\n```rust\nuse oxifft::{stft, istft, StreamingFft, WindowFunction};\n\n// Perform Short-Time Fourier Transform\nlet window_size = 512;\nlet hop_size = 256;\nlet spectrogram = stft(\u0026audio_signal, window_size, hop_size, WindowFunction::Hann);\n\n// Reconstruct signal from STFT\nlet reconstructed = istft(\u0026spectrogram, window_size, hop_size, WindowFunction::Hann);\n\n// Real-time streaming\nlet mut streaming_fft = StreamingFft::new(window_size, hop_size, WindowFunction::Hamming);\nfor frame in audio_chunks {\n    let spectrum = streaming_fft.process_frame(\u0026frame);\n    // Process spectrum in real-time\n}\n```\n\n#### Compile-time FFT (zero runtime overhead)\n```rust\nuse oxifft::{fft_fixed, ifft_fixed};\n\n// Fixed-size FFT computed at compile time\nlet input: [Complex\u003cf64\u003e; 8] = [Complex::new(1.0, 0.0); 8];\nlet output = fft_fixed(\u0026input);\nlet reconstructed = ifft_fixed(\u0026output);\n```\n\n#### Non-uniform FFT (NUFFT for irregularly spaced data)\n```rust\nuse oxifft::{nufft_type1, nufft_type2, Nufft, NufftType};\n\n// Type 1: Non-uniform to uniform (analysis)\nlet non_uniform_points = vec![0.1, 0.3, 0.7, 0.9]; // Irregular sampling\nlet values = vec![Complex::new(1.0, 0.0); 4];\nlet spectrum = nufft_type1(\u0026non_uniform_points, \u0026values, 16, 1e-6)?;\n\n// Type 2: Uniform to non-uniform (synthesis)\nlet uniform_spectrum = vec![Complex::new(1.0, 0.0); 16];\nlet interpolated = nufft_type2(\u0026non_uniform_points, \u0026uniform_spectrum, 1e-6)?;\n```\n\n#### Automatic Differentiation for FFT\n```rust\nuse oxifft::{grad_fft, vjp_fft, fft_jacobian};\n\n// Compute gradient of loss w.r.t. FFT input\nlet input = vec![Complex::new(1.0, 0.0); 256];\nlet grad_output = vec![Complex::new(0.1, 0.0); 256]; // Gradient from loss\nlet grad_input = grad_fft(\u0026grad_output, 256)?;\n\n// Vector-Jacobian product for backpropagation\nlet vjp = vjp_fft(\u0026input, \u0026grad_output)?;\n\n// Full Jacobian matrix (for analysis)\nlet jacobian = fft_jacobian(256)?;\n```\n\n#### WebAssembly (Browser)\n```bash\n# Build for web\nwasm-pack build oxifft --target web --features wasm\n```\n\n```javascript\nimport init, { WasmFft, fft_f64, ifft_f64 } from './oxifft';\n\nawait init();\n\n// Plan-based API (efficient for repeated use)\nconst fft = new WasmFft(256);\nconst real = new Float64Array([1, 2, 3, ...]);\nconst imag = new Float64Array([0, 0, 0, ...]);\nconst result = fft.forward(real, imag);  // [re0, im0, re1, im1, ...]\n\n// One-shot API\nconst output = fft_f64(real, imag);\n```\n\n#### GPU Acceleration\n```rust\nuse oxifft::gpu::{GpuFft, GpuBackend};\n\n// Auto-detect best available GPU backend (CUDA or Metal)\nlet gpu_fft = GpuFft::new(4096, GpuBackend::Auto)?;\n\nlet input = vec![Complex::new(1.0, 0.0); 4096];\nlet output = gpu_fft.forward(\u0026input)?;\nlet reconstructed = gpu_fft.inverse(\u0026output)?;\n```\n\n## Workspace Structure\n\n```\noxifft/\n├── src/                    # Main library source\n│   ├── api/               # Public user-facing API\n│   ├── kernel/            # Core planner \u0026 data structures (F16, F128 types)\n│   ├── dft/               # Complex DFT implementations\n│   ├── rdft/              # Real DFT implementations\n│   ├── reodft/            # DCT/DST (Real Even/Odd DFT)\n│   ├── simd/              # SIMD abstraction (SSE2, AVX, AVX2, AVX-512, NEON, SVE)\n│   ├── threading/         # Parallel execution (Rayon integration)\n│   ├── support/           # Utilities (alignment, transpose, copy)\n│   ├── sparse/            # Sparse FFT (FFAST algorithm)\n│   ├── pruned/            # Pruned FFT (input/output pruning, Goertzel)\n│   ├── streaming/         # STFT and window functions\n│   ├── const_fft/         # Compile-time FFT with const generics\n│   ├── nufft/             # Non-uniform FFT (Type 1/2/3)\n│   ├── frft/              # Fractional Fourier Transform\n│   ├── conv/              # FFT-based convolution and correlation\n│   ├── autodiff/          # Automatic differentiation for FFT\n│   ├── gpu/               # GPU acceleration (CUDA, Metal backends)\n│   ├── mpi/               # MPI distributed computing\n│   └── wasm/              # WebAssembly bindings and WASM SIMD\n├── oxifft-codegen/        # Proc-macro crate for codelet generation\n├── oxifft-bench/          # Benchmarks (including FFTW comparison)\n├── benches/               # Additional benchmarks (beyond_fftw.rs)\n├── examples/              # Usage examples\n└── tests/                 # Integration tests (629 tests passing)\n```\n\n## Architecture\n\nOxiFFT follows FFTW's proven design patterns:\n\n- **Problem-Plan-Solver Hierarchy**: Trait-based abstractions for maximum flexibility\n- **Wisdom System**: Cache optimal plans for repeated problem sizes\n- **Modular Solvers**: Easy to add new algorithms without breaking existing code\n- **Codelet Generation**: Proc-macros generate optimized kernels at compile-time\n\n### Core Traits\n\n```rust\npub trait Problem: Hash + Debug + Clone + Send + Sync { ... }\npub trait Plan: Send + Sync { ... }\npub trait Solver: Send + Sync { ... }\n```\n\n## Comparison with RustFFT\n\nOxiFFT provides many features beyond RustFFT:\n\n| Feature | OxiFFT | RustFFT |\n|---------|--------|---------|\n| **Basic FFT** | ✅ | ✅ |\n| **Real FFT (R2C/C2R)** | ✅ | ✅ |\n| **DCT/DST (8 types)** | ✅ | ❌ |\n| **2D/3D/N-D FFT** | ✅ | ❌ (manual) |\n| **Batch FFT** | ✅ | ❌ (loop) |\n| **Wisdom System** | ✅ | ❌ |\n| **WASM Support** | ✅ | ❌ |\n| **Sparse FFT** | ✅ O(k log n) | ❌ |\n| **Pruned FFT** | ✅ | ❌ |\n| **STFT/Streaming** | ✅ | ❌ |\n| **NUFFT** | ✅ | ❌ |\n| **Fractional FFT** | ✅ | ❌ |\n| **Convolution** | ✅ | ❌ |\n| **Auto-Differentiation** | ✅ | ❌ |\n| **GPU (CUDA/Metal)** | ✅ | ❌ |\n| **MPI Distributed** | ✅ | ❌ |\n| **f16/f128 Support** | ✅ | ❌ |\n| **Const-FFT** | ✅ | ❌ |\n| **Split-Complex** | ✅ | ❌ |\n| **Guru Interface** | ✅ | ❌ |\n\n### When to Use OxiFFT\n\n- **SAR/Radar Processing**: 2D FFT, batch processing, real FFT, convolution\n- **Audio Processing**: STFT, window functions, streaming FFT\n- **Scientific Computing**: NUFFT for irregular sampling, MPI for HPC\n- **Machine Learning**: Auto-differentiation, GPU acceleration\n- **Embedded/Web**: WASM support, const-FFT for fixed sizes\n- **Signal Analysis**: Sparse FFT for compressed sensing, pruned FFT for specific frequencies\n\n## Performance Targets\n\n| Transform Type | Size | Target |\n|----------------|------|--------|\n| 1D Complex DFT | 2^10 | Within 2x of FFTW |\n| 1D Complex DFT | 2^20 | Within 2x of FFTW |\n| 1D Real FFT | 2^10 | Within 2x of FFTW |\n| 2D Complex DFT | 1024x1024 | Within 2x of FFTW |\n| Batch 1D DFT | 1000x256 | Within 2x of FFTW |\n| Prime size DFT | 2017 | Within 3x of FFTW |\n\n**Stretch goal**: Match or exceed FFTW performance for common sizes.\n\n## Dependencies\n\n```toml\n[dependencies]\nnum-complex = \"0.4\"\nnum-traits = \"0.2\"\nserde = { version = \"1.0\", features = [\"derive\"] }\nserde_json = \"1.0\"\nseahash = \"4.1\"\nrayon = { version = \"1.11\", optional = true }\nmpi = { version = \"0.8\", optional = true }\nlibc = { version = \"0.2\", optional = true }\n\n[features]\ndefault = [\"std\", \"threading\"]\nstd = []\nthreading = [\"dep:rayon\"]\nsimd = []\nportable_simd = []\nf128-support = []\nf16-support = []\nmpi = [\"dep:mpi\"]\nsparse = []\npruned = []\nsve = [\"dep:libc\"]\nwasm = [\"dep:wasm-bindgen\", \"dep:js-sys\"]\nstreaming = []\nconst-fft = []\ncuda = []\nmetal = []\ngpu = []\n```\n\n## Documentation\n\n### Project Overview\n\n- **[PROJECT_STATUS.md](PROJECT_STATUS.md)** - 📊 Current project status, metrics, and priorities\n- **[README.md](README.md)** - This file - project overview and quick start\n\n### User Guides\n\n- **[BENCHMARKING.md](BENCHMARKING.md)** - Comprehensive guide to running performance benchmarks\n- **[PERFORMANCE_ANALYSIS.md](PERFORMANCE_ANALYSIS.md)** - Performance analysis and optimization guide\n- **[TESTING.md](TESTING.md)** - Testing methodology and validation procedures\n- **[CONTRIBUTING.md](CONTRIBUTING.md)** - Contribution guidelines and project policies\n\n### Architecture \u0026 Planning\n\n- **[oxifft.md](oxifft.md)** - Complete architecture and implementation blueprint (32 KB)\n- **[TODO.md](TODO.md)** - Detailed implementation status and roadmap (18 KB)\n- **[CHANGELOG.md](CHANGELOG.md)** - Project history and release notes\n\n### Benchmark Reports\n\n- **[BENCHMARK_INVESTIGATION_SUMMARY.md](BENCHMARK_INVESTIGATION_SUMMARY.md)** - Investigation of benchmark methodology bugs (2026-01-07)\n- **[benchmark_results_2026-01-07_CORRECTED.md](benchmark_results_2026-01-07_CORRECTED.md)** - Corrected benchmark results vs RustFFT\n- **[BENCHMARK_RESULTS_TEMPLATE.md](BENCHMARK_RESULTS_TEMPLATE.md)** - Template for documenting benchmark results\n\n## References\n\n- FFTW Paper: \"The Design and Implementation of FFTW3\" (Frigo \u0026 Johnson, 2005)\n- Cooley-Tukey: \"An Algorithm for the Machine Calculation of Complex Fourier Series\" (1965)\n- Rader's Algorithm: \"Discrete Fourier transforms when the number of data samples is prime\" (1968)\n- Bluestein: \"A linear filtering approach to the computation of discrete Fourier transform\" (1970)\n\n## License\n\nLicensed under either of:\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\nCopyright (c) 2026 COOLJAPAN OU (Team KitaSan)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcool-japan%2Foxifft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcool-japan%2Foxifft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcool-japan%2Foxifft/lists"}