Skip to content

nabu.processing.fft_cuda

source module nabu.processing.fft_cuda

Classes

  • VKCUFFT Cuda FFT, using VKFFT backend

  • CupyCUFFT Base class for Fast Fourier Transform (FFT).

Functions

source get_vkfft_cuda(slf, *args, **kwargs)

source class VKCUFFT(shape, dtype, r2c=True, axes=None, normalize='rescale', **backend_options)

Bases : _BaseVKFFT

Cuda FFT, using VKFFT backend

Base class for Fast Fourier Transform (FFT).

Parameters

  • shape : list of int Shape of the input data

  • dtype : str or numpy.dtype Data type of the input data

  • r2c : bool, optional Whether to use real-to-complex transform for real-valued input. Default is True.

  • axes : list of int, optional Axes along which FFT is computed. * For 2D transform: axes=(1,0) * For batched 1D transform of 2D image: axes=(-1,)

  • normalize : str, optional Whether to normalize FFT and IFFT. Possible values are: * "rescale": in this case, Fourier data is divided by "N" before IFFT, so that IFFT(FFT(data)) = data. This corresponds to numpy norm=None i.e norm="backward". * "ortho": in this case, FFT and IFFT are adjoint of each other, the transform is unitary. Both FFT and IFFT are scaled with 1/sqrt(N). * "none": no normalization is done : IFFT(FFT(data)) = data*N

Other Parameters

backend_options: dict, optional Parameters to pass to CudaProcessing or OpenCLProcessing class.

source has_fft_implem(name, safe=True)

source has_vkfft(safe=True)

source has_cupyfft(safe=True)

source get_fft_class(backend='vkfft')

Raises

  • RuntimeError

source get_available_fft_implems()

source class CupyCUFFT(shape, dtype, r2c=True, axes=None, normalize='rescale', **backend_options)

Bases : _BaseFFT

Base class for Fast Fourier Transform (FFT).

Parameters

  • shape : list of int Shape of the input data

  • dtype : str or numpy.dtype Data type of the input data

  • r2c : bool, optional Whether to use real-to-complex transform for real-valued input. Default is True.

  • axes : list of int, optional Axes along which FFT is computed. * For 2D transform: axes=(1,0) * For batched 1D transform of 2D image: axes=(-1,)

  • normalize : str, optional Whether to normalize FFT and IFFT. Possible values are: * "rescale": in this case, Fourier data is divided by "N" before IFFT, so that IFFT(FFT(data)) = data. This corresponds to numpy norm=None i.e norm="backward". * "ortho": in this case, FFT and IFFT are adjoint of each other, the transform is unitary. Both FFT and IFFT are scaled with 1/sqrt(N). * "none": no normalization is done : IFFT(FFT(data)) = data*N

Other Parameters

backend_options: dict, optional Parameters to pass to CudaProcessing or OpenCLProcessing class.

Methods

source method CupyCUFFT.fft(array, output=None)

source method CupyCUFFT.ifft(array, output=None)