numpy.fft.rfft(a, n=None, axis=-1)

Compute the one-dimensional fft for real input.

Return the n point discrete Fourier transform of the real valued array a. n defaults to the length of a. n is the length of the input, not the output.


a : array

input array with real data type

n : int

length of the fft

axis : int

axis over which to compute the fft


The returned array will be the nonnegative frequency terms of the Hermite-symmetric, complex transform of the real array. So for an 8-point transform, the frequencies in the result are [ 0, 1, 2, 3, 4]. The first term will be real, as will the last if n is even. The negative frequency terms are not needed because they are the complex conjugates of the positive frequency terms. (This is what I mean when I say Hermite-symmetric.)

This is most efficient for n a power of two.

Previous topic


Next topic


This Page

Quick search