Project Ne10
An open, optimized software library for the ARM architecture.
NE10_fft.c
Go to the documentation of this file.
1 /*
2  * Copyright 2014-16 ARM Limited and Contributors.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of ARM Limited nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 /* license of Kiss FFT */
29 /*
30 Copyright (c) 2003-2010, Mark Borgerding
31 
32 All rights reserved.
33 
34 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
35 
36  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
37  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
38  * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission.
39 
40 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 */
42 
43 /*
44  * NE10 Library : dsp/NE10_fft.c
45  */
46 
47 #include "NE10_types.h"
48 #include "NE10_macros.h"
49 #include "NE10_fft.h"
50 
51 /*
52  * This function outputs a factor buffer ('facbuf') that decomposes an FFT of input size
53  * n into a number of radix-r butterfly calculations (for r in some set of radix values).
54  *
55  * Factor buffer layout:
56  * index 0: stage count
57  * index 1: stride for the first stage
58  * index 2 to (2*stage_count + 1): pairs of factors (number of sections, section size)
59  * index (2*stage_count + 2): an flag specifying which algorithm to use
60  *
61  * e.g. 1024 samples might result in the following five stage radix-4 factors buffer:
62  * [5, 256, 4, 256, 4, 64, 4, 16, 4, 4, 4, 1]
63  * i.e. 1024 = 4x256, each of which is 4x64, each of which is 4x16, each of which
64  * is 4x4, each of which is 4x1. There are 5 stages, and the stride for the
65  * first stage is 256 (1024 / 4, for radix-4).
66  *
67  * Only the leading 42 int32 is used to store factors.
68  * The left can be used as algorithm flags, or status flags.
69  * Even the leading bits of stage number can be reused.
70  */
72  ne10_int32_t * facbuf,
73  ne10_int32_t ne10_factor_flags)
74 {
75  // This is a workaround. We need to "return" some flags.
76  // Otherwise, we need to modify signature of ne10_factor.
77  assert (NE10_MAXFACTORS >= 32);
78 
79  if ((facbuf == NULL)
80  || (n <= 0))
81  {
82  return NE10_ERR;
83  }
84 
85  ne10_int32_t p;
86  ne10_int32_t i = 1;
87  ne10_int32_t stage_num = 0;
88  ne10_int32_t stride_max = n;
89 
90  // Default algorithm flag is NE10_FFT_ALG_DEFAULT
92 
93  // Factor out powers of 4, 2, 5, and 3. Additionally, factor out powers
94  // of 8 if the right factor flags are passed. If none of these factors
95  // can be applied at any stage, the remaining size is used as a factor.
96  do
97  {
98  // If NE10_FACTOR_EIGHT_FIRST_STAGE is enabled, we can generate
99  // a first stage of radix-8 (e.g. by combining one radix-4 and
100  // one radix-2 stage into a single radix-8 stage).
101  if ((ne10_factor_flags & NE10_FACTOR_EIGHT_FIRST_STAGE)
102  && ((n==8) || (n==40) || (n==24)))
103  {
104  switch (n)
105  {
106  case 8:
107  p = 8;
108  break;
109  case 24:
110  p = 3;
111  alg_flag = NE10_FFT_ALG_ANY;
112  break;
113  default: // n == 40
114  p = 5;
115  alg_flag = NE10_FFT_ALG_ANY;
116  break;
117  }
118  }
119  else if ((ne10_factor_flags & NE10_FACTOR_EIGHT) && ((n % 8) == 0))
120  {
121  p = 8;
122  }
123  else if ((n % 4) == 0)
124  {
125  p = 4;
126  }
127  else if ((n % 2) == 0)
128  {
129  p = 2;
130  }
131  else if ((n % 5) == 0)
132  {
133  p = 5;
134  alg_flag = NE10_FFT_ALG_ANY;
135  }
136  else if ((n % 3) == 0)
137  {
138  p = 3;
139  alg_flag = NE10_FFT_ALG_ANY;
140  }
141  else // stop factoring
142  {
143  p = n;
144  alg_flag = NE10_FFT_ALG_ANY;
145  }
146 
147  n /= p;
148  facbuf[2 * i] = p;
149  facbuf[2 * i + 1] = n;
150  i++;
151  stage_num++;
152  }
153  while (n > 1);
154  facbuf[0] = stage_num;
155  facbuf[1] = stride_max / p;
156 
157  if (stage_num > 21)
158  {
159  // Since nfft is ne10_int32_t, stage_num can never be greater than 21,
160  // because 3^21 > 2^32
161  return NE10_ERR;
162  }
163 
164  facbuf[2 * i] = alg_flag;
165  return NE10_OK;
166 }
167 
168 // Twiddles matrix [radix-1][mstride]
169 // First column (k == 0) is ignored because phase == 1, and
170 // twiddle = (1.0, 0.0).
172  const ne10_int32_t mstride,
173  const ne10_int32_t fstride,
174  const ne10_int32_t radix,
175  const ne10_int32_t nfft)
176 {
177  ne10_int32_t j, k;
178  ne10_float32_t phase;
179  const ne10_float64_t pi = NE10_PI;
180 
181  for (j = 0; j < mstride; j++)
182  {
183  for (k = 1; k < radix; k++) // phase = 1 when k = 0
184  {
185  phase = -2 * pi * fstride * k * j / nfft;
186  twiddles[mstride * (k - 1) + j].r = (ne10_float32_t) cos (phase);
187  twiddles[mstride * (k - 1) + j].i = (ne10_float32_t) sin (phase);
188  } // radix
189  } // mstride
190 }
191 
192 // Transposed twiddles matrix [mstride][radix-1]
193 // First row (k == 0) is ignored because phase == 1, and
194 // twiddle = (1.0, 0.0).
195 // Transposed twiddle tables are used in RFFT to avoid memory access by a large
196 // stride.
198  ne10_fft_cpx_float32_t* twiddles,
199  const ne10_int32_t mstride,
200  const ne10_int32_t fstride,
201  const ne10_int32_t radix,
202  const ne10_int32_t nfft)
203 {
204  ne10_int32_t j, k;
205  ne10_float32_t phase;
206  const ne10_float64_t pi = NE10_PI;
207 
208  for (j = 0; j < mstride; j++)
209  {
210  for (k = 1; k < radix; k++) // phase = 1 when k = 0
211  {
212  phase = -2 * pi * fstride * k * j / nfft;
213  twiddles[(radix - 1) * j + k - 1].r = (ne10_float32_t) cos (phase);
214  twiddles[(radix - 1) * j + k - 1].i = (ne10_float32_t) sin (phase);
215  } // radix
216  } // mstride
217 }
218 
219 // Twiddles matrix [mstride][radix-1]
220 // First column (k == 0)is ignored because phase == 1, and
221 // twiddle = (1.0, 0.0).
222 static void ne10_fft_generate_twiddles_line_int32 (ne10_fft_cpx_int32_t * twiddles,
223  const ne10_int32_t mstride,
224  const ne10_int32_t fstride,
225  const ne10_int32_t radix,
226  const ne10_int32_t nfft)
227 {
228  ne10_int32_t j, k;
229  ne10_float32_t phase;
230  const ne10_float64_t pi = NE10_PI;
231 
232  for (j = 0; j < mstride; j++)
233  {
234  for (k = 1; k < radix; k++) // phase = 1 when k = 0
235  {
236  phase = -2 * pi * fstride * k * j / nfft;
237 
238  ne10_fft_cpx_int32_t *tw = &twiddles[mstride * (k - 1) + j];
239 
240  tw->r = (ne10_int32_t) floor (0.5f + NE10_F2I32_MAX * cos(phase));
241  tw->i = (ne10_int32_t) floor (0.5f + NE10_F2I32_MAX * sin(phase));
242  } // radix
243  } // mstride
244 }
245 
247  const ne10_int32_t * factors,
248  const ne10_int32_t nfft )
249 {
250  ne10_int32_t stage_count = factors[0];
251  ne10_int32_t fstride = factors[1];
252  ne10_int32_t mstride;
253  ne10_int32_t cur_radix; // current radix
254 
255  // for first stage
256  cur_radix = factors[2 * stage_count];
257  if (cur_radix % 2) // current radix is not 4 or 2
258  {
259  twiddles += 1;
260  ne10_fft_generate_twiddles_line_int32 (twiddles, 1, fstride, cur_radix, nfft);
261  twiddles += cur_radix - 1;
262  }
263  stage_count--;
264 
265  // for other stage
266  for (; stage_count > 0; stage_count--)
267  {
268  cur_radix = factors[2 * stage_count];
269  fstride /= cur_radix;
270  mstride = factors[2 * stage_count + 1];
271  ne10_fft_generate_twiddles_line_int32 (twiddles, mstride, fstride, cur_radix, nfft);
272  twiddles += mstride * (cur_radix - 1);
273  } // stage_count
274 
275  return twiddles;
276 }
277 
279  const ne10_int32_t,
280  const ne10_int32_t,
281  const ne10_int32_t,
282  const ne10_int32_t);
283 
285  line_generator_float32 generator,
286  ne10_fft_cpx_float32_t * twiddles,
287  const ne10_int32_t * factors,
288  const ne10_int32_t nfft)
289 {
290  ne10_int32_t stage_count = factors[0];
291  ne10_int32_t fstride = factors[1];
292  ne10_int32_t mstride;
293  ne10_int32_t cur_radix; // current radix
294 
295  // for first stage
296  cur_radix = factors[2 * stage_count];
297  if (cur_radix % 2) // current radix is not 4 or 2
298  {
299  twiddles[0].r = 1.0;
300  twiddles[0].i = 0.0;
301  twiddles += 1;
302  generator (twiddles, 1, fstride, cur_radix, nfft);
303  twiddles += cur_radix - 1;
304  }
305  stage_count --;
306 
307  // for other stage
308  for (; stage_count > 0; stage_count --)
309  {
310  cur_radix = factors[2 * stage_count];
311  fstride /= cur_radix;
312  mstride = factors[2 * stage_count + 1];
313  generator (twiddles, mstride, fstride, cur_radix, nfft);
314  twiddles += mstride * (cur_radix - 1);
315  } // stage_count
316 
317  return twiddles;
318 }
319 
321  const ne10_int32_t * factors,
322  const ne10_int32_t nfft )
323 {
325  twiddles = ne10_fft_generate_twiddles_impl_float32(generator,
326  twiddles, factors, nfft);
327  return twiddles;
328 }
329 
331  ne10_fft_cpx_float32_t * twiddles,
332  const ne10_int32_t * factors,
333  const ne10_int32_t nfft)
334 {
335  line_generator_float32 generator =
337  twiddles = ne10_fft_generate_twiddles_impl_float32(generator,
338  twiddles, factors, nfft);
339  return twiddles;
340 }
341 
349 {
350  // For input shorter than 15, fall back to c version.
351  // We would not get much improvement from NEON for these cases.
352  if (nfft < 15)
353  {
354  return ne10_fft_alloc_c2c_float32_c (nfft);
355  }
356 
357  ne10_fft_cfg_float32_t st = NULL;
358  ne10_uint32_t memneeded = sizeof (ne10_fft_state_float32_t)
359  + sizeof (ne10_int32_t) * (NE10_MAXFACTORS * 2) /* factors */
360  + sizeof (ne10_fft_cpx_float32_t) * nfft /* twiddles */
361  + sizeof (ne10_fft_cpx_float32_t) * nfft /* buffer */
362  + NE10_FFT_BYTE_ALIGNMENT; /* 64-bit alignment */
363 
364  st = (ne10_fft_cfg_float32_t) NE10_MALLOC (memneeded);
365 
366  // Only backward FFT is scaled by default.
367  st->is_forward_scaled = 0;
368  st->is_backward_scaled = 1;
369 
370  // Bad allocation.
371  if (st == NULL)
372  {
373  return NULL;
374  }
375 
376  uintptr_t address = (uintptr_t) st + sizeof (ne10_fft_state_float32_t);
378  st->factors = (ne10_int32_t*) address;
380  st->buffer = st->twiddles + nfft;
381 
382  // st->last_twiddles is default NULL.
383  // Calling fft_c or fft_neon is decided by this pointers.
384  st->last_twiddles = NULL;
385 
386  st->nfft = nfft;
387  if (nfft % NE10_FFT_PARA_LEVEL == 0)
388  {
389  // Size of FFT satisfies requirement of NEON optimization.
390  st->nfft /= NE10_FFT_PARA_LEVEL;
391  st->last_twiddles = st->twiddles + nfft / NE10_FFT_PARA_LEVEL;
392  }
393 
395 
396  // Cannot factor
397  if (result == NE10_ERR)
398  {
399  NE10_FREE (st);
400  return NULL;
401  }
402 
403  ne10_int32_t stage_count = st->factors[0];
404  ne10_int32_t algorithm_flag = st->factors[2 * (stage_count + 1)];
405 
406  if (algorithm_flag == NE10_FFT_ALG_ANY)
407  {
408  if (nfft % NE10_FFT_PARA_LEVEL)
409  {
410  NE10_FREE (st);
411  return NULL;
412  }
413 
415 
416  // Generate super twiddles for the last stage.
418  st->nfft,
419  1,
420  NE10_FFT_PARA_LEVEL,
421  nfft);
422  st->nfft *= NE10_FFT_PARA_LEVEL;
423  }
424  else
425  {
426  if (nfft % NE10_FFT_PARA_LEVEL == 0)
427  {
428  st->nfft = nfft;
429  st->last_twiddles = NULL;
430 
431  // Adjust the factoring for a size "nfft / 4" FFT to work for size "nfft"
432  if (stage_count > NE10_MAXFACTORS - 4)
433  {
434  NE10_FREE (st);
435  return NULL;
436  }
437  st->factors[0]++; // Bump the stage count
438  st->factors[1] *= 4; // Quadruple the first stage stride
439  memmove(&st->factors[4], &st->factors[2], ((2 * (stage_count + 1)) - 1) * sizeof(st->factors[0]));
440  st->factors[2] = 4; // Add a new radix-4 stage
441  st->factors[3] = nfft / 4;
442  }
443 
445  }
446 
447  return st;
448 }
449 
452 {
453  // For input shorter than 15, fall back to c version.
454  // We would not get much improvement from NEON for these cases.
455  if (nfft < 15)
456  {
457  return ne10_fft_alloc_c2c_int32_c (nfft);
458  }
459 
460  ne10_fft_cfg_int32_t st = NULL;
461  ne10_uint32_t memneeded = sizeof (ne10_fft_state_int32_t)
462  + sizeof (ne10_int32_t) * (NE10_MAXFACTORS * 2) /* factors */
463  + sizeof (ne10_fft_cpx_int32_t) * nfft /* twiddles */
464  + sizeof (ne10_fft_cpx_int32_t) * nfft /* buffer */
465  + NE10_FFT_BYTE_ALIGNMENT; /* 64-bit alignment */
466 
467  st = (ne10_fft_cfg_int32_t) NE10_MALLOC (memneeded);
468 
469  // Bad allocation.
470  if (st == NULL)
471  {
472  return NULL;
473  }
474 
475  uintptr_t address = (uintptr_t) st + sizeof (ne10_fft_state_int32_t);
477  st->factors = (ne10_int32_t*) address;
478  st->twiddles = (ne10_fft_cpx_int32_t*) (st->factors + (NE10_MAXFACTORS * 2));
479  st->buffer = st->twiddles + nfft;
480 
481  // st->last_twiddles is default NULL.
482  // Calling fft_c or fft_neon is decided by this pointers.
483  st->last_twiddles = NULL;
484 
485  st->nfft = nfft;
486  if (nfft % NE10_FFT_PARA_LEVEL == 0)
487  {
488  // Size of FFT satisfies requirement of NEON optimization.
489  st->nfft /= NE10_FFT_PARA_LEVEL;
490  st->last_twiddles = st->twiddles + nfft / NE10_FFT_PARA_LEVEL;
491  }
492 
494 
495  // Cannot factor
496  if (result == NE10_ERR)
497  {
498  NE10_FREE (st);
499  return NULL;
500  }
501 
502  ne10_int32_t stage_count = st->factors[0];
503  ne10_int32_t algorithm_flag = st->factors[2 * (stage_count + 1)];
504 
505  if (algorithm_flag == NE10_FFT_ALG_ANY)
506  {
507  // Disable radix 8 for INT32 generic FFTs (it isn't supported)
508  result = ne10_factor (st->nfft, st->factors, NE10_FACTOR_DEFAULT);
509  if ((result == NE10_ERR) || (nfft % NE10_FFT_PARA_LEVEL))
510  {
511  NE10_FREE (st);
512  return NULL;
513  }
514 
516 
517  // Generate super twiddles for the last stage.
518  ne10_fft_generate_twiddles_line_int32 (st->last_twiddles,
519  st->nfft,
520  1,
521  NE10_FFT_PARA_LEVEL,
522  nfft);
523  st->nfft *= NE10_FFT_PARA_LEVEL;
524  }
525  else
526  {
527  if (nfft % NE10_FFT_PARA_LEVEL == 0)
528  {
529  st->nfft = nfft;
530  st->last_twiddles = NULL;
531 
532  // Adjust the factoring for a size "nfft / 4" FFT to work for size "nfft"
533  if (stage_count > NE10_MAXFACTORS - 4)
534  {
535  NE10_FREE (st);
536  return NULL;
537  }
538  st->factors[0]++; // Bump the stage count
539  st->factors[1] *= 4; // Quadruple the first stage stride
540  memmove(&st->factors[4], &st->factors[2], ((2 * (stage_count + 1)) - 1) * sizeof(st->factors[0]));
541  st->factors[2] = 4; // Add a new radix-4 stage
542  st->factors[3] = nfft / 4;
543  }
544 
546  }
547 
548  return st;
549 }
550 
557 {
558  free(cfg);
559 }
560 
567 {
568  free (cfg);
569 }
570 
577 {
578  free (cfg);
579 }
580  // C2C_FFT_IFFT
582 
594 {
595  free(cfg);
596 }
597 
604 {
605  free (cfg);
606 }
607 
614 {
615  free (cfg);
616 }
617  // R2C_FFT_IFFT
#define NE10_FFT_ALG_DEFAULT
Definition: NE10_fft.h:57
ne10_int32_t is_backward_scaled
Flag to control scaling behaviour in backward floating point complex FFT.
Definition: NE10_types.h:261
#define NE10_FFT_PARA_LEVEL
Definition: NE10_fft.h:79
ne10_fft_cpx_int32_t * twiddles
Definition: NE10_types.h:335
void ne10_fft_destroy_r2c_int16(ne10_fft_r2c_cfg_int16_t)
Destroys the configuration structure allocated by ne10_fft_alloc_r2c_int16 (frees memory...
Definition: NE10_fft.c:613
#define NE10_MAXFACTORS
Structure for the floating point FFT function.
Definition: NE10_types.h:229
int32_t ne10_int32_t
Definition: NE10_types.h:76
void ne10_fft_generate_twiddles_line_transposed_float32(ne10_fft_cpx_float32_t *twiddles, const ne10_int32_t mstride, const ne10_int32_t fstride, const ne10_int32_t radix, const ne10_int32_t nfft)
Definition: NE10_fft.c:197
void ne10_fft_destroy_r2c_int32(ne10_fft_r2c_cfg_int32_t)
Destroys the configuration structure allocated by ne10_fft_alloc_r2c_int32 (frees memory...
Definition: NE10_fft.c:603
ne10_int32_t ne10_factor(ne10_int32_t n, ne10_int32_t *facbuf, ne10_int32_t ne10_factor_flags)
Definition: NE10_fft.c:71
float ne10_float32_t
Definition: NE10_types.h:80
ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_neon(ne10_int32_t nfft)
Specific implementation of ne10_fft_alloc_c2c_float32 for ne10_fft_c2c_1d_float32_neon.
Definition: NE10_fft.c:348
ne10_fft_cpx_float32_t * ne10_fft_generate_twiddles_impl_float32(line_generator_float32 generator, ne10_fft_cpx_float32_t *twiddles, const ne10_int32_t *factors, const ne10_int32_t nfft)
Definition: NE10_fft.c:284
Structure for the floating point FFT state.
Definition: NE10_types.h:239
void ne10_fft_destroy_r2c_float32(ne10_fft_r2c_cfg_float32_t)
Destroys the configuration structure allocated by ne10_fft_alloc_r2c_float32 (frees memory...
Definition: NE10_fft.c:593
#define NE10_FFT_BYTE_ALIGNMENT
Definition: NE10_fft.h:45
ne10_fft_cpx_int32_t * ne10_fft_generate_twiddles_int32(ne10_fft_cpx_int32_t *twiddles, const ne10_int32_t *factors, const ne10_int32_t nfft)
Definition: NE10_fft.c:246
ne10_int32_t * factors
Definition: NE10_types.h:242
ne10_fft_state_float32_t * ne10_fft_cfg_float32_t
Configuration structure for floating point FFT.
Definition: NE10_types.h:267
uint32_t ne10_uint32_t
Definition: NE10_types.h:77
#define NE10_PI
NE10 defines a number of macros for use in its function signatures.
Definition: NE10_macros.h:47
ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_neon(ne10_int32_t nfft)
Specific implementation of ne10_fft_alloc_c2c_int32 for ne10_fft_c2c_1d_int32_neon.
Definition: NE10_fft.c:451
ne10_fft_cpx_float32_t * ne10_fft_generate_twiddles_transposed_float32(ne10_fft_cpx_float32_t *twiddles, const ne10_int32_t *factors, const ne10_int32_t nfft)
Definition: NE10_fft.c:330
ne10_fft_cpx_float32_t * twiddles
Definition: NE10_types.h:243
ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_c(ne10_int32_t nfft)
Specific implementation of ne10_fft_alloc_c2c_float32 for ne10_fft_c2c_1d_float32_c.
#define NE10_FREE(p)
Definition: NE10_macros.h:54
ne10_fft_cpx_float32_t * last_twiddles
Definition: NE10_types.h:245
Structure for the 32-bit fixed point FFT function.
Definition: NE10_types.h:325
ne10_int32_t i
Definition: NE10_types.h:328
void ne10_fft_generate_twiddles_line_float32(ne10_fft_cpx_float32_t *twiddles, const ne10_int32_t mstride, const ne10_int32_t fstride, const ne10_int32_t radix, const ne10_int32_t nfft)
Definition: NE10_fft.c:171
ne10_int32_t * factors
Definition: NE10_types.h:334
void ne10_fft_destroy_c2c_int32(ne10_fft_cfg_int32_t)
Destroys the configuration structure allocated by variants of ne10_fft_alloc_c2c_int32 (frees memory...
Definition: NE10_fft.c:566
void ne10_fft_destroy_c2c_float32(ne10_fft_cfg_float32_t)
Destroys the configuration structure allocated by variants of ne10_fft_alloc_c2c_float32 (frees memor...
Definition: NE10_fft.c:556
#define NE10_FACTOR_EIGHT_FIRST_STAGE
Definition: NE10_fft.h:72
ne10_fft_cpx_float32_t * ne10_fft_generate_twiddles_float32(ne10_fft_cpx_float32_t *twiddles, const ne10_int32_t *factors, const ne10_int32_t nfft)
Definition: NE10_fft.c:320
#define NE10_FFT_ALG_ANY
Definition: NE10_fft.h:58
#define NE10_F2I32_MAX
Definition: NE10_macros.h:81
ne10_fft_cpx_int32_t * buffer
Definition: NE10_types.h:336
#define NE10_MALLOC
Definition: NE10_macros.h:53
#define NE10_BYTE_ALIGNMENT(address, alignment)
Definition: NE10_macros.h:63
#define NE10_ERR
Definition: NE10_types.h:66
ne10_int32_t r
Definition: NE10_types.h:327
double ne10_float64_t
Definition: NE10_types.h:81
#define NE10_OK
Definition: NE10_types.h:65
ne10_float32_t i
Definition: NE10_types.h:233
ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_c(ne10_int32_t nfft)
Specific implementation of ne10_fft_alloc_c2c_int32 for ne10_fft_c2c_1d_int32_c.
ne10_fft_cpx_float32_t * buffer
Definition: NE10_types.h:244
void ne10_fft_destroy_c2c_int16(ne10_fft_cfg_int16_t)
Destroys the configuration structure allocated by ne10_fft_alloc_c2c_int16 (frees memory...
Definition: NE10_fft.c:576
#define NE10_FACTOR_EIGHT
Definition: NE10_fft.h:73
ne10_int32_t is_forward_scaled
Flag to control scaling behaviour in forward floating point complex FFT.
Definition: NE10_types.h:253
ne10_fft_cpx_int32_t * last_twiddles
Definition: NE10_types.h:337
ne10_float32_t r
Definition: NE10_types.h:232
void(* line_generator_float32)(ne10_fft_cpx_float32_t *, const ne10_int32_t, const ne10_int32_t, const ne10_int32_t, const ne10_int32_t)
Definition: NE10_fft.c:278
#define NE10_FACTOR_DEFAULT
Definition: NE10_fft.h:71
ne10_fft_state_int32_t * ne10_fft_cfg_int32_t
Definition: NE10_types.h:340