FFT functions

C/C++

sdp_Fft *sdp_fft_create(const sdp_Mem *input, const sdp_Mem *output, int32_t num_dims_fft, int32_t is_forward, sdp_Error *status)

Creates a plan for FFTs using the supplied input and output buffers.

The number of dimensions used for the FFT is specified using the num_dims_fft parameter. If this is less than the number of dimensions in the arrays, then the FFT batch size is assumed to be the size of the first (slowest varying) dimension.

This wraps cuFFT in addition to CPU FFT code. Advanced data layouts although supported for GPU are not supported for CPU version and thus are discouraged.

Parameters:
  • input – Input data.

  • output – Output data.

  • num_dims_fft – The number of dimensions for the FFT.

  • is_forward – Set true if FFT should be “forward”, false for “inverse”.

  • status – Error status.

Returns:

sdp_Fft* Handle to FFT plan.

void sdp_fft_exec(sdp_Fft *fft, sdp_Mem *input, sdp_Mem *output, sdp_Error *status)

Executes FFT using plan and supplied data.

Parameters:
  • fft – Handle to FFT plan.

  • input – Input data.

  • output – Output data.

  • status – Error status.

void sdp_fft_free(sdp_Fft *fft)

Destroys the FFT plan.

Parameters:

fft – Handle to FFT plan.

Python

class ska_sdp_func.fourier_transforms.Fft(input_data, output_data, num_dims_fft, is_forward)

Interface to SDP FFT.

__init__(input_data, output_data, num_dims_fft, is_forward)

Creates a plan for FFTs using the supplied input and output buffers.

The number of dimensions used for the FFT is specified using the num_dims_fft parameter. If this is less than the number of dimensions in the arrays, then the FFT batch size is assumed to be the size of the first (slowest varying) dimension.

Parameters:
  • input_data (numpy.ndarray or cupy.ndarray) – Input data.

  • output_data (numpy.ndarray or cupy.ndarray) – Output data.

  • num_dims_fft (int) – The number of dimensions for the FFT.

  • is_forward (bool) – Set true if FFT should be “forward”, false for “inverse”.

exec(input_data, output_data)

Executes FFT using plan and supplied data.

Parameters:
  • input_data (cupy.ndarray) – Input data.

  • output_data (cupy.ndarray) – Output data.