RENEWLab
1.1.0
RENEW project
|
Typedefs | |
typedef struct mufft_plan_2d | mufft_plan_2d |
Opaque type representing a 2D FFT. More... | |
Functions | |
mufft_plan_2d * | mufft_create_plan_2d_c2c (unsigned Nx, unsigned Ny, int direction, unsigned flags) |
Create a plan for a 2D complex-to-complex inverse or forward FFT. More... | |
mufft_plan_2d * | mufft_create_plan_2d_r2c (unsigned Nx, unsigned Ny, unsigned flags) |
Create a plan for a 2D real-to-complex forward FFT. More... | |
mufft_plan_2d * | mufft_create_plan_2d_c2r (unsigned Nx, unsigned Ny, unsigned flags) |
Create a plan for a 2D complex-to-real inverse FFT. More... | |
void | mufft_execute_plan_2d (mufft_plan_2d *plan, void *output, const void *input) |
Executes a 2D FFT plan. More... | |
void | mufft_free_plan_2d (mufft_plan_2d *plan) |
Free a previously allocated 2D FFT plan. More... | |
The FFT performed by these functions are not normalized. A forward transform followed by an inverse transform will scale the output by the transform size (Nx * Ny). The FFTs implemented take input in regular order, no permutation step is required. Similarly, the output of the FFT is in regular order, without any permutation. If input is laid out as (x[0], x[1], x[2], x[3], ..., x[N - 1]) the FFT transform will output (X[0], X[1], X[2], X[3], ..., X[N - 1]) as expected.
typedef struct mufft_plan_2d mufft_plan_2d |
Opaque type representing a 2D FFT.
mufft_plan_2d* mufft_create_plan_2d_c2c | ( | unsigned | Nx, |
unsigned | Ny, | ||
int | direction, | ||
unsigned | flags | ||
) |
Create a plan for a 2D complex-to-complex inverse or forward FFT.
The input and output data to the 2D transform is represented as a row-major array.
Nx | The transform size in X dimension (number of columns). Must be power-of-two and at least 2. |
Ny | The transform size in Y dimension (number of rows). Must be power-of-two and at least 2. |
direction | Forward (MUFFT_FORWARD) or inverse (MUFFT_INVERSE) transform. |
flags | Flags for the planning. See Planning options. |
NULL
if an error occured. mufft_plan_2d* mufft_create_plan_2d_c2r | ( | unsigned | Nx, |
unsigned | Ny, | ||
unsigned | flags | ||
) |
Create a plan for a 2D complex-to-real inverse FFT.
The input and output data to the 2D transform is represented as a row-major array.
Note that even if only N / 2 + 1 complex samples are required for a complex-to-real transform, the input array of the transform is still expected to contain N columns of padded complex data. This is to help SIMD optimization since N / 2 + 1 is odd and would require unaligned memory accesses to work properly. The output array needs a minimum size of 2 * Nx * Ny * sizeof(float) and not the expected Nx * Ny * sizeof(float). muFFT uses the output buffer as a scratch buffer during the FFT computation. The end result however, will only require Nx * Ny * sizeof(float) size.
Nx | The transform size in X dimension (number of columns). Must be power-of-two and at least 4. |
Ny | The transform size in Y dimension (number of rows). Must be power-of-two and at least 2. |
flags | Flags for the planning. See Planning options. |
NULL
if an error occured. mufft_plan_2d* mufft_create_plan_2d_r2c | ( | unsigned | Nx, |
unsigned | Ny, | ||
unsigned | flags | ||
) |
Create a plan for a 2D real-to-complex forward FFT.
The input and output data to the 2D transform is represented as a row-major array.
Note that even if only N / 2 + 1 complex samples are required for a real-to-complex transform, the output array of the transform is still expected to contain N columns of complex data. This is to help SIMD optimization since N / 2 + 1 is odd and would require unaligned memory accesses to work properly. The vertical transform will only transform the first N / 2 + D columns, where D is some convenient value which aligns well to the SIMD instruction set used. The full N complex samples can be processed vertically as well if MUFFT_FLAG_FULL_R2C is used.
Nx | The transform size in X dimension (number of columns). Must be power-of-two and at least 4. |
Ny | The transform size in Y dimension (number of rows). Must be power-of-two and at least 2. |
flags | Flags for the planning. See Planning options. If MUFFT_FLAG_FULL_R2C flag is added, the transform will output the full N complex frequency samples, instead of the minimum N / 2 + 1 samples. |
NULL
if an error occured. void mufft_execute_plan_2d | ( | mufft_plan_2d * | plan, |
void * | output, | ||
const void * | input | ||
) |
Executes a 2D FFT plan.
plan | Previously allocated 2D FFT plan. |
output | Output of the transform. The data must be aligned. See Memory allocation. |
input | Input to the transform. The data must be aligned. See Memory allocation. |
void mufft_free_plan_2d | ( | mufft_plan_2d * | plan | ) |
Free a previously allocated 2D FFT plan.
plan | A plan. May be NULL in which case nothing happens. |