tfmri.signal.fft
tfmri.signal.fft¶
- fft(x, shape=None, axes=None, norm='backward', shift=False)[source]¶
Computes the N-dimensional discrete Fourier Transform.
This function computes the
N-dimensional discrete Fourier Transform over any number of axes in anM-dimensional array by means of the Fast Fourier Transform (FFT).Note
Nmust be 1, 2 or 3.- Parameters
x – A
Tensor. Must be one of the following types:complex64,complex128.shape – A
Tensor, aTensorShapeor a list ofints. Shape (length of each transformed axis) of the output (s[0]refers to axis 0,s[1]to axis 1, etc.). Along any axis, if the given shape is smaller than that of the input, the input is cropped. If it is larger, the input is padded with zeros. Ifshapeis not given, the shape of the input along the axes specified byaxesis used.axes – A
Tensor, aTensorShapeor a list ofints. Axes over which to compute the FFT. If not given, the lastlen(shape)axes are used, or all axes ifshapeis also not specified.norm – A
string. The normalization mode. Must be one of"forward","backward"or"ortho". Defaults to"backward". Indicates which direction of the forward/backward pair of transforms is scaled and with what normalization factor.shift – A boolean. If True, perform a “centered” transform by appropriately shifting the inputs/outputs (eg, shifting zero-frequency components to the center of the spectrum).
- Returns
The truncated or zero-padded input tensor, transformed along the axes indicated by
axes, or by a combination ofshapeandaxes, as explained in the parameters section above.- Raises
TypeError – If
xis not of a complex type.InvalidArgumentError – If length of
shapeis greater than the rank ofx.InvalidArgumentError – If length of
axesis greater than the rank ofx.InvalidArgumentError – If any element of
axesis larger than the number of axes ofx.InvalidArgumentError – If
shapeandaxeshave different length.ValueError – If
normis not one of ‘forward’, ‘backward’ or ‘ortho’.