scipy.fftpack.rfft

scipy.fftpack.rfft(x, n=None, axis=-1, overwrite_x=0)

rfft(x, n=None, axis=-1, overwrite_x=0) -> y

Return discrete Fourier transform of real sequence x.

The returned real arrays contains
[y(0),Re(y(1)),Im(y(1)),...,Re(y(n/2))] if n is even [y(0),Re(y(1)),Im(y(1)),...,Re(y(n/2)),Im(y(n/2))] if n is odd
where
y(j) = sum[k=0..n-1] x[k] * exp(-sqrt(-1)*j*k* 2*pi/n) j = 0..n-1

Note that y(-j) = y(n-j).conjugate().

Optional input:
n
Defines the length of the Fourier transform. If n is not specified then n=x.shape[axis] is set. If n<x.shape[axis], x is truncated. If n>x.shape[axis], x is zero-padded.
axis
The transform is applied along the given axis of the input array (or the newly constructed array if n argument was used).
overwrite_x
If set to true, the contents of x can be destroyed.
Notes:
y == rfft(irfft(y)) within numerical accuracy.

Previous topic

scipy.fftpack.ifft2

Next topic

scipy.fftpack.irfft

This Page