arm_const_structs.c 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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: 27. January 2017
  8. * $Revision: V.1.5.1
  9. *
  10. * Target Processor: Cortex-M cores
  11. * -------------------------------------------------------------------- */
  12. /*
  13. * Copyright (C) 2010-2017 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. #include "arm_const_structs.h"
  30. /* Floating-point structs */
  31. const arm_cfft_instance_f32 arm_cfft_sR_f32_len16 = {
  32. 16, twiddleCoef_16, armBitRevIndexTable16, ARMBITREVINDEXTABLE_16_TABLE_LENGTH
  33. };
  34. const arm_cfft_instance_f32 arm_cfft_sR_f32_len32 = {
  35. 32, twiddleCoef_32, armBitRevIndexTable32, ARMBITREVINDEXTABLE_32_TABLE_LENGTH
  36. };
  37. const arm_cfft_instance_f32 arm_cfft_sR_f32_len64 = {
  38. 64, twiddleCoef_64, armBitRevIndexTable64, ARMBITREVINDEXTABLE_64_TABLE_LENGTH
  39. };
  40. const arm_cfft_instance_f32 arm_cfft_sR_f32_len128 = {
  41. 128, twiddleCoef_128, armBitRevIndexTable128, ARMBITREVINDEXTABLE_128_TABLE_LENGTH
  42. };
  43. const arm_cfft_instance_f32 arm_cfft_sR_f32_len256 = {
  44. 256, twiddleCoef_256, armBitRevIndexTable256, ARMBITREVINDEXTABLE_256_TABLE_LENGTH
  45. };
  46. const arm_cfft_instance_f32 arm_cfft_sR_f32_len512 = {
  47. 512, twiddleCoef_512, armBitRevIndexTable512, ARMBITREVINDEXTABLE_512_TABLE_LENGTH
  48. };
  49. const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024 = {
  50. 1024, twiddleCoef_1024, armBitRevIndexTable1024, ARMBITREVINDEXTABLE_1024_TABLE_LENGTH
  51. };
  52. const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048 = {
  53. 2048, twiddleCoef_2048, armBitRevIndexTable2048, ARMBITREVINDEXTABLE_2048_TABLE_LENGTH
  54. };
  55. const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096 = {
  56. 4096, twiddleCoef_4096, armBitRevIndexTable4096, ARMBITREVINDEXTABLE_4096_TABLE_LENGTH
  57. };
  58. /* Fixed-point structs */
  59. const arm_cfft_instance_q31 arm_cfft_sR_q31_len16 = {
  60. 16, twiddleCoef_16_q31, armBitRevIndexTable_fixed_16, ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH
  61. };
  62. const arm_cfft_instance_q31 arm_cfft_sR_q31_len32 = {
  63. 32, twiddleCoef_32_q31, armBitRevIndexTable_fixed_32, ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH
  64. };
  65. const arm_cfft_instance_q31 arm_cfft_sR_q31_len64 = {
  66. 64, twiddleCoef_64_q31, armBitRevIndexTable_fixed_64, ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH
  67. };
  68. const arm_cfft_instance_q31 arm_cfft_sR_q31_len128 = {
  69. 128, twiddleCoef_128_q31, armBitRevIndexTable_fixed_128, ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH
  70. };
  71. const arm_cfft_instance_q31 arm_cfft_sR_q31_len256 = {
  72. 256, twiddleCoef_256_q31, armBitRevIndexTable_fixed_256, ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH
  73. };
  74. const arm_cfft_instance_q31 arm_cfft_sR_q31_len512 = {
  75. 512, twiddleCoef_512_q31, armBitRevIndexTable_fixed_512, ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH
  76. };
  77. const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024 = {
  78. 1024, twiddleCoef_1024_q31, armBitRevIndexTable_fixed_1024, ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH
  79. };
  80. const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048 = {
  81. 2048, twiddleCoef_2048_q31, armBitRevIndexTable_fixed_2048, ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH
  82. };
  83. const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096 = {
  84. 4096, twiddleCoef_4096_q31, armBitRevIndexTable_fixed_4096, ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH
  85. };
  86. const arm_cfft_instance_q15 arm_cfft_sR_q15_len16 = {
  87. 16, twiddleCoef_16_q15, armBitRevIndexTable_fixed_16, ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH
  88. };
  89. const arm_cfft_instance_q15 arm_cfft_sR_q15_len32 = {
  90. 32, twiddleCoef_32_q15, armBitRevIndexTable_fixed_32, ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH
  91. };
  92. const arm_cfft_instance_q15 arm_cfft_sR_q15_len64 = {
  93. 64, twiddleCoef_64_q15, armBitRevIndexTable_fixed_64, ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH
  94. };
  95. const arm_cfft_instance_q15 arm_cfft_sR_q15_len128 = {
  96. 128, twiddleCoef_128_q15, armBitRevIndexTable_fixed_128, ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH
  97. };
  98. const arm_cfft_instance_q15 arm_cfft_sR_q15_len256 = {
  99. 256, twiddleCoef_256_q15, armBitRevIndexTable_fixed_256, ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH
  100. };
  101. const arm_cfft_instance_q15 arm_cfft_sR_q15_len512 = {
  102. 512, twiddleCoef_512_q15, armBitRevIndexTable_fixed_512, ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH
  103. };
  104. const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024 = {
  105. 1024, twiddleCoef_1024_q15, armBitRevIndexTable_fixed_1024, ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH
  106. };
  107. const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048 = {
  108. 2048, twiddleCoef_2048_q15, armBitRevIndexTable_fixed_2048, ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH
  109. };
  110. const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096 = {
  111. 4096, twiddleCoef_4096_q15, armBitRevIndexTable_fixed_4096, ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH
  112. };
  113. /* Structure for real-value inputs */
  114. /* Floating-point structs */
  115. const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len32 = {
  116. { 16, twiddleCoef_32, armBitRevIndexTable32, ARMBITREVINDEXTABLE_16_TABLE_LENGTH },
  117. 32U,
  118. (float32_t *)twiddleCoef_rfft_32
  119. };
  120. const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len64 = {
  121. { 32, twiddleCoef_32, armBitRevIndexTable32, ARMBITREVINDEXTABLE_32_TABLE_LENGTH },
  122. 64U,
  123. (float32_t *)twiddleCoef_rfft_64
  124. };
  125. const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len128 = {
  126. { 64, twiddleCoef_64, armBitRevIndexTable64, ARMBITREVINDEXTABLE_64_TABLE_LENGTH },
  127. 128U,
  128. (float32_t *)twiddleCoef_rfft_128
  129. };
  130. const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len256 = {
  131. { 128, twiddleCoef_128, armBitRevIndexTable128, ARMBITREVINDEXTABLE_128_TABLE_LENGTH },
  132. 256U,
  133. (float32_t *)twiddleCoef_rfft_256
  134. };
  135. const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len512 = {
  136. { 256, twiddleCoef_256, armBitRevIndexTable256, ARMBITREVINDEXTABLE_256_TABLE_LENGTH },
  137. 512U,
  138. (float32_t *)twiddleCoef_rfft_512
  139. };
  140. const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len1024 = {
  141. { 512, twiddleCoef_512, armBitRevIndexTable512, ARMBITREVINDEXTABLE_512_TABLE_LENGTH },
  142. 1024U,
  143. (float32_t *)twiddleCoef_rfft_1024
  144. };
  145. const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len2048 = {
  146. { 1024, twiddleCoef_1024, armBitRevIndexTable1024, ARMBITREVINDEXTABLE_1024_TABLE_LENGTH },
  147. 2048U,
  148. (float32_t *)twiddleCoef_rfft_2048
  149. };
  150. const arm_rfft_fast_instance_f32 arm_rfft_fast_sR_f32_len4096 = {
  151. { 2048, twiddleCoef_2048, armBitRevIndexTable2048, ARMBITREVINDEXTABLE_2048_TABLE_LENGTH },
  152. 4096U,
  153. (float32_t *)twiddleCoef_rfft_4096
  154. };
  155. /* Fixed-point structs */
  156. /* q31_t */
  157. extern const q31_t realCoefAQ31[8192];
  158. extern const q31_t realCoefBQ31[8192];
  159. const arm_rfft_instance_q31 arm_rfft_sR_q31_len32 = {
  160. 32U,
  161. 0,
  162. 1,
  163. 256U,
  164. (q31_t*)realCoefAQ31,
  165. (q31_t*)realCoefBQ31,
  166. &arm_cfft_sR_q31_len16
  167. };
  168. const arm_rfft_instance_q31 arm_rfft_sR_q31_len64 = {
  169. 64U,
  170. 0,
  171. 1,
  172. 128U,
  173. (q31_t*)realCoefAQ31,
  174. (q31_t*)realCoefBQ31,
  175. &arm_cfft_sR_q31_len32
  176. };
  177. const arm_rfft_instance_q31 arm_rfft_sR_q31_len128 = {
  178. 128U,
  179. 0,
  180. 1,
  181. 64U,
  182. (q31_t*)realCoefAQ31,
  183. (q31_t*)realCoefBQ31,
  184. &arm_cfft_sR_q31_len64
  185. };
  186. const arm_rfft_instance_q31 arm_rfft_sR_q31_len256 = {
  187. 256U,
  188. 0,
  189. 1,
  190. 32U,
  191. (q31_t*)realCoefAQ31,
  192. (q31_t*)realCoefBQ31,
  193. &arm_cfft_sR_q31_len128
  194. };
  195. const arm_rfft_instance_q31 arm_rfft_sR_q31_len512 = {
  196. 512U,
  197. 0,
  198. 1,
  199. 16U,
  200. (q31_t*)realCoefAQ31,
  201. (q31_t*)realCoefBQ31,
  202. &arm_cfft_sR_q31_len256
  203. };
  204. const arm_rfft_instance_q31 arm_rfft_sR_q31_len1024 = {
  205. 1024U,
  206. 0,
  207. 1,
  208. 8U,
  209. (q31_t*)realCoefAQ31,
  210. (q31_t*)realCoefBQ31,
  211. &arm_cfft_sR_q31_len512
  212. };
  213. const arm_rfft_instance_q31 arm_rfft_sR_q31_len2048 = {
  214. 2048U,
  215. 0,
  216. 1,
  217. 4U,
  218. (q31_t*)realCoefAQ31,
  219. (q31_t*)realCoefBQ31,
  220. &arm_cfft_sR_q31_len1024
  221. };
  222. const arm_rfft_instance_q31 arm_rfft_sR_q31_len4096 = {
  223. 4096U,
  224. 0,
  225. 1,
  226. 2U,
  227. (q31_t*)realCoefAQ31,
  228. (q31_t*)realCoefBQ31,
  229. &arm_cfft_sR_q31_len2048
  230. };
  231. const arm_rfft_instance_q31 arm_rfft_sR_q31_len8192 = {
  232. 8192U,
  233. 0,
  234. 1,
  235. 1U,
  236. (q31_t*)realCoefAQ31,
  237. (q31_t*)realCoefBQ31,
  238. &arm_cfft_sR_q31_len4096
  239. };
  240. /* q15_t */
  241. extern const q15_t realCoefAQ15[8192];
  242. extern const q15_t realCoefBQ15[8192];
  243. const arm_rfft_instance_q15 arm_rfft_sR_q15_len32 = {
  244. 32U,
  245. 0,
  246. 1,
  247. 256U,
  248. (q15_t*)realCoefAQ15,
  249. (q15_t*)realCoefBQ15,
  250. &arm_cfft_sR_q15_len16
  251. };
  252. const arm_rfft_instance_q15 arm_rfft_sR_q15_len64 = {
  253. 64U,
  254. 0,
  255. 1,
  256. 128U,
  257. (q15_t*)realCoefAQ15,
  258. (q15_t*)realCoefBQ15,
  259. &arm_cfft_sR_q15_len32
  260. };
  261. const arm_rfft_instance_q15 arm_rfft_sR_q15_len128 = {
  262. 128U,
  263. 0,
  264. 1,
  265. 64U,
  266. (q15_t*)realCoefAQ15,
  267. (q15_t*)realCoefBQ15,
  268. &arm_cfft_sR_q15_len64
  269. };
  270. const arm_rfft_instance_q15 arm_rfft_sR_q15_len256 = {
  271. 256U,
  272. 0,
  273. 1,
  274. 32U,
  275. (q15_t*)realCoefAQ15,
  276. (q15_t*)realCoefBQ15,
  277. &arm_cfft_sR_q15_len128
  278. };
  279. const arm_rfft_instance_q15 arm_rfft_sR_q15_len512 = {
  280. 512U,
  281. 0,
  282. 1,
  283. 16U,
  284. (q15_t*)realCoefAQ15,
  285. (q15_t*)realCoefBQ15,
  286. &arm_cfft_sR_q15_len256
  287. };
  288. const arm_rfft_instance_q15 arm_rfft_sR_q15_len1024 = {
  289. 1024U,
  290. 0,
  291. 1,
  292. 8U,
  293. (q15_t*)realCoefAQ15,
  294. (q15_t*)realCoefBQ15,
  295. &arm_cfft_sR_q15_len512
  296. };
  297. const arm_rfft_instance_q15 arm_rfft_sR_q15_len2048 = {
  298. 2048U,
  299. 0,
  300. 1,
  301. 4U,
  302. (q15_t*)realCoefAQ15,
  303. (q15_t*)realCoefBQ15,
  304. &arm_cfft_sR_q15_len1024
  305. };
  306. const arm_rfft_instance_q15 arm_rfft_sR_q15_len4096 = {
  307. 4096U,
  308. 0,
  309. 1,
  310. 2U,
  311. (q15_t*)realCoefAQ15,
  312. (q15_t*)realCoefBQ15,
  313. &arm_cfft_sR_q15_len2048
  314. };
  315. const arm_rfft_instance_q15 arm_rfft_sR_q15_len8192 = {
  316. 8192U,
  317. 0,
  318. 1,
  319. 1U,
  320. (q15_t*)realCoefAQ15,
  321. (q15_t*)realCoefBQ15,
  322. &arm_cfft_sR_q15_len4096
  323. };