scikits.cuda.fft.ifft

scikits.cuda.fft.ifft(x_gpu, y_gpu, plan, scale=False)[source]

Inverse Fast Fourier Transform.

Compute the inverse FFT of some data in device memory using the specified plan.

Parameters:

x_gpu : pycuda.gpuarray.GPUArray

Input array.

y_gpu : pycuda.gpuarray.GPUArray

Inverse FFT of input array.

plan : Plan

FFT plan.

scale : bool, optional

If True, scale the computed inverse FFT by the number of elements in the output array.

Notes

For complex to real transformations, this function assumes the input contains N/2+1 non-redundant FFT coefficents of a signal of length N.

Examples

>>> import pycuda.autoinit
>>> import pycuda.gpuarray as gpuarray
>>> import numpy as np
>>> N = 128
>>> x = np.asarray(np.random.rand(N), np.float32)
>>> xf = np.asarray(np.fft.fft(x), np.complex64)
>>> xf_gpu = gpuarray.to_gpu(xf[0:N/2+1])
>>> x_gpu = gpuarray.empty(N, np.float32)
>>> plan = Plan(N, np.complex64, np.float32)
>>> ifft(xf_gpu, x_gpu, plan, True)
>>> np.allclose(x, x_gpu.get(), atol=1e-6)
True