]> git.gag.com Git - fw/stlink/blob - exampleF4/CMSIS/DSP_Lib/Source/CommonTables/arm_common_tables.c
Added all the F4 libraries to the project
[fw/stlink] / exampleF4 / CMSIS / DSP_Lib / Source / CommonTables / arm_common_tables.c
1 /* ----------------------------------------------------------------------   
2 * Copyright (C) 2010 ARM Limited. All rights reserved.   
3 *   
4 * $Date:        15. July 2011  
5 * $Revision:    V1.0.10  
6 *   
7 * Project:          CMSIS DSP Library   
8 * Title:            arm_common_tables.c   
9 *   
10 * Description:  This file has common tables like Bitreverse, reciprocal etc which are used across different functions   
11 *   
12 * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 *  
14 * Version 1.0.10 2011/7/15 
15 *    Big Endian support added and Merged M0 and M3/M4 Source code.  
16 *   
17 * Version 1.0.3 2010/11/29  
18 *    Re-organized the CMSIS folders and updated documentation.   
19 *    
20 * Version 1.0.2 2010/11/11   
21 *    Documentation updated.    
22 *   
23 * Version 1.0.1 2010/10/05    
24 *    Production release and review comments incorporated.   
25 *   
26 * Version 1.0.0 2010/09/20    
27 *    Production release and review comments incorporated.   
28 * -------------------------------------------------------------------- */
29
30
31 #include "arm_math.h"
32
33 /**   
34  * @ingroup groupTransforms   
35  */
36
37 /**   
38  * @addtogroup CFFT_CIFFT   
39  * @{   
40  */
41
42 /**   
43 * \par   
44 * Pseudo code for Generation of Bit reversal Table is   
45 * \par   
46 * <pre>for(l=1;l <= N/4;l++)   
47 * {   
48 *   for(i=0;i<logN2;i++)   
49 *   {    
50 *     a[i]=l&(1<<i);   
51 *   }   
52 *   for(j=0; j<logN2; j++)   
53 *   {   
54 *     if (a[j]!=0)   
55 *     y[l]+=(1<<((logN2-1)-j));   
56 *   }   
57 *   y[l] = y[l] >> 1;   
58 *  } </pre>   
59 * \par   
60 * where N = 1024        logN2 = 10   
61 * \par   
62 * N is the maximum FFT Size supported   
63 */
64
65 /*   
66 * @brief  Table for bit reversal process   
67 */
68 const uint16_t armBitRevTable[256] = {
69   0x100, 0x80, 0x180, 0x40, 0x140, 0xc0, 0x1c0,
70   0x20, 0x120, 0xa0, 0x1a0, 0x60, 0x160, 0xe0,
71   0x1e0, 0x10, 0x110, 0x90, 0x190, 0x50, 0x150,
72   0xd0, 0x1d0, 0x30, 0x130, 0xb0, 0x1b0, 0x70,
73   0x170, 0xf0, 0x1f0, 0x8, 0x108, 0x88, 0x188,
74   0x48, 0x148, 0xc8, 0x1c8, 0x28, 0x128, 0xa8,
75   0x1a8, 0x68, 0x168, 0xe8, 0x1e8, 0x18, 0x118,
76   0x98, 0x198, 0x58, 0x158, 0xd8, 0x1d8, 0x38,
77   0x138, 0xb8, 0x1b8, 0x78, 0x178, 0xf8, 0x1f8,
78   0x4, 0x104, 0x84, 0x184, 0x44, 0x144, 0xc4,
79   0x1c4, 0x24, 0x124, 0xa4, 0x1a4, 0x64, 0x164,
80   0xe4, 0x1e4, 0x14, 0x114, 0x94, 0x194, 0x54,
81   0x154, 0xd4, 0x1d4, 0x34, 0x134, 0xb4, 0x1b4,
82   0x74, 0x174, 0xf4, 0x1f4, 0xc, 0x10c, 0x8c,
83   0x18c, 0x4c, 0x14c, 0xcc, 0x1cc, 0x2c, 0x12c,
84   0xac, 0x1ac, 0x6c, 0x16c, 0xec, 0x1ec, 0x1c,
85   0x11c, 0x9c, 0x19c, 0x5c, 0x15c, 0xdc, 0x1dc,
86   0x3c, 0x13c, 0xbc, 0x1bc, 0x7c, 0x17c, 0xfc,
87   0x1fc, 0x2, 0x102, 0x82, 0x182, 0x42, 0x142,
88   0xc2, 0x1c2, 0x22, 0x122, 0xa2, 0x1a2, 0x62,
89   0x162, 0xe2, 0x1e2, 0x12, 0x112, 0x92, 0x192,
90   0x52, 0x152, 0xd2, 0x1d2, 0x32, 0x132, 0xb2,
91   0x1b2, 0x72, 0x172, 0xf2, 0x1f2, 0xa, 0x10a,
92   0x8a, 0x18a, 0x4a, 0x14a, 0xca, 0x1ca, 0x2a,
93   0x12a, 0xaa, 0x1aa, 0x6a, 0x16a, 0xea, 0x1ea,
94   0x1a, 0x11a, 0x9a, 0x19a, 0x5a, 0x15a, 0xda,
95   0x1da, 0x3a, 0x13a, 0xba, 0x1ba, 0x7a, 0x17a,
96   0xfa, 0x1fa, 0x6, 0x106, 0x86, 0x186, 0x46,
97   0x146, 0xc6, 0x1c6, 0x26, 0x126, 0xa6, 0x1a6,
98   0x66, 0x166, 0xe6, 0x1e6, 0x16, 0x116, 0x96,
99   0x196, 0x56, 0x156, 0xd6, 0x1d6, 0x36, 0x136,
100   0xb6, 0x1b6, 0x76, 0x176, 0xf6, 0x1f6, 0xe,
101   0x10e, 0x8e, 0x18e, 0x4e, 0x14e, 0xce, 0x1ce,
102   0x2e, 0x12e, 0xae, 0x1ae, 0x6e, 0x16e, 0xee,
103   0x1ee, 0x1e, 0x11e, 0x9e, 0x19e, 0x5e, 0x15e,
104   0xde, 0x1de, 0x3e, 0x13e, 0xbe, 0x1be, 0x7e,
105   0x17e, 0xfe, 0x1fe, 0x1
106 };
107
108 /**   
109  * @} end of CFFT_CIFFT group   
110  */
111
112 /*   
113 * @brief  Q15 table for reciprocal   
114 */
115 const q15_t armRecipTableQ15[64] = {
116   0x7F03, 0x7D13, 0x7B31, 0x795E, 0x7798, 0x75E0,
117   0x7434, 0x7294, 0x70FF, 0x6F76, 0x6DF6, 0x6C82,
118   0x6B16, 0x69B5, 0x685C, 0x670C, 0x65C4, 0x6484,
119   0x634C, 0x621C, 0x60F3, 0x5FD0, 0x5EB5, 0x5DA0,
120   0x5C91, 0x5B88, 0x5A85, 0x5988, 0x5890, 0x579E,
121   0x56B0, 0x55C8, 0x54E4, 0x5405, 0x532B, 0x5255,
122   0x5183, 0x50B6, 0x4FEC, 0x4F26, 0x4E64, 0x4DA6,
123   0x4CEC, 0x4C34, 0x4B81, 0x4AD0, 0x4A23, 0x4978,
124   0x48D1, 0x482D, 0x478C, 0x46ED, 0x4651, 0x45B8,
125   0x4521, 0x448D, 0x43FC, 0x436C, 0x42DF, 0x4255,
126   0x41CC, 0x4146, 0x40C2, 0x4040
127 };
128
129 /*   
130 * @brief  Q31 table for reciprocal   
131 */
132 const q31_t armRecipTableQ31[64] = {
133   0x7F03F03F, 0x7D137420, 0x7B31E739, 0x795E9F94, 0x7798FD29, 0x75E06928,
134   0x7434554D, 0x72943B4B, 0x70FF9C40, 0x6F760031, 0x6DF6F593, 0x6C8210E3,
135   0x6B16EC3A, 0x69B526F6, 0x685C655F, 0x670C505D, 0x65C4952D, 0x6484E519,
136   0x634CF53E, 0x621C7E4F, 0x60F33C61, 0x5FD0EEB3, 0x5EB55785, 0x5DA03BEB,
137   0x5C9163A1, 0x5B8898E6, 0x5A85A85A, 0x598860DF, 0x58909373, 0x579E1318,
138   0x56B0B4B8, 0x55C84F0B, 0x54E4BA80, 0x5405D124, 0x532B6E8F, 0x52556FD0,
139   0x5183B35A, 0x50B618F3, 0x4FEC81A2, 0x4F26CFA2, 0x4E64E64E, 0x4DA6AA1D,
140   0x4CEC008B, 0x4C34D010, 0x4B810016, 0x4AD078EF, 0x4A2323C4, 0x4978EA96,
141   0x48D1B827, 0x482D77FE, 0x478C1657, 0x46ED801D, 0x4651A2E5, 0x45B86CE2,
142   0x4521CCE1, 0x448DB244, 0x43FC0CFA, 0x436CCD78, 0x42DFE4B4, 0x42554426,
143   0x41CCDDB6, 0x4146A3C6, 0x40C28923, 0x40408102
144 };