bundles / scipy latest / scipy / fftpack / _helper / next_fast_len
function
scipy.fftpack._helper:next_fast_len
source: /scipy/fftpack/_helper.py :54
Signature
def next_fast_len ( target ) Summary
Find the next fast size of input data to fft, for zero-padding, etc.
Extended Summary
SciPy's FFTPACK has efficient functions for radix {2, 3, 4, 5}, so this returns the next composite of the prime factors 2, 3, and 5 which is greater than or equal to target. (These are also known as 5-smooth numbers, regular numbers, or Hamming numbers.)
Parameters
target: intLength to start searching from. Must be a positive integer.
Returns
out: intThe first 5-smooth number greater than or equal to
target.
Notes
Examples
On a particular machine, an FFT of prime length takes 133 ms:from scipy import fftpack import numpy as np rng = np.random.default_rng() min_len = 10007 # prime length is worst case for speed a = rng.standard_normal(min_len) b = fftpack.fft(a)✓
fftpack.next_fast_len(min_len) b = fftpack.fft(a, 10125)✓
b = fftpack.fft(a, 16384)
✓Aliases
-
scipy.fftpack.next_fast_len