# Is there any p5 function for 2d FFT?

**URL:** <https://discourse.processing.org/t/is-there-any-p5-function-for-2d-fft/39541>\
**Category:** Libraries\
**Created:** [November 1, 2022, 8:57am UTC](https://discourse.processing.org/t/is-there-any-p5-function-for-2d-fft/39541 "2022-11-01T08:57:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wonwoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/wonwoo/32/17324_2.png) [@wonwoo](https://discourse.processing.org/u/wonwoo)\
**Post date:** [November 1, 2022, 8:57am UTC](https://discourse.processing.org/t/is-there-any-p5-function-for-2d-fft/39541/1 "2022-11-01T08:57:55Z")

</div>

Hi, All.

Is there any p5 function for 2d FFT?

 ![fft2d](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/c/ec4b376125e183300d177aa83d618a54e0344d34.jpeg)

The “FFT” means Fast Fourier Transform. and …  
2d FFT is required for 2D image processing.

If not, I’ll try to make one for p5js for the first time in the world.

I’ve made 2d FFT code for Openframeworks before.  
my github: [bemoregt (Gromit Park) · GitHub](https://github.com/bemoregt)

Thanks.

Best,  
@bemoregt.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [November 2, 2022, 10:13am UTC](https://discourse.processing.org/t/is-there-any-p5-function-for-2d-fft/39541/2 "2022-11-02T10:13:31Z")

</div>

Hi @wonwoo,

You may want to look at “2D FFT javascript” on the web. You can use external JavaScript libraries:

> **[GitHub - turbomaze/JS-Fourier-Image-Analysis: Javascript implementation of a...](https://github.com/turbomaze/JS-Fourier-Image-Analysis)**
>
> Javascript implementation of a 2D FFT for images. Makes it easy to apply low pass/high pass/band filters. - GitHub - turbomaze/JS-Fourier-Image-Analysis: Javascript implementation of a 2D FFT for i...

There’s also a similar unanswered topic:

> [@Fourier image analysis in P5](https://discourse.processing.org/t/fourier-image-analysis-in-p5/38121):
>
> Hello everyone! I’ve been trying to make a little diffraction simulator and I’m struggling with finding 2D FFT and IFFT libraries to work along with P5. The program I’m trying to do should do the following: Get a FFT of the aperture image; Get the FFT of the image; Multiply the magnitude of both; IFFT the result. OpenCV.js’ FFT works just fine, but the library has no inverse function. Has anyone tried (and hopefully succeeded) to do this? Any pointers on how to go about it? Thank you in …

---

<div class="post-metadata">

**Author:** ![wonwoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/wonwoo/32/17324_2.png) [@wonwoo](https://discourse.processing.org/u/wonwoo)\
**Post date:** [November 4, 2022, 5:34am UTC](https://discourse.processing.org/t/is-there-any-p5-function-for-2d-fft/39541/3 "2022-11-04T05:34:24Z")

</div>

Hi, @josephh.

I’ll try that library.

Thanks.  
Best,  
@bemoregt.
