MCPcopy Index your code
hub / github.com/numpy/numpy / hfft

Function hfft

numpy/fft/_pocketfft.py:530–629  ·  view source on GitHub ↗

Compute the FFT of a signal that has Hermitian symmetry, i.e., a real spectrum. Parameters ---------- a : array_like The input array. n : int, optional Length of the transformed axis of the output. For `n` output points, ``n//2 + 1`` input points are

(a, n=None, axis=-1, norm=None, out=None)

Source from the content-addressed store, hash-verified

528
529@array_function_dispatch(_fft_dispatcher)
530def hfft(a, n=None, axis=-1, norm=None, out=None):
531 """
532 Compute the FFT of a signal that has Hermitian symmetry, i.e., a real
533 spectrum.
534
535 Parameters
536 ----------
537 a : array_like
538 The input array.
539 n : int, optional
540 Length of the transformed axis of the output. For `n` output
541 points, ``n//2 + 1`` input points are necessary. If the input is
542 longer than this, it is cropped. If it is shorter than this, it is
543 padded with zeros. If `n` is not given, it is taken to be ``2*(m-1)``
544 where ``m`` is the length of the input along the axis specified by
545 `axis`.
546 axis : int, optional
547 Axis over which to compute the FFT. If not given, the last
548 axis is used.
549 norm : {"backward", "ortho", "forward"}, optional
550 Normalization mode (see `numpy.fft`). Default is "backward".
551 Indicates which direction of the forward/backward pair of transforms
552 is scaled and with what normalization factor.
553
554 .. versionadded:: 1.20.0
555
556 The "backward", "forward" values were added.
557
558 out : ndarray, optional
559 If provided, the result will be placed in this array. It should be
560 of the appropriate shape and dtype.
561
562 .. versionadded:: 2.0.0
563
564 Returns
565 -------
566 out : ndarray
567 The truncated or zero-padded input, transformed along the axis
568 indicated by `axis`, or the last one if `axis` is not specified.
569 The length of the transformed axis is `n`, or, if `n` is not given,
570 ``2*m - 2`` where ``m`` is the length of the transformed axis of
571 the input. To get an odd number of output points, `n` must be
572 specified, for instance as ``2*m - 1`` in the typical case,
573
574 Raises
575 ------
576 IndexError
577 If `axis` is not a valid axis of `a`.
578
579 See also
580 --------
581 rfft : Compute the one-dimensional FFT for real input.
582 ihfft : The inverse of `hfft`.
583
584 Notes
585 -----
586 `hfft`/`ihfft` are a pair analogous to `rfft`/`irfft`, but for the
587 opposite case: here the signal has Hermitian symmetry in the time

Callers

nothing calls this directly

Calls 3

asarrayFunction · 0.90
_swap_directionFunction · 0.85
irfftFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…