scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef

This function computes the N-D discrete Fourier Transform for a Hermitian symmetric complex input over any number of axes in an M-D array by means of the Fast Fourier Transform (FFT). In other words, ihfftn(hfftn(x, s)) == x to within numerical accuracy. ( s here is x.shape with s[-1] = x.shape[-1] * 2 - 1 , this is necessary for the same reason x.shape would be necessary for irfft .)

Notes

For a 1-D signal x to have a real spectrum, it must satisfy the Hermitian property:

x[i] == np.conj(x[-i]) for all i

This generalizes into higher dimensions by reflecting over each axis in turn:

x[i, j, k, ...] == np.conj(x[-i, -j, -k, ...]) for all i, j, k, ...

This should not be confused with a Hermitian matrix, for which the transpose is its own conjugate:

x[i, j] == np.conj(x[j, i]) for all i, j

The default value of s assumes an even output length in the final transformation axis. When performing the final complex to real transformation, the Hermitian symmetry requires that the last imaginary component along that axis must be 0 and so it is ignored. To avoid losing information, the correct length of the real input must be given.

Parameters

x : array_like

Input array.

s : sequence of ints, optional

Shape (length of each transformed axis) of the output ( s[0] refers to axis 0, s[1] to axis 1, etc.). s is also the number of input points used along this axis, except for the last axis, where s[-1]//2+1 points of the input are used. Along any axis, if the shape indicated by s is smaller than that of the input, the input is cropped. If it is larger, the input is padded with zeros. If s is not given, the shape of the input along the axes specified by axes is used. Except for the last axis which is taken to be 2*(m-1) where m is the length of the input along that axis.

axes : sequence of ints, optional

Axes over which to compute the inverse FFT. If not given, the last :None:None:`len(s)` axes are used, or all axes if s is also not specified.

norm : {"backward", "ortho", "forward"}, optional

Normalization mode (see fft ). Default is "backward".

overwrite_x : bool, optional

If True, the contents of x can be destroyed; the default is False. See fft for more details.

workers : int, optional

Maximum number of workers to use for parallel computation. If negative, the value wraps around from os.cpu_count() . See ~scipy.fft.fft for more details.

plan : object, optional

This argument is reserved for passing in a precomputed plan provided by downstream FFT vendors. It is currently not used in SciPy.

versionadded

Raises

ValueError

If s and :None:None:`axes` have different length.

IndexError

If an element of :None:None:`axes` is larger than than the number of axes of x.

Returns

out : ndarray

The truncated or zero-padded input, transformed along the axes indicated by :None:None:`axes`, or by a combination of s or x, as explained in the parameters section above. The length of each transformed axis is as given by the corresponding element of s, or the length of the input in every axis except for the last one if s is not given. In the final transformed axis the length of the output when s is not given is 2*(m-1) where m is the length of the final transformed axis of the input. To get an odd number of output points in the final axis, s must be specified.

Compute the N-D FFT of Hermitian symmetric complex input, i.e., a signal with a real spectrum.

See Also

fft

The 1-D FFT, with definitions and conventions used.

ihfftn

The inverse N-D FFT with real spectrum. Inverse of :None:None:`hfftn`.

rfft

Forward FFT of real input.

Examples

>>> import scipy.fft
... x = np.ones((3, 2, 2))
... scipy.fft.hfftn(x) array([[[12., 0.], [ 0., 0.]], [[ 0., 0.], [ 0., 0.]], [[ 0., 0.], [ 0., 0.]]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.fft._basic.ihfftn scipy.fft._basic.hfft scipy.fft._basic.hfft2

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.

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/fft/_basic.py#1320
type: <class 'uarray._Function'>
Commit: