130
126
spx_drft_backward((struct drft_lookup *)table, out);
129
#elif defined(USE_INTEL_MKL)
133
DFTI_DESCRIPTOR_HANDLE desc;
137
void *spx_fft_init(int size)
139
struct mkl_config *table = (struct mkl_config *) speex_alloc(sizeof(struct mkl_config));
141
DftiCreateDescriptor(&table->desc, DFTI_SINGLE, DFTI_REAL, 1, size);
142
DftiSetValue(table->desc, DFTI_PACKED_FORMAT, DFTI_PACK_FORMAT);
143
DftiSetValue(table->desc, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
144
DftiSetValue(table->desc, DFTI_FORWARD_SCALE, 1.0f / size);
145
DftiCommitDescriptor(table->desc);
149
void spx_fft_destroy(void *table)
151
struct mkl_config *t = (struct mkl_config *) table;
152
DftiFreeDescriptor(t->desc);
156
void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out)
158
struct mkl_config *t = (struct mkl_config *) table;
159
DftiComputeForward(t->desc, in, out);
162
void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out)
164
struct mkl_config *t = (struct mkl_config *) table;
165
DftiComputeBackward(t->desc, in, out);
168
#elif defined(USE_GPL_FFTW3)
180
void *spx_fft_init(int size)
182
struct fftw_config *table = (struct fftw_config *) speex_alloc(sizeof(struct fftw_config));
183
table->in = fftwf_malloc(sizeof(float) * (size+2));
184
table->out = fftwf_malloc(sizeof(float) * (size+2));
186
table->fft = fftwf_plan_dft_r2c_1d(size, table->in, (fftwf_complex *) table->out, FFTW_PATIENT);
187
table->ifft = fftwf_plan_dft_c2r_1d(size, (fftwf_complex *) table->in, table->out, FFTW_PATIENT);
193
void spx_fft_destroy(void *table)
195
struct fftw_config *t = (struct fftw_config *) table;
196
fftwf_destroy_plan(t->fft);
197
fftwf_destroy_plan(t->ifft);
204
void spx_fft(void *table, spx_word16_t *in, spx_word16_t *out)
207
struct fftw_config *t = (struct fftw_config *) table;
210
float *optr = t->out;
211
const float m = 1.0 / N;
215
fftwf_execute(t->fft);
222
void spx_ifft(void *table, spx_word16_t *in, spx_word16_t *out)
225
struct fftw_config *t = (struct fftw_config *) table;
228
float *optr = t->out;
236
fftwf_execute(t->ifft);
133
242
#elif defined(USE_KISS_FFT)
135
244
#include "kiss_fftr.h"