summaryrefslogtreecommitdiff
path: root/numpy/fft
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-12-18 13:10:34 -0700
committerCharles Harris <charlesr.harris@gmail.com>2015-12-18 13:10:34 -0700
commit44293bb2834f2a4495dacee4ba112a3bfeef5b0c (patch)
tree9f0a1ec62329a4fb99bff956d8b990d48e97d365 /numpy/fft
parent7fa53390da958cc985bfaeb1620990ddd2255ce8 (diff)
downloadpython-numpy-44293bb2834f2a4495dacee4ba112a3bfeef5b0c.tar.gz
python-numpy-44293bb2834f2a4495dacee4ba112a3bfeef5b0c.tar.bz2
python-numpy-44293bb2834f2a4495dacee4ba112a3bfeef5b0c.zip
DOC: Clarify documentation for np.fft.ifft.
The relationship between frequency and position in the input array is clarified.
Diffstat (limited to 'numpy/fft')
-rw-r--r--numpy/fft/fftpack.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/numpy/fft/fftpack.py b/numpy/fft/fftpack.py
index 398eec45e..c3bb732b2 100644
--- a/numpy/fft/fftpack.py
+++ b/numpy/fft/fftpack.py
@@ -203,12 +203,16 @@ def ifft(a, n=None, axis=-1, norm=None):
see `numpy.fft`.
The input should be ordered in the same way as is returned by `fft`,
- i.e., ``a[0]`` should contain the zero frequency term,
- ``a[1:n/2]`` should contain the positive-frequency terms, and
- ``a[n/2+1:]`` should contain the negative-frequency terms, in order of
- decreasingly negative frequency. For an even number of input points,
- ``A[n/2]`` represents both positive and negative Nyquist frequency.
- See `numpy.fft` for details.
+ i.e.,
+
+ * ``a[0]`` should contain the zero frequency term,
+ * ``a[1:n//2]`` should contain the positive-frequency terms,
+ * ``a[n//2 + 1:]`` should contain the negative-frequency terms, in
+ increasing order starting from the most negative frequency.
+
+ For an even number of input points, ``A[n//2]`` represents the sum of
+ the values at the positive and negative Nyquist frequencies, as the two
+ are aliased together. See `numpy.fft` for details.
Parameters
----------
@@ -265,9 +269,9 @@ def ifft(a, n=None, axis=-1, norm=None):
>>> n[40:60] = np.exp(1j*np.random.uniform(0, 2*np.pi, (20,)))
>>> s = np.fft.ifft(n)
>>> plt.plot(t, s.real, 'b-', t, s.imag, 'r--')
- [<matplotlib.lines.Line2D object at 0x...>, <matplotlib.lines.Line2D object at 0x...>]
+ ...
>>> plt.legend(('real', 'imaginary'))
- <matplotlib.legend.Legend object at 0x...>
+ ...
>>> plt.show()
"""