# Is it time to make a pure Julia FFT?

**URL:** <https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256>\
**Category:** Signal and Image Processing\
**Tags:** fft\
**Created:** [May 23, 2023, 4:00am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256 "2023-05-23T04:00:09Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Post date:** [May 23, 2023, 4:00am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/1 "2023-05-23T04:00:09Z")

</div>

While FFTW is great, it is a GPL-licensed C library. R, Mathematica, Python’s Scipy, etc have their own FFT library. Should we finally have our own FFT library? A pure Julia FFT may provide several advantages such as being extensible via the Julia compiler extensions, operating on different array types, etc. Implementing FFT also comes with the benefit of putting Julia’s ecosystem to the test.

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [May 23, 2023, 4:04am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/2 "2023-05-23T04:04:55Z")

</div>

I have made one for the use of myself.

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [May 23, 2023, 4:11am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/3 "2023-05-23T04:11:30Z")

</div>

Are you proposing to write this yourself?

---

<div class="post-metadata">

**Author:** ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Post date:** [May 23, 2023, 4:18am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/4 "2023-05-23T04:18:30Z")

</div>

I might as well at some point if I’m done with my current project. There are many algorithms out there and developing the best approach will take time. I’ve written FFT in C++ before. Writing a fast FFT, however, is complicated. Maybe I will create and participate in a fun contest.

Good idea, maybe I’ll learn much more about FFT with it.

---

<div class="post-metadata">

**Author:** ![tecosaur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tecosaur/32/23206_2.png) [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Post date:** [May 23, 2023, 6:42am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/5 "2023-05-23T06:42:52Z")

</div>

The fastest FFT approach I’m aware of is Spiral.

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [May 23, 2023, 7:40am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/6 "2023-05-23T07:40:28Z")

</div>

> **[Let's play at implementing a fast Fourier transform!](https://klafyvel.me/blog/articles/fft-julia/)**
>
> PhD student in Photophysics

---

<div class="post-metadata">

**Author:** ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Post date:** [May 23, 2023, 9:18am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/7 "2023-05-23T09:18:07Z")

</div>

I know that one.

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [May 23, 2023, 10:04am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/8 "2023-05-23T10:04:25Z")

</div>

There is FFTA.jl: Fastest Fourier Transform in my Apartment  
It’s pure julia.

> **[GitHub - dannys4/FFTA.jl: JuliaCon 2021 Hackathon](https://github.com/dannys4/FFTA.jl)**
>
> JuliaCon 2021 Hackathon. Contribute to dannys4/FFTA.jl development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [May 23, 2023, 11:00am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/9 "2023-05-23T11:00:31Z")

</div>

> [@oxinabox](#):
>
> There is FFTA.jl: Fastest Fourier Transform in my Apartment

Nice name.

---

<div class="post-metadata">

**Author:** ![raman\_kumar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raman_kumar/32/26782_2.png) [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Post date:** [May 25, 2023, 5:09pm UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/10 "2023-05-25T17:09:39Z")

</div>

I would like to have a FFT.jl package in pure Julia with detailed documentation . 😍

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [May 26, 2023, 7:20am UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/11 "2023-05-26T07:20:25Z")

</div>

There is also this [quite old pure Julia FFT PR](https://github.com/JuliaLang/julia/pull/6193) from @stevengj

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [June 30, 2023, 4:33pm UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/12 "2023-06-30T16:33:55Z")

</div>

FFFTW is great, if you’re of with GPL and its size. You have some good points for pure Julia, but for most wrapping an existing library is likely best as a JLL (if you can do away with Float64, Float32 types, I didn’t check if it has Float16):

> **[GitHub - marton78/pffft: A fork of Julien Pommier's Pretty Fast FFT (PFFFT)...](https://github.com/marton78/pffft)**
>
> A fork of Julien Pommier's Pretty Fast FFT (PFFFT) library, with several additions - GitHub - marton78/pffft: A fork of Julien Pommier's Pretty Fast FFT (PFFFT) library, with several additions

---

<div class="post-metadata">

**Author:** ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Post date:** [April 13, 2024, 12:39pm UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/13 "2024-04-13T12:39:41Z")

</div>

Okay, Julia actually has a binding for RustFFT that is both faster than FFTW and is permissively licensed. That is good enough for me. As for the pure Julia FFT, that would remain an interesting idea for anyone to try, but I’ll leave that to the experts.

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [May 4, 2024, 6:15pm UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/14 "2024-05-04T18:15:09Z")

</div>

It might worth to look at [PhastFT](https://github.com/QuState/PhastFT).  
There was a thread on Hacker News: [Fast Fourier Transform in Rust](https://news.ycombinator.com/item?id=40231919).

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [May 8, 2024, 3:21pm UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256/15 "2024-05-08T15:21:13Z")

</div>

It might be a good library, and you can already use it from Python, because of PyO3, and thus from Julia with PythonCall.jl.

> <https://github.com/QuState/PhastFT/blob/899ce9cc4e70c1894b4a14049e87bf0700d45b7c/pyphastft/src/lib.rs#L3>

But I’m thinking, Like with C++, it’s hard or impossible to wrap Rust code, i.e. it has to allow it, make a C API. Or so I though, but I see that [pyfunction] (and that trivially small file), is it only supporting Python easily, not all other languages? So to make the question more general, should Julia make it easier to support PyO3 Rust projects, ie. could it support the Python API directly, **i.e. without PythonCall** (although it’s not a terribly large, or problematic, dependency), or a wrapper depending on it? Some such R[Py3]Call.jl specifically for that?
