On Tue, 1 Sep 2015 18:43 Phil Hodge <hodge@stsci.edu> wrote:

On 09/01/2015 11:14 AM, Oscar Benjamin wrote:

> Just use the next power of 2. Pure powers of 2 are the most efficient

> for FFT algorithms so it potentially works out better than finding a

> smaller but similarly composite size to pad to. Finding the next power

> of 2 is easy to code and never a bad choice.It would be better to pad to a power of three or five, or some other

product of small primes, if the pad length would be significantly less

than padding to a power of two. The obvious problem with padding is

that it's different from the real data, so its presence will affect the

result. At the least, it would be good to pad with the mean value of

the original data, or to pad with zero after subtracting the mean from

the original data.

I meant performance wise it's not a bad choice. If you're concerned about distortion then use the Bluestein algorithm as I showed.

--

Oscar