summaryrefslogtreecommitdiff
path: root/numpy/fft/fftpack.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/fft/fftpack.py')
-rw-r--r--numpy/fft/fftpack.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/fft/fftpack.py b/numpy/fft/fftpack.py
index 7486ff51e..bd116b9cb 100644
--- a/numpy/fft/fftpack.py
+++ b/numpy/fft/fftpack.py
@@ -371,7 +371,9 @@ def rfft(a, n=None, axis=-1, norm=None):
output = _raw_fft(a, n, axis, fftpack.rffti, fftpack.rfftf,
_real_fft_cache)
if _unitary(norm):
- output *= 1 / sqrt(a.shape[axis])
+ if n is None:
+ n = a.shape[axis]
+ output *= 1 / sqrt(n)
return output