48 return kiss_fft_next_fast_size(desired_length);
95 if (is_inverse != 1 && is_inverse != -1)
100 if (fft_length>INT_MAX)
102 *plan_ptr = fftw_plan_dft_1d((
int) fft_length, in, out, is_inverse, FFTW_ESTIMATE);
106 *plan_ptr = kiss_fft_alloc(fft_length,(
FNFT_UINT)(is_inverse+1)/2, NULL, NULL);
109 if (*plan_ptr == NULL)
135 fftw_execute_dft((fftw_plan)plan, (fftw_complex *)in, (fftw_complex *)out);
137 kiss_fft((kiss_fft_cfg)plan, (kiss_fft_cpx *)in, (kiss_fft_cpx *)out);
158 if (plan_ptr == NULL)
161 fftw_destroy_plan(*plan_ptr);
163 KISS_FFT_FREE(*plan_ptr);
181 return fftw_malloc(size);
183 return KISS_FFT_MALLOC(size);
205#ifdef FNFT_ENABLE_SHORT_NAMES
206#ifndef FNFT__FFT_WRAPPER_SHORT_NAMES
207#define FNFT__FFT_WRAPPER_SHORT_NAMES
208#define fft_wrapper_next_fft_length(...) fnft__fft_wrapper_next_fft_length(__VA_ARGS__)
209#define fft_wrapper_safe_plan_init(...) fnft__fft_wrapper_safe_plan_init(__VA_ARGS__)
210#define fft_wrapper_create_plan(...) fnft__fft_wrapper_create_plan(__VA_ARGS__)
211#define fft_wrapper_execute_plan(...) fnft__fft_wrapper_execute_plan(__VA_ARGS__)
212#define fft_wrapper_destroy_plan(...) fnft__fft_wrapper_destroy_plan(__VA_ARGS__)
213#define fft_wrapper_malloc(...) fnft__fft_wrapper_malloc(__VA_ARGS__)
214#define fft_wrapper_free(...) fnft__fft_wrapper_free(__VA_ARGS__)
#define FNFT_EC_ASSERTION_FAILED
Definition fnft_errwarn.h:94
#define FNFT_SUCCESS
Definition fnft_errwarn.h:44
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).
Definition fnft__fft_wrapper.h:128
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).
Definition fnft__fft_wrapper.h:84
static void fnft__fft_wrapper_free(void *ptr)
Memory deallocation for the FFT wrapper.
Definition fnft__fft_wrapper.h:196
static FNFT_UINT fnft__fft_wrapper_next_fft_length(FNFT_UINT desired_length)
Next valid number of samples for the FFT routines.
Definition fnft__fft_wrapper.h:44
static void * fnft__fft_wrapper_malloc(FNFT_UINT size)
Memory allocation for the FFT wrapper.
Definition fnft__fft_wrapper.h:178
kiss_fft_cfg fnft__fft_wrapper_plan_t
Stores information needed by fnft__fft_wrapper_execute_plan to perform a (inverse) FFT.
Definition fnft__fft_wrapper_plan_t.h:41
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.
Definition fnft__fft_wrapper.h:155
static fnft__fft_wrapper_plan_t fnft__fft_wrapper_safe_plan_init()
Value to initialize plan variables.
Definition fnft__fft_wrapper.h:58
size_t FNFT_UINT
Definition fnft_numtypes.h:62
double complex FNFT_COMPLEX
Definition fnft_numtypes.h:47
int32_t FNFT_INT
Definition fnft_numtypes.h:56
#define FNFT__E_NOMEM
Definition fnft__errwarn.h:42
#define FNFT__E_INVALID_ARGUMENT(name)
Definition fnft__errwarn.h:48