# How to set the length of fft

**URL:** <https://discourse.julialang.org/t/how-to-set-the-length-of-fft/38885>\
**Category:** General Usage\
**Tags:** fftw\
**Created:** [May 6, 2020, 1:23pm UTC](https://discourse.julialang.org/t/how-to-set-the-length-of-fft/38885 "2020-05-06T13:23:55Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [May 7, 2020, 5:01pm UTC](https://discourse.julialang.org/t/how-to-set-the-length-of-fft/38885/20 "2020-05-07T17:01:11Z")

</div>

> [@antoine-levitt](#):
>
> Do you have good heuristics for adjusting this size other than benchmarking? I currently do `nextprod([2, 3, 5], N)`

That’s a decent rule of thumb, I think. FFTW also handles factors of 7 efficiently, so it wouldn’t hurt to include that, but [5-smooth](https://en.wikipedia.org/wiki/Smooth_number) numbers are already pretty dense and are probably marginally more efficient than 7-smooth numbers in FFTW. For real-data transforms, it is best if the length is even.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-set-the-length-of-fft/38885)._
