31 size_t subsize, memneeded;
34 fprintf(stderr,
"Real FFT optimization must be even.\n");
40 memneeded =
sizeof(
struct kiss_fftr_state) + subsize + sizeof(kiss_fft_cpx) * ( nfft * 3 / 2);
45 if (*lenmem >= memneeded)
57 for (i = 0; i < nfft/2; ++i) {
59 -3.14159265358979323846264338327 * ((double) (i+1) / nfft + .5);
74 fprintf(stderr,
"kiss fft usage error: improper alloc\n");
97 freqdata[0].
r = tdc.
r + tdc.
i;
98 freqdata[ncfft].
r = tdc.
r - tdc.
i;
100 freqdata[ncfft].
i = freqdata[0].
i = _mm_set1_ps(0);
102 freqdata[ncfft].
i = freqdata[0].
i = 0;
105 for ( k=1;k <= ncfft/2 ; ++k ) {
112 C_ADD( f1k, fpk , fpnk );
113 C_SUB( f2k, fpk , fpnk );
129 fprintf (stderr,
"kiss fft usage error: improper alloc\n");
135 st->
tmpbuf[0].
r = freqdata[0].
r + freqdata[ncfft].
r;
136 st->
tmpbuf[0].
i = freqdata[0].
r - freqdata[ncfft].
r;
139 for (k = 1; k <= ncfft / 2; ++k) {
142 fnkc.
r = freqdata[ncfft - k].
r;
143 fnkc.
i = -freqdata[ncfft - k].
i;
147 C_ADD (fek, fk, fnkc);
148 C_SUB (tmp, fk, fnkc);
153 st->
tmpbuf[ncfft - k].
i *= _mm_set1_ps(-1.0);
kiss_fftr_cfg kiss_fftr_alloc(int nfft, int inverse_fft, void *mem, size_t *lenmem)
#define kf_cexp(x, phase)
void kiss_fftr(kiss_fftr_cfg st, const float *timedata, kiss_fft_cpx *freqdata)
kiss_fft_cpx * super_twiddles
struct kiss_fft_state * kiss_fft_cfg
#define CHECK_OVERFLOW_OP(a, op, b)
kiss_fft_cfg kiss_fft_alloc(int nfft, int inverse_fft, void *mem, size_t *lenmem)
void kiss_fft(kiss_fft_cfg cfg, const kiss_fft_cpx *fin, kiss_fft_cpx *fout)
void kiss_fftri(kiss_fftr_cfg st, const kiss_fft_cpx *freqdata, float *timedata)
struct kiss_fftr_state * kiss_fftr_cfg