next_fast_len#
- cbclib.bin.next_fast_len(target: int, backend: str = 'numpy')[source]#
Find the next fast size of input data to fft, for zero-padding, etc. FFT algorithms gain their speed by a recursive divide and conquer strategy. This relies on efficient functions for small prime factors of the input length. Thus, the transforms are fastest when using composites of the prime factors handled by the fft implementation. If there are efficient functions for all radices <= n, then the result will be a number x >= target with only prime factors < n. (Also known as n-smooth numbers)
- Parameters
- Raises
ValueError – If backend is invalid.
ValueError – If target is negative.
- Returns
The smallest fast length greater than or equal to target.
- Return type