summaryrefslogtreecommitdiff
path: root/numpy/fft/fftpack.py
diff options
context:
space:
mode:
authorendolith <endolith@gmail.com>2012-10-13 17:36:31 -0400
committerendolith <endolith@gmail.com>2012-10-13 17:36:31 -0400
commit2e2f4522275af6e256c243e2b43bf5fc1d37b07c (patch)
treec552eef5c9339a558b992617b4338a0d6b80bcf8 /numpy/fft/fftpack.py
parent4ddb4df47c156bee8271ca4ac444a6760d321e32 (diff)
downloadnumpy-2e2f4522275af6e256c243e2b43bf5fc1d37b07c.tar.gz
DOC: Clarify size of odd-length FFTs, default `d` for fftfreq, and some PEP8 style fixes
Diffstat (limited to 'numpy/fft/fftpack.py')
-rw-r--r--numpy/fft/fftpack.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/fft/fftpack.py b/numpy/fft/fftpack.py
index 80d21ec1d..c70e336ea 100644
--- a/numpy/fft/fftpack.py
+++ b/numpy/fft/fftpack.py
@@ -271,7 +271,8 @@ def rfft(a, n=None, axis=-1):
out : complex ndarray
The truncated or zero-padded input, transformed along the axis
indicated by `axis`, or the last one if `axis` is not specified.
- The length of the transformed axis is ``n/2+1``.
+ If `n` is even, the length of the transformed axis is ``(n/2)+1``.
+ If `n` is odd, the length is ``(n+1)/2``.
Raises
------
@@ -293,7 +294,7 @@ def rfft(a, n=None, axis=-1):
conjugates of the corresponding positive-frequency terms, and the
negative-frequency terms are therefore redundant. This function does not
compute the negative frequency terms, and the length of the transformed
- axis of the output is therefore ``n/2+1``.
+ axis of the output is therefore ``n//2+1``.
When ``A = rfft(a)``, ``A[0]`` contains the zero-frequency term, which
must be purely real due to the Hermite symmetry.
@@ -343,7 +344,7 @@ def irfft(a, n=None, axis=-1):
The input array.
n : int, optional
Length of the transformed axis of the output.
- For `n` output points, ``n/2+1`` input points are necessary. If the
+ For `n` output points, ``n//2+1`` input points are necessary. If the
input is longer than this, it is cropped. If it is shorter than this,
it is padded with zeros. If `n` is not given, it is determined from
the length of the input (along the axis specified by `axis`).