Compute the inverse FFT of a signal that has Hermitian symmetry. Parameters ---------- a : array_like Input array. n : int, optional Length of the inverse FFT, the number of points along transformation axis in the input to use. If `n` is smaller than
(a, n=None, axis=-1, norm=None, out=None)
| 631 | |
| 632 | @array_function_dispatch(_fft_dispatcher) |
| 633 | def ihfft(a, n=None, axis=-1, norm=None, out=None): |
| 634 | """ |
| 635 | Compute the inverse FFT of a signal that has Hermitian symmetry. |
| 636 | |
| 637 | Parameters |
| 638 | ---------- |
| 639 | a : array_like |
| 640 | Input array. |
| 641 | n : int, optional |
| 642 | Length of the inverse FFT, the number of points along |
| 643 | transformation axis in the input to use. If `n` is smaller than |
| 644 | the length of the input, the input is cropped. If it is larger, |
| 645 | the input is padded with zeros. If `n` is not given, the length of |
| 646 | the input along the axis specified by `axis` is used. |
| 647 | axis : int, optional |
| 648 | Axis over which to compute the inverse FFT. If not given, the last |
| 649 | axis is used. |
| 650 | norm : {"backward", "ortho", "forward"}, optional |
| 651 | Normalization mode (see `numpy.fft`). Default is "backward". |
| 652 | Indicates which direction of the forward/backward pair of transforms |
| 653 | is scaled and with what normalization factor. |
| 654 | |
| 655 | .. versionadded:: 1.20.0 |
| 656 | |
| 657 | The "backward", "forward" values were added. |
| 658 | |
| 659 | out : complex ndarray, optional |
| 660 | If provided, the result will be placed in this array. It should be |
| 661 | of the appropriate shape and dtype. |
| 662 | |
| 663 | .. versionadded:: 2.0.0 |
| 664 | |
| 665 | Returns |
| 666 | ------- |
| 667 | out : complex ndarray |
| 668 | The truncated or zero-padded input, transformed along the axis |
| 669 | indicated by `axis`, or the last one if `axis` is not specified. |
| 670 | The length of the transformed axis is ``n//2 + 1``. |
| 671 | |
| 672 | See also |
| 673 | -------- |
| 674 | hfft, irfft |
| 675 | |
| 676 | Notes |
| 677 | ----- |
| 678 | `hfft`/`ihfft` are a pair analogous to `rfft`/`irfft`, but for the |
| 679 | opposite case: here the signal has Hermitian symmetry in the time |
| 680 | domain and is real in the frequency domain. So here it's `hfft` for |
| 681 | which you must supply the length of the result if it is to be odd: |
| 682 | |
| 683 | * even: ``ihfft(hfft(a, 2*len(a) - 2)) == a``, within roundoff error, |
| 684 | * odd: ``ihfft(hfft(a, 2*len(a) - 1)) == a``, within roundoff error. |
| 685 | |
| 686 | Examples |
| 687 | -------- |
| 688 | >>> import numpy as np |
| 689 | >>> spectrum = np.array([ 15, -4, 0, -1, 0, -4]) |
| 690 | >>> np.fft.ifft(spectrum) |
nothing calls this directly
no test coverage detected
searching dependent graphs…