arm_cfft_f32.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. /* ----------------------------------------------------------------------
  2. * Project: CMSIS DSP Library
  3. * Title: arm_cfft_f32.c
  4. * Description: Combined Radix Decimation in Frequency CFFT Floating point processing function
  5. *
  6. * $Date: 18. March 2019
  7. * $Revision: V1.6.0
  8. *
  9. * Target Processor: Cortex-M cores
  10. * -------------------------------------------------------------------- */
  11. /*
  12. * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.
  13. *
  14. * SPDX-License-Identifier: Apache-2.0
  15. *
  16. * Licensed under the Apache License, Version 2.0 (the License); you may
  17. * not use this file except in compliance with the License.
  18. * You may obtain a copy of the License at
  19. *
  20. * www.apache.org/licenses/LICENSE-2.0
  21. *
  22. * Unless required by applicable law or agreed to in writing, software
  23. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  24. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  25. * See the License for the specific language governing permissions and
  26. * limitations under the License.
  27. */
  28. #include "arm_math.h"
  29. #include "arm_common_tables.h"
  30. extern void arm_radix8_butterfly_f32(
  31. float32_t * pSrc,
  32. uint16_t fftLen,
  33. const float32_t * pCoef,
  34. uint16_t twidCoefModifier);
  35. extern void arm_bitreversal_32(
  36. uint32_t * pSrc,
  37. const uint16_t bitRevLen,
  38. const uint16_t * pBitRevTable);
  39. /**
  40. @ingroup groupTransforms
  41. */
  42. /**
  43. @defgroup ComplexFFT Complex FFT Functions
  44. @par
  45. The Fast Fourier Transform (FFT) is an efficient algorithm for computing the
  46. Discrete Fourier Transform (DFT). The FFT can be orders of magnitude faster
  47. than the DFT, especially for long lengths.
  48. The algorithms described in this section
  49. operate on complex data. A separate set of functions is devoted to handling
  50. of real sequences.
  51. @par
  52. There are separate algorithms for handling floating-point, Q15, and Q31 data
  53. types. The algorithms available for each data type are described next.
  54. @par
  55. The FFT functions operate in-place. That is, the array holding the input data
  56. will also be used to hold the corresponding result. The input data is complex
  57. and contains <code>2*fftLen</code> interleaved values as shown below.
  58. <pre>{real[0], imag[0], real[1], imag[1], ...} </pre>
  59. The FFT result will be contained in the same array and the frequency domain
  60. values will have the same interleaving.
  61. @par Floating-point
  62. The floating-point complex FFT uses a mixed-radix algorithm. Multiple radix-8
  63. stages are performed along with a single radix-2 or radix-4 stage, as needed.
  64. The algorithm supports lengths of [16, 32, 64, ..., 4096] and each length uses
  65. a different twiddle factor table.
  66. @par
  67. The function uses the standard FFT definition and output values may grow by a
  68. factor of <code>fftLen</code> when computing the forward transform. The
  69. inverse transform includes a scale of <code>1/fftLen</code> as part of the
  70. calculation and this matches the textbook definition of the inverse FFT.
  71. @par
  72. Pre-initialized data structures containing twiddle factors and bit reversal
  73. tables are provided and defined in <code>arm_const_structs.h</code>. Include
  74. this header in your function and then pass one of the constant structures as
  75. an argument to arm_cfft_f32. For example:
  76. @par
  77. <code>arm_cfft_f32(arm_cfft_sR_f32_len64, pSrc, 1, 1)</code>
  78. @par
  79. computes a 64-point inverse complex FFT including bit reversal.
  80. The data structures are treated as constant data and not modified during the
  81. calculation. The same data structure can be reused for multiple transforms
  82. including mixing forward and inverse transforms.
  83. @par
  84. Earlier releases of the library provided separate radix-2 and radix-4
  85. algorithms that operated on floating-point data. These functions are still
  86. provided but are deprecated. The older functions are slower and less general
  87. than the new functions.
  88. @par
  89. An example of initialization of the constants for the arm_cfft_f32 function follows:
  90. @code
  91. const static arm_cfft_instance_f32 *S;
  92. ...
  93. switch (length) {
  94. case 16:
  95. S = &arm_cfft_sR_f32_len16;
  96. break;
  97. case 32:
  98. S = &arm_cfft_sR_f32_len32;
  99. break;
  100. case 64:
  101. S = &arm_cfft_sR_f32_len64;
  102. break;
  103. case 128:
  104. S = &arm_cfft_sR_f32_len128;
  105. break;
  106. case 256:
  107. S = &arm_cfft_sR_f32_len256;
  108. break;
  109. case 512:
  110. S = &arm_cfft_sR_f32_len512;
  111. break;
  112. case 1024:
  113. S = &arm_cfft_sR_f32_len1024;
  114. break;
  115. case 2048:
  116. S = &arm_cfft_sR_f32_len2048;
  117. break;
  118. case 4096:
  119. S = &arm_cfft_sR_f32_len4096;
  120. break;
  121. }
  122. @endcode
  123. @par Q15 and Q31
  124. The floating-point complex FFT uses a mixed-radix algorithm. Multiple radix-4
  125. stages are performed along with a single radix-2 stage, as needed.
  126. The algorithm supports lengths of [16, 32, 64, ..., 4096] and each length uses
  127. a different twiddle factor table.
  128. @par
  129. The function uses the standard FFT definition and output values may grow by a
  130. factor of <code>fftLen</code> when computing the forward transform. The
  131. inverse transform includes a scale of <code>1/fftLen</code> as part of the
  132. calculation and this matches the textbook definition of the inverse FFT.
  133. @par
  134. Pre-initialized data structures containing twiddle factors and bit reversal
  135. tables are provided and defined in <code>arm_const_structs.h</code>. Include
  136. this header in your function and then pass one of the constant structures as
  137. an argument to arm_cfft_q31. For example:
  138. @par
  139. <code>arm_cfft_q31(arm_cfft_sR_q31_len64, pSrc, 1, 1)</code>
  140. @par
  141. computes a 64-point inverse complex FFT including bit reversal.
  142. The data structures are treated as constant data and not modified during the
  143. calculation. The same data structure can be reused for multiple transforms
  144. including mixing forward and inverse transforms.
  145. @par
  146. Earlier releases of the library provided separate radix-2 and radix-4
  147. algorithms that operated on floating-point data. These functions are still
  148. provided but are deprecated. The older functions are slower and less general
  149. than the new functions.
  150. @par
  151. An example of initialization of the constants for the arm_cfft_q31 function follows:
  152. @code
  153. const static arm_cfft_instance_q31 *S;
  154. ...
  155. switch (length) {
  156. case 16:
  157. S = &arm_cfft_sR_q31_len16;
  158. break;
  159. case 32:
  160. S = &arm_cfft_sR_q31_len32;
  161. break;
  162. case 64:
  163. S = &arm_cfft_sR_q31_len64;
  164. break;
  165. case 128:
  166. S = &arm_cfft_sR_q31_len128;
  167. break;
  168. case 256:
  169. S = &arm_cfft_sR_q31_len256;
  170. break;
  171. case 512:
  172. S = &arm_cfft_sR_q31_len512;
  173. break;
  174. case 1024:
  175. S = &arm_cfft_sR_q31_len1024;
  176. break;
  177. case 2048:
  178. S = &arm_cfft_sR_q31_len2048;
  179. break;
  180. case 4096:
  181. S = &arm_cfft_sR_q31_len4096;
  182. break;
  183. }
  184. @endcode
  185. */
  186. void arm_cfft_radix8by2_f32 (arm_cfft_instance_f32 * S, float32_t * p1)
  187. {
  188. uint32_t L = S->fftLen;
  189. float32_t * pCol1, * pCol2, * pMid1, * pMid2;
  190. float32_t * p2 = p1 + L;
  191. const float32_t * tw = (float32_t *) S->pTwiddle;
  192. float32_t t1[4], t2[4], t3[4], t4[4], twR, twI;
  193. float32_t m0, m1, m2, m3;
  194. uint32_t l;
  195. pCol1 = p1;
  196. pCol2 = p2;
  197. /* Define new length */
  198. L >>= 1;
  199. /* Initialize mid pointers */
  200. pMid1 = p1 + L;
  201. pMid2 = p2 + L;
  202. /* do two dot Fourier transform */
  203. for (l = L >> 2; l > 0; l-- )
  204. {
  205. t1[0] = p1[0];
  206. t1[1] = p1[1];
  207. t1[2] = p1[2];
  208. t1[3] = p1[3];
  209. t2[0] = p2[0];
  210. t2[1] = p2[1];
  211. t2[2] = p2[2];
  212. t2[3] = p2[3];
  213. t3[0] = pMid1[0];
  214. t3[1] = pMid1[1];
  215. t3[2] = pMid1[2];
  216. t3[3] = pMid1[3];
  217. t4[0] = pMid2[0];
  218. t4[1] = pMid2[1];
  219. t4[2] = pMid2[2];
  220. t4[3] = pMid2[3];
  221. *p1++ = t1[0] + t2[0];
  222. *p1++ = t1[1] + t2[1];
  223. *p1++ = t1[2] + t2[2];
  224. *p1++ = t1[3] + t2[3]; /* col 1 */
  225. t2[0] = t1[0] - t2[0];
  226. t2[1] = t1[1] - t2[1];
  227. t2[2] = t1[2] - t2[2];
  228. t2[3] = t1[3] - t2[3]; /* for col 2 */
  229. *pMid1++ = t3[0] + t4[0];
  230. *pMid1++ = t3[1] + t4[1];
  231. *pMid1++ = t3[2] + t4[2];
  232. *pMid1++ = t3[3] + t4[3]; /* col 1 */
  233. t4[0] = t4[0] - t3[0];
  234. t4[1] = t4[1] - t3[1];
  235. t4[2] = t4[2] - t3[2];
  236. t4[3] = t4[3] - t3[3]; /* for col 2 */
  237. twR = *tw++;
  238. twI = *tw++;
  239. /* multiply by twiddle factors */
  240. m0 = t2[0] * twR;
  241. m1 = t2[1] * twI;
  242. m2 = t2[1] * twR;
  243. m3 = t2[0] * twI;
  244. /* R = R * Tr - I * Ti */
  245. *p2++ = m0 + m1;
  246. /* I = I * Tr + R * Ti */
  247. *p2++ = m2 - m3;
  248. /* use vertical symmetry */
  249. /* 0.9988 - 0.0491i <==> -0.0491 - 0.9988i */
  250. m0 = t4[0] * twI;
  251. m1 = t4[1] * twR;
  252. m2 = t4[1] * twI;
  253. m3 = t4[0] * twR;
  254. *pMid2++ = m0 - m1;
  255. *pMid2++ = m2 + m3;
  256. twR = *tw++;
  257. twI = *tw++;
  258. m0 = t2[2] * twR;
  259. m1 = t2[3] * twI;
  260. m2 = t2[3] * twR;
  261. m3 = t2[2] * twI;
  262. *p2++ = m0 + m1;
  263. *p2++ = m2 - m3;
  264. m0 = t4[2] * twI;
  265. m1 = t4[3] * twR;
  266. m2 = t4[3] * twI;
  267. m3 = t4[2] * twR;
  268. *pMid2++ = m0 - m1;
  269. *pMid2++ = m2 + m3;
  270. }
  271. /* first col */
  272. arm_radix8_butterfly_f32 (pCol1, L, (float32_t *) S->pTwiddle, 2U);
  273. /* second col */
  274. arm_radix8_butterfly_f32 (pCol2, L, (float32_t *) S->pTwiddle, 2U);
  275. }
  276. void arm_cfft_radix8by4_f32 (arm_cfft_instance_f32 * S, float32_t * p1)
  277. {
  278. uint32_t L = S->fftLen >> 1;
  279. float32_t * pCol1, *pCol2, *pCol3, *pCol4, *pEnd1, *pEnd2, *pEnd3, *pEnd4;
  280. const float32_t *tw2, *tw3, *tw4;
  281. float32_t * p2 = p1 + L;
  282. float32_t * p3 = p2 + L;
  283. float32_t * p4 = p3 + L;
  284. float32_t t2[4], t3[4], t4[4], twR, twI;
  285. float32_t p1ap3_0, p1sp3_0, p1ap3_1, p1sp3_1;
  286. float32_t m0, m1, m2, m3;
  287. uint32_t l, twMod2, twMod3, twMod4;
  288. pCol1 = p1; /* points to real values by default */
  289. pCol2 = p2;
  290. pCol3 = p3;
  291. pCol4 = p4;
  292. pEnd1 = p2 - 1; /* points to imaginary values by default */
  293. pEnd2 = p3 - 1;
  294. pEnd3 = p4 - 1;
  295. pEnd4 = pEnd3 + L;
  296. tw2 = tw3 = tw4 = (float32_t *) S->pTwiddle;
  297. L >>= 1;
  298. /* do four dot Fourier transform */
  299. twMod2 = 2;
  300. twMod3 = 4;
  301. twMod4 = 6;
  302. /* TOP */
  303. p1ap3_0 = p1[0] + p3[0];
  304. p1sp3_0 = p1[0] - p3[0];
  305. p1ap3_1 = p1[1] + p3[1];
  306. p1sp3_1 = p1[1] - p3[1];
  307. /* col 2 */
  308. t2[0] = p1sp3_0 + p2[1] - p4[1];
  309. t2[1] = p1sp3_1 - p2[0] + p4[0];
  310. /* col 3 */
  311. t3[0] = p1ap3_0 - p2[0] - p4[0];
  312. t3[1] = p1ap3_1 - p2[1] - p4[1];
  313. /* col 4 */
  314. t4[0] = p1sp3_0 - p2[1] + p4[1];
  315. t4[1] = p1sp3_1 + p2[0] - p4[0];
  316. /* col 1 */
  317. *p1++ = p1ap3_0 + p2[0] + p4[0];
  318. *p1++ = p1ap3_1 + p2[1] + p4[1];
  319. /* Twiddle factors are ones */
  320. *p2++ = t2[0];
  321. *p2++ = t2[1];
  322. *p3++ = t3[0];
  323. *p3++ = t3[1];
  324. *p4++ = t4[0];
  325. *p4++ = t4[1];
  326. tw2 += twMod2;
  327. tw3 += twMod3;
  328. tw4 += twMod4;
  329. for (l = (L - 2) >> 1; l > 0; l-- )
  330. {
  331. /* TOP */
  332. p1ap3_0 = p1[0] + p3[0];
  333. p1sp3_0 = p1[0] - p3[0];
  334. p1ap3_1 = p1[1] + p3[1];
  335. p1sp3_1 = p1[1] - p3[1];
  336. /* col 2 */
  337. t2[0] = p1sp3_0 + p2[1] - p4[1];
  338. t2[1] = p1sp3_1 - p2[0] + p4[0];
  339. /* col 3 */
  340. t3[0] = p1ap3_0 - p2[0] - p4[0];
  341. t3[1] = p1ap3_1 - p2[1] - p4[1];
  342. /* col 4 */
  343. t4[0] = p1sp3_0 - p2[1] + p4[1];
  344. t4[1] = p1sp3_1 + p2[0] - p4[0];
  345. /* col 1 - top */
  346. *p1++ = p1ap3_0 + p2[0] + p4[0];
  347. *p1++ = p1ap3_1 + p2[1] + p4[1];
  348. /* BOTTOM */
  349. p1ap3_1 = pEnd1[-1] + pEnd3[-1];
  350. p1sp3_1 = pEnd1[-1] - pEnd3[-1];
  351. p1ap3_0 = pEnd1[ 0] + pEnd3[0];
  352. p1sp3_0 = pEnd1[ 0] - pEnd3[0];
  353. /* col 2 */
  354. t2[2] = pEnd2[0] - pEnd4[0] + p1sp3_1;
  355. t2[3] = pEnd1[0] - pEnd3[0] - pEnd2[-1] + pEnd4[-1];
  356. /* col 3 */
  357. t3[2] = p1ap3_1 - pEnd2[-1] - pEnd4[-1];
  358. t3[3] = p1ap3_0 - pEnd2[ 0] - pEnd4[ 0];
  359. /* col 4 */
  360. t4[2] = pEnd2[ 0] - pEnd4[ 0] - p1sp3_1;
  361. t4[3] = pEnd4[-1] - pEnd2[-1] - p1sp3_0;
  362. /* col 1 - Bottom */
  363. *pEnd1-- = p1ap3_0 + pEnd2[ 0] + pEnd4[ 0];
  364. *pEnd1-- = p1ap3_1 + pEnd2[-1] + pEnd4[-1];
  365. /* COL 2 */
  366. /* read twiddle factors */
  367. twR = *tw2++;
  368. twI = *tw2++;
  369. /* multiply by twiddle factors */
  370. /* let Z1 = a + i(b), Z2 = c + i(d) */
  371. /* => Z1 * Z2 = (a*c - b*d) + i(b*c + a*d) */
  372. /* Top */
  373. m0 = t2[0] * twR;
  374. m1 = t2[1] * twI;
  375. m2 = t2[1] * twR;
  376. m3 = t2[0] * twI;
  377. *p2++ = m0 + m1;
  378. *p2++ = m2 - m3;
  379. /* use vertical symmetry col 2 */
  380. /* 0.9997 - 0.0245i <==> 0.0245 - 0.9997i */
  381. /* Bottom */
  382. m0 = t2[3] * twI;
  383. m1 = t2[2] * twR;
  384. m2 = t2[2] * twI;
  385. m3 = t2[3] * twR;
  386. *pEnd2-- = m0 - m1;
  387. *pEnd2-- = m2 + m3;
  388. /* COL 3 */
  389. twR = tw3[0];
  390. twI = tw3[1];
  391. tw3 += twMod3;
  392. /* Top */
  393. m0 = t3[0] * twR;
  394. m1 = t3[1] * twI;
  395. m2 = t3[1] * twR;
  396. m3 = t3[0] * twI;
  397. *p3++ = m0 + m1;
  398. *p3++ = m2 - m3;
  399. /* use vertical symmetry col 3 */
  400. /* 0.9988 - 0.0491i <==> -0.9988 - 0.0491i */
  401. /* Bottom */
  402. m0 = -t3[3] * twR;
  403. m1 = t3[2] * twI;
  404. m2 = t3[2] * twR;
  405. m3 = t3[3] * twI;
  406. *pEnd3-- = m0 - m1;
  407. *pEnd3-- = m3 - m2;
  408. /* COL 4 */
  409. twR = tw4[0];
  410. twI = tw4[1];
  411. tw4 += twMod4;
  412. /* Top */
  413. m0 = t4[0] * twR;
  414. m1 = t4[1] * twI;
  415. m2 = t4[1] * twR;
  416. m3 = t4[0] * twI;
  417. *p4++ = m0 + m1;
  418. *p4++ = m2 - m3;
  419. /* use vertical symmetry col 4 */
  420. /* 0.9973 - 0.0736i <==> -0.0736 + 0.9973i */
  421. /* Bottom */
  422. m0 = t4[3] * twI;
  423. m1 = t4[2] * twR;
  424. m2 = t4[2] * twI;
  425. m3 = t4[3] * twR;
  426. *pEnd4-- = m0 - m1;
  427. *pEnd4-- = m2 + m3;
  428. }
  429. /* MIDDLE */
  430. /* Twiddle factors are */
  431. /* 1.0000 0.7071-0.7071i -1.0000i -0.7071-0.7071i */
  432. p1ap3_0 = p1[0] + p3[0];
  433. p1sp3_0 = p1[0] - p3[0];
  434. p1ap3_1 = p1[1] + p3[1];
  435. p1sp3_1 = p1[1] - p3[1];
  436. /* col 2 */
  437. t2[0] = p1sp3_0 + p2[1] - p4[1];
  438. t2[1] = p1sp3_1 - p2[0] + p4[0];
  439. /* col 3 */
  440. t3[0] = p1ap3_0 - p2[0] - p4[0];
  441. t3[1] = p1ap3_1 - p2[1] - p4[1];
  442. /* col 4 */
  443. t4[0] = p1sp3_0 - p2[1] + p4[1];
  444. t4[1] = p1sp3_1 + p2[0] - p4[0];
  445. /* col 1 - Top */
  446. *p1++ = p1ap3_0 + p2[0] + p4[0];
  447. *p1++ = p1ap3_1 + p2[1] + p4[1];
  448. /* COL 2 */
  449. twR = tw2[0];
  450. twI = tw2[1];
  451. m0 = t2[0] * twR;
  452. m1 = t2[1] * twI;
  453. m2 = t2[1] * twR;
  454. m3 = t2[0] * twI;
  455. *p2++ = m0 + m1;
  456. *p2++ = m2 - m3;
  457. /* COL 3 */
  458. twR = tw3[0];
  459. twI = tw3[1];
  460. m0 = t3[0] * twR;
  461. m1 = t3[1] * twI;
  462. m2 = t3[1] * twR;
  463. m3 = t3[0] * twI;
  464. *p3++ = m0 + m1;
  465. *p3++ = m2 - m3;
  466. /* COL 4 */
  467. twR = tw4[0];
  468. twI = tw4[1];
  469. m0 = t4[0] * twR;
  470. m1 = t4[1] * twI;
  471. m2 = t4[1] * twR;
  472. m3 = t4[0] * twI;
  473. *p4++ = m0 + m1;
  474. *p4++ = m2 - m3;
  475. /* first col */
  476. arm_radix8_butterfly_f32 (pCol1, L, (float32_t *) S->pTwiddle, 4U);
  477. /* second col */
  478. arm_radix8_butterfly_f32 (pCol2, L, (float32_t *) S->pTwiddle, 4U);
  479. /* third col */
  480. arm_radix8_butterfly_f32 (pCol3, L, (float32_t *) S->pTwiddle, 4U);
  481. /* fourth col */
  482. arm_radix8_butterfly_f32 (pCol4, L, (float32_t *) S->pTwiddle, 4U);
  483. }
  484. /**
  485. @addtogroup ComplexFFT
  486. @{
  487. */
  488. /**
  489. @brief Processing function for the floating-point complex FFT.
  490. @param[in] S points to an instance of the floating-point CFFT structure
  491. @param[in,out] p1 points to the complex data buffer of size <code>2*fftLen</code>. Processing occurs in-place
  492. @param[in] ifftFlag flag that selects transform direction
  493. - value = 0: forward transform
  494. - value = 1: inverse transform
  495. @param[in] bitReverseFlag flag that enables / disables bit reversal of output
  496. - value = 0: disables bit reversal of output
  497. - value = 1: enables bit reversal of output
  498. @return none
  499. */
  500. void arm_cfft_f32(
  501. const arm_cfft_instance_f32 * S,
  502. float32_t * p1,
  503. uint8_t ifftFlag,
  504. uint8_t bitReverseFlag)
  505. {
  506. uint32_t L = S->fftLen, l;
  507. float32_t invL, * pSrc;
  508. if (ifftFlag == 1U)
  509. {
  510. /* Conjugate input data */
  511. pSrc = p1 + 1;
  512. for (l = 0; l < L; l++)
  513. {
  514. *pSrc = -*pSrc;
  515. pSrc += 2;
  516. }
  517. }
  518. switch (L)
  519. {
  520. case 16:
  521. case 128:
  522. case 1024:
  523. arm_cfft_radix8by2_f32 ( (arm_cfft_instance_f32 *) S, p1);
  524. break;
  525. case 32:
  526. case 256:
  527. case 2048:
  528. arm_cfft_radix8by4_f32 ( (arm_cfft_instance_f32 *) S, p1);
  529. break;
  530. case 64:
  531. case 512:
  532. case 4096:
  533. arm_radix8_butterfly_f32 ( p1, L, (float32_t *) S->pTwiddle, 1);
  534. break;
  535. }
  536. if ( bitReverseFlag )
  537. arm_bitreversal_32 ((uint32_t*) p1, S->bitRevLength, S->pBitRevTable);
  538. if (ifftFlag == 1U)
  539. {
  540. invL = 1.0f / (float32_t)L;
  541. /* Conjugate and scale output data */
  542. pSrc = p1;
  543. for (l= 0; l < L; l++)
  544. {
  545. *pSrc++ *= invL ;
  546. *pSrc = -(*pSrc) * invL;
  547. pSrc++;
  548. }
  549. }
  550. }
  551. /**
  552. @} end of ComplexFFT group
  553. */