# 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:** 5

<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 6, 2020, 2:25pm UTC](https://discourse.julialang.org/t/how-to-set-the-length-of-fft/38885/5 "2020-05-06T14:25:08Z")

</div>

> [@DNF](#):
>
> Could there be a way to ‘virtually’ zero-pad without actually copying over data? Sometimes I zero-pad by quite a lot to increase the frequency resolution. Is it possible to exploit the knowledge that much of the signal is ‘structurally zero’ in order to optimize performance and perhaps avoid the extra allocations?

Yes, it’s called a [pruned FFT](http://www.fftw.org/pruned.html) and can be implemented on top of an `fft` function.

You can also use a [chirp-Z transform](https://en.wikipedia.org/wiki/Chirp_Z-transform) (sometimes called a “zoom FFT”) via Bluestein’s algorithm (also FFT-based) to interpolate the spectrum to “higher resolution” in a portion of the spectrum.

(Neither of these techniques actually increases the resolution in the sense of truly resolving finer spectral features, however — they are just forms of trigonometric interpolation.)

---

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