| | |
| | | void Uart5SendPacket(char * str, int len); |
| | | |
| | | //正弦表,0 - 360 代表 0 - 2PI,结果0 - 1000 表示0 - 1,表中只有0 - PI/2即1/4周期的数据,其他的数据用对称和镜像得到。 |
| | | int SinTable[] = |
| | | const int SinTable[] = |
| | | { |
| | | 0,17,35, 52, 70, 87, 105, 122, 139, 156, 174, 191, 208, 225, 242, 259, 276, 292, |
| | | 309, 326, 342, 358, 375, 391, 407, 423, 438, 454, 469, 485, 500, 515, 530, 545, |
| | |
| | | -423, -407, -391, -375, -358, -342, -326, -309, -292, -276, -259, -242, -225, |
| | | -208, -191, -174, -156, -139, -122, -105, -87, -70, -52, -35, -17 |
| | | }; |
| | | int CosTable[] = |
| | | const int CosTable[] = |
| | | { |
| | | 1000 ,999 ,999 ,998 ,996 ,995 ,993 ,990 ,988 ,985 ,982 ,978 ,974 ,970 ,966 ,961 |
| | | ,956 ,951 ,946 ,940 ,934 ,927 ,921 ,914 ,906 ,899 ,891 ,883 ,875 ,866 ,857 ,848 |
| | |
| | | }; |
| | | |
| | | |
| | | unsigned char sintab[256]={ //正弦表,0 - 1024代表 0 - 2PI,结果0 - 255表示0 - 1,表中只有0 - PI/2即1/4周期的数据,其他的数据用对称和镜像得到。 |
| | | const unsigned char sintab[256]={ //正弦表,0 - 1024代表 0 - 2PI,结果0 - 255表示0 - 1,表中只有0 - PI/2即1/4周期的数据,其他的数据用对称和镜像得到。 |
| | | 0, 1, 3, 4, 6, 7, 9, 10, 12, 14, 15, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 32, 34, 36, 37, 39, 40, 42, 43, 45, 46, |
| | | 48, 49, 51, 53, 54, 56, 57, 59, 60, 62, 63, 65, 66, 68, 69, 71, 72, 74, 75, 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, |
| | | 92, 93, 95, 96, 97, 99, 100, 102, 103, 105, 106, 108, 109, 110, 112, 113, 115, 116, 117, 119, 120, 122, 123, 124, |
| | |
| | | return (-d); |
| | | } |
| | | |
| | | return a; |
| | | // return a; |
| | | } |
| | | |
| | | int cosi(int a) |