|
5 | 5 | //! |
6 | 6 | //! # Monarch Butterfly |
7 | 7 | //! |
8 | | -//! Experimental FFT library where all FFTs are proc-macro generated const-evaluation functions. //! The use case is if you know the FFT size at compile time. However, knowing the FFT size at //! compile time gives immense gains. |
| 8 | +//! Experimental FFT library where all FFTs are proc-macro generated const-evaluation functions. |
| 9 | +//! The one requirement is you must know the size of the FFT at compile-time. Knowing the FFT size at |
| 10 | +//! compile time gives immense gains, as the compiler is able unroll the call stack and optimize for |
| 11 | +//! SIMD throughput through function calls. |
9 | 12 | //! |
10 | | -//! This library implements FFTs for both `f32` and `f64` sizes `1-200`. The FFTs are //! auto-generated so this limit could be increased above 200 at the expense of compile time. |
| 13 | +//! This library implements FFTs for both `f32` and `f64` sizes `1-200`. The FFTs are |
| 14 | +//! auto-generated so this limit could be increased above 200 at the expense of compile time. |
11 | 15 | //! |
12 | 16 | //! ## Features |
13 | 17 | //! |
|
21 | 25 | //! - FFT size must be known at compile time |
22 | 26 | //! - By default, only FFTs up to size 200 are generated |
23 | 27 | //! |
24 | | -//! |
| 28 | +//! ## Usage |
| 29 | +//! |
| 30 | +//! The top level functions are [`fft`] and [`ifft`]. |
| 31 | +//! |
25 | 32 | //! ``` |
26 | 33 | //! use monarch_butterfly::*; |
27 | 34 | //! use num_complex::Complex; |
28 | 35 | //! |
29 | 36 | //! let input: Vec<_> = (0..8).map(|i| Complex::new(i as f32, 0.0)).collect(); |
30 | 37 | //! let output = fft::<8, _, _>(input); |
31 | 38 | //! ``` |
32 | | -//! |
33 | | -//! The top level functions are [`fft`] and [`ifft`]. |
34 | | -//! |
35 | 39 | //! This library will use all SIMD features your CPU has available including AVX512, |
36 | 40 | //! assuming you compile with those features (`RUSTFLAGS="-C target-cpu=native" cargo build`). |
37 | 41 | //! |
|
40 | 44 | //! As an example of AVX512 instructions, here is an example on just an FFT |
41 | 45 | //! of size 128: <https://godbolt.org/z/Y58eh1x5a>(`Ctrl+F` for "zmm" instructions) |
42 | 46 | //! |
43 | | -//! The FFTs before unrolling are heavily inspired from [`RustFFT``](<https://github.com/ejmahler/RustFFT>). |
| 47 | +//! The FFTs before unrolling are heavily inspired from [`RustFFT`](<https://github.com/ejmahler/RustFFT>). |
44 | 48 | //! Credit is given to Elliott Mahler as the RustFFT original author. |
45 | 49 |
|
46 | 50 | #![allow(clippy::excessive_precision)] |
|
0 commit comments