FNFT
|
Files | |
file | fnft__fft_wrapper.h |
Wraps underlying FFT library. | |
file | fnft__fft_wrapper_plan_t.h |
Typedefs | |
typedef kiss_fft_cfg | fnft__fft_wrapper_plan_t |
Stores information needed by fnft__fft_wrapper_execute_plan to perform a (inverse) FFT. | |
Functions | |
static FNFT_UINT | fnft__fft_wrapper_next_fft_length (FNFT_UINT desired_length) |
Next valid number of samples for the FFT routines. More... | |
static fnft__fft_wrapper_plan_t | fnft__fft_wrapper_safe_plan_init () |
Value to initialize plan variables. More... | |
static FNFT_INT | fnft__fft_wrapper_create_plan (fnft__fft_wrapper_plan_t *plan_ptr, FNFT_UINT fft_length, FNFT_COMPLEX *in, FNFT_COMPLEX *out, FNFT_INT is_inverse) |
Prepares a new (inverse) fast Fourier transform (FFT). More... | |
static FNFT_INT | fnft__fft_wrapper_execute_plan (fnft__fft_wrapper_plan_t plan, FNFT_COMPLEX *in, FNFT_COMPLEX *out) |
Computes a fast Fourier transform (FFT). More... | |
static FNFT_INT | fnft__fft_wrapper_destroy_plan (fnft__fft_wrapper_plan_t *plan_ptr) |
Destroys a FFT plan when it is no longer needed. More... | |
static void * | fnft__fft_wrapper_malloc (FNFT_UINT size) |
Memory allocation for the FFT wrapper. More... | |
static void | fnft__fft_wrapper_free (void *ptr) |
Memory deallocation for the FFT wrapper. More... | |
|
inlinestatic |
Prepares a new (inverse) fast Fourier transform (FFT).
Plans can be reused as long as the parameters of the FFT (fft_length and is_inverse) do not change.
[in,out] | plan_ptr | Pointer a fnft__fft_wrapper_plan_t object. Will be changed by the routine. |
[in] | fft_length | Length of the (inverse) FFT to be computed. Must be generated using fnft__fft_wrapper_next_fft_length. |
[in,out] | in | Input buffer with fft_length entries. Initialize after creating the plan as it might be overwritten. Create with fnft__fft_wrapper_malloc to ensure correct alignment. |
[in,out] | out | Output buffer with fft_length enties. Initialize after creating the plan as it might be overwritten. Create with fnft__fft_wrapper_malloc to ensure correct alignment. |
[in] | is_inverse | -1 => forward FFT, 1 => inverse FFT. Note that the inverse FFT will not be normalized by the factor 1/fft_length. |
|
inlinestatic |
Destroys a FFT plan when it is no longer needed.
Frees any memory that was allocated when the plan was created, and sets the value of the plan to fnft__fft_wrapper_safe_plan_init to avoid errors when a plan is destroyed several times.
[in] | plan_ptr | Pointer to a plan object created with fnft__fft_wrapper_create_plan |
|
inlinestatic |
Computes a fast Fourier transform (FFT).
[in] | plan | Plan object created with fnft__fft_wrapper_create_plan |
[in] | in | Input buffer, not neccessarily the same that was used when creating the plan. The length however has to be the same. Create with fnft__fft_wrapper_malloc to ensure correct alignment. |
[out] | out | Output buffer, not neccessarily the same that was used when creating the plan. The length however has to be the same. Create with fnft__fft_wrapper_malloc to ensure correct alignment. |
|
inlinestatic |
Memory deallocation for the FFT wrapper.
Use this routine to deallocate memory that was allocated using fnft__fft_wrapper_malloc.
[in] | ptr | Pointer to memory block that is to be freed (or NULL). |
|
inlinestatic |
Memory allocation for the FFT wrapper.
Use this routine to allocate memory for the input and output buffers. It ensures proper alignment.
[in] | size | Number of points to be allocated. |
Next valid number of samples for the FFT routines.
Returns the next larger or equal valid number of samples accepted by fnft__fft_wrapper_create_plan.
[in] | desired_length | Desired number of samples |
|
inlinestatic |
Value to initialize plan variables.
To avoid having uninitialized plans, initialize new plans with the value returned by this function (usually, this is simply NULL).