Expand description
Frequency grids, fast transform lengths, N-dimensional real FFTs and N-dimensional DCTs and DSTs,
following scipy.fft: fftfreq, rfftfreq, next_fast_len, ifftshift, rfftn/irfftn
and dctn/idctn/dstn/idstn.
See the book entry Real and multidimensional FFTs.
Functions§
- dctn
- The N-dimensional DCT (SciPy’s
dctn): the 1-Ddctalong every axis in turn, which is valid because the transform is separable. - dstn
- The N-dimensional DST (SciPy’s
dstn). - fftfreq
- The sample frequencies of an
n-point DFT with sample spacingd(NumPy’sfftfreq):[0, 1, …, ⌈n/2⌉−1, −⌊n/2⌋, …, −1] / (n d), in the order the FFT returns its bins. - fftshift_
1d - One-dimensional
fftshiftfor a slice of any element type. - idctn
- The inverse of
dctnwith the same type and normalization. - idstn
- The inverse of
dstnwith the same type and normalization. - ifftshift
- The inverse of
fftshift: moves the zero-frequency bin from the centre back to index 0 along every axis (they differ for odd lengths). - ifftshift_
1d - One-dimensional
ifftshiftfor a slice of any element type. - irfftn
- The inverse of
rfftn(SciPy’sirfftn):shapeis the shape of the real output, needed because the last axis of lengthnandn + 1have the same half spectrum whennis even. Scaled so thatirfftn(rfftn(x), x.shape()) = x. - next_
fast_ len - The smallest length
≥ targetwhose prime factors are all small, which FFTs handle fastest (SciPy’snext_fast_len): 2, 3 and 5 for real transforms (real = true), and also 7 and 11 for complex ones. Found by enumerating the products of powers of the allowed primes. - rfftfreq
- The non-negative sample frequencies of an
n-point real FFT,[0, 1, …, ⌊n/2⌋] / (n d)(NumPy’srfftfreq). - rfftn
- The N-dimensional DFT of real data (SciPy’s
rfftn): a real FFT along the last axis, keeping the⌊n/2⌋ + 1non-negative frequencies, then complex FFTs along the other axes. The result has the input’s shape with the last axis shortened.