1 /* ---------------------------------------------------------------------- 2 * Project: CMSIS DSP Library 3 * Title: arm_common_tables.h 4 * Description: Extern declaration for common tables 5 * 6 * @version V1.10.0 7 * @date 08 July 2021 8 * 9 * Target Processor: Cortex-M and Cortex-A cores 10 * -------------------------------------------------------------------- */ 11 /* 12 * Copyright (C) 2010-2021 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 29 #ifndef _ARM_COMMON_TABLES_H 30 #define _ARM_COMMON_TABLES_H 31 32 #include "arm_math_types.h" 33 #include "dsp/fast_math_functions.h" 34 35 #ifdef __cplusplus 36 extern "C" 37 { 38 #endif 39 40 /* Double Precision Float CFFT twiddles */ 41 extern const uint16_t armBitRevTable[1024]; 42 43 extern const uint64_t twiddleCoefF64_16[32]; 44 45 extern const uint64_t twiddleCoefF64_32[64]; 46 47 extern const uint64_t twiddleCoefF64_64[128]; 48 49 extern const uint64_t twiddleCoefF64_128[256]; 50 51 extern const uint64_t twiddleCoefF64_256[512]; 52 53 extern const uint64_t twiddleCoefF64_512[1024]; 54 55 extern const uint64_t twiddleCoefF64_1024[2048]; 56 57 extern const uint64_t twiddleCoefF64_2048[4096]; 58 59 extern const uint64_t twiddleCoefF64_4096[8192]; 60 61 extern const float32_t twiddleCoef_16[32]; 62 63 extern const float32_t twiddleCoef_32[64]; 64 65 extern const float32_t twiddleCoef_64[128]; 66 67 extern const float32_t twiddleCoef_128[256]; 68 69 extern const float32_t twiddleCoef_256[512]; 70 71 extern const float32_t twiddleCoef_512[1024]; 72 73 extern const float32_t twiddleCoef_1024[2048]; 74 75 extern const float32_t twiddleCoef_2048[4096]; 76 77 extern const float32_t twiddleCoef_4096[8192]; 78 #define twiddleCoef twiddleCoef_4096 79 80 /* Q31 */ 81 82 extern const q31_t twiddleCoef_16_q31[24]; 83 84 extern const q31_t twiddleCoef_32_q31[48]; 85 86 extern const q31_t twiddleCoef_64_q31[96]; 87 88 extern const q31_t twiddleCoef_128_q31[192]; 89 90 extern const q31_t twiddleCoef_256_q31[384]; 91 92 extern const q31_t twiddleCoef_512_q31[768]; 93 94 extern const q31_t twiddleCoef_1024_q31[1536]; 95 96 extern const q31_t twiddleCoef_2048_q31[3072]; 97 98 extern const q31_t twiddleCoef_4096_q31[6144]; 99 100 extern const q15_t twiddleCoef_16_q15[24]; 101 102 extern const q15_t twiddleCoef_32_q15[48]; 103 104 extern const q15_t twiddleCoef_64_q15[96]; 105 106 extern const q15_t twiddleCoef_128_q15[192]; 107 108 extern const q15_t twiddleCoef_256_q15[384]; 109 110 extern const q15_t twiddleCoef_512_q15[768]; 111 112 extern const q15_t twiddleCoef_1024_q15[1536]; 113 114 extern const q15_t twiddleCoef_2048_q15[3072]; 115 116 extern const q15_t twiddleCoef_4096_q15[6144]; 117 118 /* Double Precision Float RFFT twiddles */ 119 extern const uint64_t twiddleCoefF64_rfft_32[32]; 120 121 extern const uint64_t twiddleCoefF64_rfft_64[64]; 122 123 extern const uint64_t twiddleCoefF64_rfft_128[128]; 124 125 extern const uint64_t twiddleCoefF64_rfft_256[256]; 126 127 extern const uint64_t twiddleCoefF64_rfft_512[512]; 128 129 extern const uint64_t twiddleCoefF64_rfft_1024[1024]; 130 131 extern const uint64_t twiddleCoefF64_rfft_2048[2048]; 132 133 extern const uint64_t twiddleCoefF64_rfft_4096[4096]; 134 135 extern const float32_t twiddleCoef_rfft_32[32]; 136 137 extern const float32_t twiddleCoef_rfft_64[64]; 138 139 extern const float32_t twiddleCoef_rfft_128[128]; 140 141 extern const float32_t twiddleCoef_rfft_256[256]; 142 143 extern const float32_t twiddleCoef_rfft_512[512]; 144 145 extern const float32_t twiddleCoef_rfft_1024[1024]; 146 147 extern const float32_t twiddleCoef_rfft_2048[2048]; 148 149 extern const float32_t twiddleCoef_rfft_4096[4096]; 150 151 /* Double precision floating-point bit reversal tables */ 152 153 #define ARMBITREVINDEXTABLEF64_16_TABLE_LENGTH ((uint16_t)12) 154 extern const uint16_t armBitRevIndexTableF64_16[ARMBITREVINDEXTABLEF64_16_TABLE_LENGTH]; 155 156 #define ARMBITREVINDEXTABLEF64_32_TABLE_LENGTH ((uint16_t)24) 157 extern const uint16_t armBitRevIndexTableF64_32[ARMBITREVINDEXTABLEF64_32_TABLE_LENGTH]; 158 159 #define ARMBITREVINDEXTABLEF64_64_TABLE_LENGTH ((uint16_t)56) 160 extern const uint16_t armBitRevIndexTableF64_64[ARMBITREVINDEXTABLEF64_64_TABLE_LENGTH]; 161 162 #define ARMBITREVINDEXTABLEF64_128_TABLE_LENGTH ((uint16_t)112) 163 extern const uint16_t armBitRevIndexTableF64_128[ARMBITREVINDEXTABLEF64_128_TABLE_LENGTH]; 164 165 #define ARMBITREVINDEXTABLEF64_256_TABLE_LENGTH ((uint16_t)240) 166 extern const uint16_t armBitRevIndexTableF64_256[ARMBITREVINDEXTABLEF64_256_TABLE_LENGTH]; 167 168 #define ARMBITREVINDEXTABLEF64_512_TABLE_LENGTH ((uint16_t)480) 169 extern const uint16_t armBitRevIndexTableF64_512[ARMBITREVINDEXTABLEF64_512_TABLE_LENGTH]; 170 171 #define ARMBITREVINDEXTABLEF64_1024_TABLE_LENGTH ((uint16_t)992) 172 extern const uint16_t armBitRevIndexTableF64_1024[ARMBITREVINDEXTABLEF64_1024_TABLE_LENGTH]; 173 174 #define ARMBITREVINDEXTABLEF64_2048_TABLE_LENGTH ((uint16_t)1984) 175 extern const uint16_t armBitRevIndexTableF64_2048[ARMBITREVINDEXTABLEF64_2048_TABLE_LENGTH]; 176 177 #define ARMBITREVINDEXTABLEF64_4096_TABLE_LENGTH ((uint16_t)4032) 178 extern const uint16_t armBitRevIndexTableF64_4096[ARMBITREVINDEXTABLEF64_4096_TABLE_LENGTH]; 179 /* floating-point bit reversal tables */ 180 181 #define ARMBITREVINDEXTABLE_16_TABLE_LENGTH ((uint16_t)20) 182 extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE_16_TABLE_LENGTH]; 183 184 #define ARMBITREVINDEXTABLE_32_TABLE_LENGTH ((uint16_t)48) 185 extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE_32_TABLE_LENGTH]; 186 187 #define ARMBITREVINDEXTABLE_64_TABLE_LENGTH ((uint16_t)56) 188 extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE_64_TABLE_LENGTH]; 189 190 #define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208) 191 extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; 192 193 #define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440) 194 extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; 195 196 #define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448) 197 extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; 198 199 #define ARMBITREVINDEXTABLE_1024_TABLE_LENGTH ((uint16_t)1800) 200 extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE_1024_TABLE_LENGTH]; 201 202 #define ARMBITREVINDEXTABLE_2048_TABLE_LENGTH ((uint16_t)3808) 203 extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE_2048_TABLE_LENGTH]; 204 205 #define ARMBITREVINDEXTABLE_4096_TABLE_LENGTH ((uint16_t)4032) 206 extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE_4096_TABLE_LENGTH]; 207 208 209 /* fixed-point bit reversal tables */ 210 211 #define ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH ((uint16_t)12) 212 extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH]; 213 214 #define ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH ((uint16_t)24) 215 extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH]; 216 217 #define ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH ((uint16_t)56) 218 extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH]; 219 220 #define ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH ((uint16_t)112) 221 extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH]; 222 223 #define ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH ((uint16_t)240) 224 extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH]; 225 226 #define ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH ((uint16_t)480) 227 extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH]; 228 229 #define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992) 230 extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; 231 232 #define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) 233 extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; 234 235 #define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) 236 extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; 237 238 extern const float32_t realCoefA[8192]; 239 extern const float32_t realCoefB[8192]; 240 241 extern const q31_t realCoefAQ31[8192]; 242 extern const q31_t realCoefBQ31[8192]; 243 244 extern const q15_t realCoefAQ15[8192]; 245 extern const q15_t realCoefBQ15[8192]; 246 247 extern const float32_t Weights_128[256]; 248 extern const float32_t cos_factors_128[128]; 249 250 extern const float32_t Weights_512[1024]; 251 extern const float32_t cos_factors_512[512]; 252 253 extern const float32_t Weights_2048[4096]; 254 extern const float32_t cos_factors_2048[2048]; 255 256 extern const float32_t Weights_8192[16384]; 257 extern const float32_t cos_factors_8192[8192]; 258 259 extern const q15_t WeightsQ15_128[256]; 260 extern const q15_t cos_factorsQ15_128[128]; 261 262 extern const q15_t WeightsQ15_512[1024]; 263 extern const q15_t cos_factorsQ15_512[512]; 264 265 extern const q15_t WeightsQ15_2048[4096]; 266 extern const q15_t cos_factorsQ15_2048[2048]; 267 268 extern const q15_t WeightsQ15_8192[16384]; 269 extern const q15_t cos_factorsQ15_8192[8192]; 270 271 extern const q31_t WeightsQ31_128[256]; 272 extern const q31_t cos_factorsQ31_128[128]; 273 274 extern const q31_t WeightsQ31_512[1024]; 275 extern const q31_t cos_factorsQ31_512[512]; 276 277 extern const q31_t WeightsQ31_2048[4096]; 278 extern const q31_t cos_factorsQ31_2048[2048]; 279 280 extern const q31_t WeightsQ31_8192[16384]; 281 extern const q31_t cos_factorsQ31_8192[8192]; 282 283 284 extern const q15_t armRecipTableQ15[64]; 285 286 extern const q31_t armRecipTableQ31[64]; 287 288 /* Tables for Fast Math Sine and Cosine */ 289 extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; 290 291 extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; 292 293 extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; 294 295 296 /* Accurate scalar sqrt */ 297 extern const q31_t sqrt_initial_lut_q31[32]; 298 299 extern const q15_t sqrt_initial_lut_q15[16]; 300 301 #if (defined(ARM_MATH_MVEI) || defined(ARM_MATH_HELIUM)) && !defined(ARM_MATH_AUTOVECTORIZE) 302 extern const q15_t sqrtTable_Q15[256]; 303 extern const q31_t sqrtTable_Q31[256]; 304 extern const unsigned char hwLUT[256]; 305 #endif 306 307 #if (defined(ARM_MATH_MVEF) || defined(ARM_MATH_HELIUM)) && !defined(ARM_MATH_AUTOVECTORIZE) 308 extern const float32_t exp_tab[8]; 309 extern const float32_t __logf_lut_f32[8]; 310 #endif 311 312 313 #ifdef __cplusplus 314 } 315 #endif 316 317 #endif /* ARM_COMMON_TABLES_H */ 318 319