Loading [MathJax]/extensions/tex2jax.js
scipy 1.10.1 Pypi GitHub Homepage
Other Docs

NotesParametersReturns
next_fast_len(target)

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.)

Notes

Parameters

target : int

Length to start searching from. Must be a positive integer.

Returns

out : int

The first 5-smooth number greater than or equal to target.

Find the next fast size of input data to fft, for zero-padding, etc.

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)
Zero-padding to the next 5-smooth length reduces computation time to 211 us, a speedup of 630 times:
fftpack.next_fast_len(min_len)
b = fftpack.fft(a, 10125)
Rounding up to the next power of 2 is not optimal, taking 367 us to compute, 1.7 times as long as the 5-smooth size:
b = fftpack.fft(a, 16384)
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

scipy.fftfft

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/fftpack/_helper.py#51
type: <class 'function'>
Commit: