1 /* ----------------------------------------------------------------------
2  * Project:      CMSIS DSP Library
3  * Title:        arm_const_structs.c
4  * Description:  Constant structs that are initialized for user convenience.
5  *               For example, some can be given as arguments to the arm_cfft_f32() or arm_rfft_f32() functions.
6  *
7  * $Date:        23 April 2021
8  * $Revision:    V1.9.0
9  *
10  * Target Processor: Cortex-M and Cortex-A cores
11  * -------------------------------------------------------------------- */
12 /*
13  * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved.
14  *
15  * SPDX-License-Identifier: Apache-2.0
16  *
17  * Licensed under the Apache License, Version 2.0 (the License); you may
18  * not use this file except in compliance with the License.
19  * You may obtain a copy of the License at
20  *
21  * www.apache.org/licenses/LICENSE-2.0
22  *
23  * Unless required by applicable law or agreed to in writing, software
24  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
25  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26  * See the License for the specific language governing permissions and
27  * limitations under the License.
28  */
29 
30 #include "arm_math_types.h"
31 #include "arm_const_structs.h"
32 
33 /*
34 ALLOW TABLE is true when config table is enabled and the Tramsform folder is included
35 for compilation.
36 */
37 
38 /* Floating-point structs */
39 const arm_cfft_instance_f64 arm_cfft_sR_f64_len16 = {
40   16, (const float64_t *)twiddleCoefF64_16, armBitRevIndexTableF64_16, ARMBITREVINDEXTABLEF64_16_TABLE_LENGTH
41 };
42 
43 const arm_cfft_instance_f64 arm_cfft_sR_f64_len32 = {
44   32, (const float64_t *)twiddleCoefF64_32, armBitRevIndexTableF64_32, ARMBITREVINDEXTABLEF64_32_TABLE_LENGTH
45 };
46 
47 const arm_cfft_instance_f64 arm_cfft_sR_f64_len64 = {
48   64, (const float64_t *)twiddleCoefF64_64, armBitRevIndexTableF64_64, ARMBITREVINDEXTABLEF64_64_TABLE_LENGTH
49 };
50 
51 const arm_cfft_instance_f64 arm_cfft_sR_f64_len128 = {
52   128, (const float64_t *)twiddleCoefF64_128, armBitRevIndexTableF64_128, ARMBITREVINDEXTABLEF64_128_TABLE_LENGTH
53 };
54 
55 const arm_cfft_instance_f64 arm_cfft_sR_f64_len256 = {
56   256, (const float64_t *)twiddleCoefF64_256, armBitRevIndexTableF64_256, ARMBITREVINDEXTABLEF64_256_TABLE_LENGTH
57 };
58 
59 const arm_cfft_instance_f64 arm_cfft_sR_f64_len512 = {
60   512, (const float64_t *)twiddleCoefF64_512, armBitRevIndexTableF64_512, ARMBITREVINDEXTABLEF64_512_TABLE_LENGTH
61 };
62 
63 const arm_cfft_instance_f64 arm_cfft_sR_f64_len1024 = {
64   1024, (const float64_t *)twiddleCoefF64_1024, armBitRevIndexTableF64_1024, ARMBITREVINDEXTABLEF64_1024_TABLE_LENGTH
65 };
66 
67 const arm_cfft_instance_f64 arm_cfft_sR_f64_len2048 = {
68   2048, (const float64_t *)twiddleCoefF64_2048, armBitRevIndexTableF64_2048, ARMBITREVINDEXTABLEF64_2048_TABLE_LENGTH
69 };
70 
71 const arm_cfft_instance_f64 arm_cfft_sR_f64_len4096 = {
72   4096, (const float64_t *)twiddleCoefF64_4096, armBitRevIndexTableF64_4096, ARMBITREVINDEXTABLEF64_4096_TABLE_LENGTH
73 };
74 
75 /* Floating-point structs */
76 #if !defined(ARM_MATH_MVEF) || defined(ARM_MATH_AUTOVECTORIZE)
77 
78 
79 const arm_cfft_instance_f32 arm_cfft_sR_f32_len16 = {
80   16, twiddleCoef_16, armBitRevIndexTable16, ARMBITREVINDEXTABLE_16_TABLE_LENGTH
81 };
82 
83 
84 const arm_cfft_instance_f32 arm_cfft_sR_f32_len32 = {
85   32, twiddleCoef_32, armBitRevIndexTable32, ARMBITREVINDEXTABLE_32_TABLE_LENGTH
86 };
87 
88 const arm_cfft_instance_f32 arm_cfft_sR_f32_len64 = {
89   64, twiddleCoef_64, armBitRevIndexTable64, ARMBITREVINDEXTABLE_64_TABLE_LENGTH
90 };
91 
92 const arm_cfft_instance_f32 arm_cfft_sR_f32_len128 = {
93   128, twiddleCoef_128, armBitRevIndexTable128, ARMBITREVINDEXTABLE_128_TABLE_LENGTH
94 };
95 
96 const arm_cfft_instance_f32 arm_cfft_sR_f32_len256 = {
97   256, twiddleCoef_256, armBitRevIndexTable256, ARMBITREVINDEXTABLE_256_TABLE_LENGTH
98 };
99 
100 const arm_cfft_instance_f32 arm_cfft_sR_f32_len512 = {
101   512, twiddleCoef_512, armBitRevIndexTable512, ARMBITREVINDEXTABLE_512_TABLE_LENGTH
102 };
103 
104 const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024 = {
105   1024, twiddleCoef_1024, armBitRevIndexTable1024, ARMBITREVINDEXTABLE_1024_TABLE_LENGTH
106 };
107 
108 const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048 = {
109   2048, twiddleCoef_2048, armBitRevIndexTable2048, ARMBITREVINDEXTABLE_2048_TABLE_LENGTH
110 };
111 
112 const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096 = {
113   4096, twiddleCoef_4096, armBitRevIndexTable4096, ARMBITREVINDEXTABLE_4096_TABLE_LENGTH
114 };
115 
116 #endif /* !defined(ARM_MATH_MVEF) || defined(ARM_MATH_AUTOVECTORIZE) */
117 
118 /* Fixed-point structs */
119 
120 #if !defined(ARM_MATH_MVEI) || defined(ARM_MATH_AUTOVECTORIZE)
121 
122 /*
123 
124 Those structures cannot be used to initialize the MVE version of the FFT Q31 instances.
125 So they are not compiled when MVE is defined.
126 
127 For the MVE version, the new arm_cfft_init_f32 must be used.
128 
129 
130 */
131 
132 const arm_cfft_instance_q31 arm_cfft_sR_q31_len16 = {
133   16, twiddleCoef_16_q31, armBitRevIndexTable_fixed_16, ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH
134 };
135 
136 const arm_cfft_instance_q31 arm_cfft_sR_q31_len32 = {
137   32, twiddleCoef_32_q31, armBitRevIndexTable_fixed_32, ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH
138 };
139 
140 const arm_cfft_instance_q31 arm_cfft_sR_q31_len64 = {
141   64, twiddleCoef_64_q31, armBitRevIndexTable_fixed_64, ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH
142 };
143 
144 const arm_cfft_instance_q31 arm_cfft_sR_q31_len128 = {
145   128, twiddleCoef_128_q31, armBitRevIndexTable_fixed_128, ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH
146 };
147 
148 const arm_cfft_instance_q31 arm_cfft_sR_q31_len256 = {
149   256, twiddleCoef_256_q31, armBitRevIndexTable_fixed_256, ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH
150 };
151 
152 const arm_cfft_instance_q31 arm_cfft_sR_q31_len512 = {
153   512, twiddleCoef_512_q31, armBitRevIndexTable_fixed_512, ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH
154 };
155 
156 const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024 = {
157   1024, twiddleCoef_1024_q31, armBitRevIndexTable_fixed_1024, ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH
158 };
159 
160 const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048 = {
161   2048, twiddleCoef_2048_q31, armBitRevIndexTable_fixed_2048, ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH
162 };
163 
164 const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096 = {
165   4096, twiddleCoef_4096_q31, armBitRevIndexTable_fixed_4096, ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH
166 };
167 
168 
169 const arm_cfft_instance_q15 arm_cfft_sR_q15_len16 = {
170   16, twiddleCoef_16_q15, armBitRevIndexTable_fixed_16, ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH
171 };
172 
173 const arm_cfft_instance_q15 arm_cfft_sR_q15_len32 = {
174   32, twiddleCoef_32_q15, armBitRevIndexTable_fixed_32, ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH
175 };
176 
177 const arm_cfft_instance_q15 arm_cfft_sR_q15_len64 = {
178   64, twiddleCoef_64_q15, armBitRevIndexTable_fixed_64, ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH
179 };
180 
181 const arm_cfft_instance_q15 arm_cfft_sR_q15_len128 = {
182   128, twiddleCoef_128_q15, armBitRevIndexTable_fixed_128, ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH
183 };
184 
185 const arm_cfft_instance_q15 arm_cfft_sR_q15_len256 = {
186   256, twiddleCoef_256_q15, armBitRevIndexTable_fixed_256, ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH
187 };
188 
189 const arm_cfft_instance_q15 arm_cfft_sR_q15_len512 = {
190   512, twiddleCoef_512_q15, armBitRevIndexTable_fixed_512, ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH
191 };
192 
193 const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024 = {
194   1024, twiddleCoef_1024_q15, armBitRevIndexTable_fixed_1024, ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH
195 };
196 
197 const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048 = {
198   2048, twiddleCoef_2048_q15, armBitRevIndexTable_fixed_2048, ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH
199 };
200 
201 const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096 = {
202   4096, twiddleCoef_4096_q15, armBitRevIndexTable_fixed_4096, ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH
203 };
204 
205 #endif /* !defined(ARM_MATH_MVEI) */
206 
207 /* Structure for real-value inputs */
208 /* Double precision strucs */
209 
210 const arm_rfft_fast_instance_f64 arm_rfft_fast_sR_f64_len32 = {
211   { 16, (const float64_t *)twiddleCoefF64_16, armBitRevIndexTableF64_16, ARMBITREVINDEXTABLEF64_16_TABLE_LENGTH },
212   32U,
213   (float64_t *)twiddleCoefF64_rfft_32
214 };
215 
216 const arm_rfft_fast_instance_f64 arm_rfft_fast_sR_f64_len64 = {
217    { 32, (const float64_t *)twiddleCoefF64_32, armBitRevIndexTableF64_32, ARMBITREVINDEXTABLEF64_32_TABLE_LENGTH },
218   64U,
219   (float64_t *)twiddleCoefF64_rfft_64
220 };
221 
222 const arm_rfft_fast_instance_f64 arm_rfft_fast_sR_f64_len128 = {
223   { 64, (const float64_t *)twiddleCoefF64_64, armBitRevIndexTableF64_64, ARMBITREVINDEXTABLEF64_64_TABLE_LENGTH },
224   128U,
225   (float64_t *)twiddleCoefF64_rfft_128
226 };
227 
228 const arm_rfft_fast_instance_f64 arm_rfft_fast_sR_f64_len256 = {
229   { 128, (const float64_t *)twiddleCoefF64_128, armBitRevIndexTableF64_128, ARMBITREVINDEXTABLEF64_128_TABLE_LENGTH },
230   256U,
231   (float64_t *)twiddleCoefF64_rfft_256
232 };
233 
234 const arm_rfft_fast_instance_f64 arm_rfft_fast_sR_f64_len512 = {
235   { 256, (const float64_t *)twiddleCoefF64_256, armBitRevIndexTableF64_256, ARMBITREVINDEXTABLEF64_256_TABLE_LENGTH },
236   512U,
237   (float64_t *)twiddleCoefF64_rfft_512
238 };
239 
240 const arm_rfft_fast_instance_f64 arm_rfft_fast_sR_f64_len1024 = {
241   { 512, (const float64_t *)twiddleCoefF64_512, armBitRevIndexTableF64_512, ARMBITREVINDEXTABLEF64_512_TABLE_LENGTH },
242   1024U,
243   (float64_t *)twiddleCoefF64_rfft_1024
244 };
245 
246 const arm_rfft_fast_instance_f64 arm_rfft_fast_sR_f64_len2048 = {
247   { 1024, (const float64_t *)twiddleCoefF64_1024, armBitRevIndexTableF64_1024, ARMBITREVINDEXTABLEF64_1024_TABLE_LENGTH },
248   2048U,
249   (float64_t *)twiddleCoefF64_rfft_2048
250 };
251 
252 const arm_rfft_fast_instance_f64 arm_rfft_fast_sR_f64_len4096 = {
253   { 2048, (const float64_t *)twiddleCoefF64_2048, armBitRevIndexTableF64_2048, ARMBITREVINDEXTABLEF64_2048_TABLE_LENGTH },
254   4096U,
255   (float64_t *)twiddleCoefF64_rfft_4096
256 };
257 
258 /* Floating-point structs */
259 
260 #if !defined(ARM_MATH_MVEF) || defined(ARM_MATH_AUTOVECTORIZE)
261 
262 const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len32 = {
263   { 16, twiddleCoef_16, armBitRevIndexTable16, ARMBITREVINDEXTABLE_16_TABLE_LENGTH },
264   32U,
265   (float32_t *)twiddleCoef_rfft_32
266 };
267 
268 const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len64 = {
269    { 32, twiddleCoef_32, armBitRevIndexTable32, ARMBITREVINDEXTABLE_32_TABLE_LENGTH },
270   64U,
271   (float32_t *)twiddleCoef_rfft_64
272 };
273 
274 const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len128 = {
275   { 64, twiddleCoef_64, armBitRevIndexTable64, ARMBITREVINDEXTABLE_64_TABLE_LENGTH },
276   128U,
277   (float32_t *)twiddleCoef_rfft_128
278 };
279 
280 const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len256 = {
281   { 128, twiddleCoef_128, armBitRevIndexTable128, ARMBITREVINDEXTABLE_128_TABLE_LENGTH },
282   256U,
283   (float32_t *)twiddleCoef_rfft_256
284 };
285 
286 const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len512 = {
287   { 256, twiddleCoef_256, armBitRevIndexTable256, ARMBITREVINDEXTABLE_256_TABLE_LENGTH },
288   512U,
289   (float32_t *)twiddleCoef_rfft_512
290 };
291 
292 const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len1024 = {
293   { 512, twiddleCoef_512, armBitRevIndexTable512, ARMBITREVINDEXTABLE_512_TABLE_LENGTH },
294   1024U,
295   (float32_t *)twiddleCoef_rfft_1024
296 };
297 
298 const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len2048 = {
299   { 1024, twiddleCoef_1024, armBitRevIndexTable1024, ARMBITREVINDEXTABLE_1024_TABLE_LENGTH },
300   2048U,
301   (float32_t *)twiddleCoef_rfft_2048
302 };
303 
304 const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len4096 = {
305   { 2048, twiddleCoef_2048, armBitRevIndexTable2048, ARMBITREVINDEXTABLE_2048_TABLE_LENGTH },
306   4096U,
307   (float32_t *)twiddleCoef_rfft_4096
308 };
309 
310 #endif /* #if !defined(ARM_MATH_MVEF) || defined(ARM_MATH_AUTOVECTORIZE) */
311 
312 /* Fixed-point structs */
313 /* q31_t */
314 
315 #if !defined(ARM_MATH_MVEI) || defined(ARM_MATH_AUTOVECTORIZE)
316 
317 /*
318 
319 Those structures cannot be used to initialize the MVE version of the FFT Q31 instances.
320 So they are not compiled when MVE is defined.
321 
322 For the MVE version, the new arm_cfft_init_f32 must be used.
323 
324 
325 */
326 
327 const arm_rfft_instance_q31 arm_rfft_sR_q31_len32 = {
328   32U,
329   0,
330   1,
331   256U,
332   (q31_t*)realCoefAQ31,
333   (q31_t*)realCoefBQ31,
334   &arm_cfft_sR_q31_len16
335 };
336 
337 const arm_rfft_instance_q31 arm_rfft_sR_q31_len64 = {
338   64U,
339   0,
340   1,
341   128U,
342   (q31_t*)realCoefAQ31,
343   (q31_t*)realCoefBQ31,
344   &arm_cfft_sR_q31_len32
345 };
346 
347 const arm_rfft_instance_q31 arm_rfft_sR_q31_len128 = {
348   128U,
349   0,
350   1,
351   64U,
352   (q31_t*)realCoefAQ31,
353   (q31_t*)realCoefBQ31,
354   &arm_cfft_sR_q31_len64
355 };
356 
357 const arm_rfft_instance_q31 arm_rfft_sR_q31_len256 = {
358   256U,
359   0,
360   1,
361   32U,
362   (q31_t*)realCoefAQ31,
363   (q31_t*)realCoefBQ31,
364   &arm_cfft_sR_q31_len128
365 };
366 
367 const arm_rfft_instance_q31 arm_rfft_sR_q31_len512 = {
368   512U,
369   0,
370   1,
371   16U,
372   (q31_t*)realCoefAQ31,
373   (q31_t*)realCoefBQ31,
374   &arm_cfft_sR_q31_len256
375 };
376 
377 const arm_rfft_instance_q31 arm_rfft_sR_q31_len1024 = {
378   1024U,
379   0,
380   1,
381   8U,
382   (q31_t*)realCoefAQ31,
383   (q31_t*)realCoefBQ31,
384   &arm_cfft_sR_q31_len512
385 };
386 
387 const arm_rfft_instance_q31 arm_rfft_sR_q31_len2048 = {
388   2048U,
389   0,
390   1,
391   4U,
392   (q31_t*)realCoefAQ31,
393   (q31_t*)realCoefBQ31,
394   &arm_cfft_sR_q31_len1024
395 };
396 
397 const arm_rfft_instance_q31 arm_rfft_sR_q31_len4096 = {
398   4096U,
399   0,
400   1,
401   2U,
402   (q31_t*)realCoefAQ31,
403   (q31_t*)realCoefBQ31,
404   &arm_cfft_sR_q31_len2048
405 };
406 
407 const arm_rfft_instance_q31 arm_rfft_sR_q31_len8192 = {
408   8192U,
409   0,
410   1,
411   1U,
412   (q31_t*)realCoefAQ31,
413   (q31_t*)realCoefBQ31,
414   &arm_cfft_sR_q31_len4096
415 };
416 
417 /* q15_t */
418 const arm_rfft_instance_q15 arm_rfft_sR_q15_len32 = {
419   32U,
420   0,
421   1,
422   256U,
423   (q15_t*)realCoefAQ15,
424   (q15_t*)realCoefBQ15,
425   &arm_cfft_sR_q15_len16
426 };
427 
428 const arm_rfft_instance_q15 arm_rfft_sR_q15_len64 = {
429   64U,
430   0,
431   1,
432   128U,
433   (q15_t*)realCoefAQ15,
434   (q15_t*)realCoefBQ15,
435   &arm_cfft_sR_q15_len32
436 };
437 
438 const arm_rfft_instance_q15 arm_rfft_sR_q15_len128 = {
439   128U,
440   0,
441   1,
442   64U,
443   (q15_t*)realCoefAQ15,
444   (q15_t*)realCoefBQ15,
445   &arm_cfft_sR_q15_len64
446 };
447 
448 const arm_rfft_instance_q15 arm_rfft_sR_q15_len256 = {
449   256U,
450   0,
451   1,
452   32U,
453   (q15_t*)realCoefAQ15,
454   (q15_t*)realCoefBQ15,
455   &arm_cfft_sR_q15_len128
456 };
457 
458 const arm_rfft_instance_q15 arm_rfft_sR_q15_len512 = {
459   512U,
460   0,
461   1,
462   16U,
463   (q15_t*)realCoefAQ15,
464   (q15_t*)realCoefBQ15,
465   &arm_cfft_sR_q15_len256
466 };
467 
468 const arm_rfft_instance_q15 arm_rfft_sR_q15_len1024 = {
469   1024U,
470   0,
471   1,
472   8U,
473   (q15_t*)realCoefAQ15,
474   (q15_t*)realCoefBQ15,
475   &arm_cfft_sR_q15_len512
476 };
477 
478 const arm_rfft_instance_q15 arm_rfft_sR_q15_len2048 = {
479   2048U,
480   0,
481   1,
482   4U,
483   (q15_t*)realCoefAQ15,
484   (q15_t*)realCoefBQ15,
485   &arm_cfft_sR_q15_len1024
486 };
487 
488 const arm_rfft_instance_q15 arm_rfft_sR_q15_len4096 = {
489   4096U,
490   0,
491   1,
492   2U,
493   (q15_t*)realCoefAQ15,
494   (q15_t*)realCoefBQ15,
495   &arm_cfft_sR_q15_len2048
496 };
497 
498 const arm_rfft_instance_q15 arm_rfft_sR_q15_len8192 = {
499   8192U,
500   0,
501   1,
502   1U,
503   (q15_t*)realCoefAQ15,
504   (q15_t*)realCoefBQ15,
505   &arm_cfft_sR_q15_len4096
506 };
507 
508 #endif /* !defined(ARM_MATH_MVEI) */
509 
510 
511