微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 单片机编程要用的正弦表

单片机编程要用的正弦表

时间:12-01 来源:互联网 点击:
这个正弦表可以直接嵌入到程序中实现软件模拟正弦波

uchar code sin[120]={0x87,0x8D,0x94,0x9B,0xA1,0xA8,0xAE,0xB4,0x1BA,0xC0,
0xC6,0xCB,0xD1,0xD5,0xDB,0xDF,0xE3,0xE7,0xE8,0xEF,0xF2,0xF5,0xF7,0xFA,0xFC,
0xFD,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFD,0xFC,0xFA,0xF7,0xF5,0xF2,0xEF,
0xE8,0xE7,0xE3,0xDF,0xDB,0xD5,0xD1,0xCB,0xC6,0xC0,0xBA,0xB4,0xAE,0xA8,0xA1,
0x9B,0x94,0X8D,0x87,0x80,0x79,0x73,0x6C,0x65,0x5F,0x58,0x52,0x4C,0x46,0x40,
0x3A,0x35,0x2F,0x2A,0x25,0x21,0x1D,0x18,0x15,0x11,0x0E,0x0B,0x08,0x06,0x04,
0x03,0x02,0x01,0x00,0x00,0x00,0x01,0x02,0x03,0x04,0x06,0x09,0x0B,0x0E,0x11,
0x15,0x18,0x1D,0x21,0x25,0x2A,0x2F,0x35,0x3A,0x40,0x46,0x4C,0x52,0x58,0x5F,
0x65,0x6C,0x73,0x79,0x80}; //120个点

const float sin[256]={/*256点正弦查找表*/
0.00000,0.02464,0.04926,0.07385,0.09840,0.12289,0.14730,0.17163,0.19585,0.21995,0.24391,
0.26773,0.29139,0.31487,0.33816,0.36124,0.38411,0.40674,0.42912,0.45124,0.47309,0.49466,
0.51592,0.53687,0.55749,0.57777,0.59771,0.61728,0.63647,0.65528,0.67370,0.69170,0.70928,
0.72643,0.74314,0.75940,0.77520,0.79053,0.80538,0.81974,0.83360,0.84696,0.85980,0.87212,
0.88391,0.89516,0.90587,0.91603,0.92564,0.93468,0.94315,0.95106,0.95838,0.96512,0.97128,
0.97685,0.98182,0.98620,0.98998,0.99316,0.99573,0.99771,0.99907,0.99983,0.99998,0.99953,
0.99846,0.99680,0.99452,0.99164,0.98817,0.98409,0.97941,0.97414,0.96828,0.96183,0.95479,
0.94718,0.93899,0.93023,0.92091,0.91102,0.90059,0.88960,0.87808,0.86603,0.85344,0.84034,
0.82673,0.81262,0.79802,0.78293,0.76736,0.75133,0.73484,0.71791,0.70054,0.68275,0.66454,
0.64593,0.62692,0.60754,0.58779,0.56767,0.54722,0.52643,0.50533,0.48391,0.46220,0.44022,
0.41796,0.39545,0.37270,0.34973,0.32654,0.30315,0.27958,0.25584,0.23195,0.20791,0.18375,
0.15948,0.13511,0.11065,0.08613,0.06156,0.03695,0.01232,-0.01232,-0.03695,-0.06156,
-0.08613,-0.11065,-0.13511,-0.15948,-0.18375,-0.20791,-0.23195,-0.25584,-0.27958,-0.30315,
-0.32654,-0.34973,-0.37270,-0.39545,-0.41796,-0.44022,-0.46220,-0.48391,-0.50533,-0.52643,
-0.54722,-0.56767,-0.58779,-0.60754,-0.62692,-0.64593,-0.66454,-0.68275,-0.70054,-0.71791,
-0.73484,-0.75133,-0.76736,-0.78293,-0.79802,-0.81262,-0.82673,-0.84034,-0.85344,-0.86603,
-0.87808,-0.88960,-0.90059,-0.91102,-0.92091,-0.93023,-0.93899,-0.94718,-0.95479,-0.96183,
-0.96828,-0.97414,-0.97941,-0.98409,-0.98817,-0.99164,-0.99452,-0.99680,-0.99846,-0.99953,
-0.99998,-0.99983,-0.99907,-0.99771,-0.99573,-0.99316,-0.98998,-0.98620,-0.98182,-0.97685,
-0.97128,-0.96512,-0.95838,-0.95106,-0.94315,-0.93468,-0.92564,-0.91603,-0.90587,-0.89516,
-0.88391,-0.87212,-0.85980,-0.84696,-0.83360,-0.81974,-0.80538,-0.79053,-0.77520,-0.75940,
-0.74314,-0.72643,-0.70928,-0.69170,-0.67370,-0.65528,-0.63647,-0.61728,-0.59771,-0.57777,
-0.55749,-0.53687,-0.51592,-0.49466,-0.47309,-0.45124,-0.42912,-0.40674,-0.38411,-0.36124,
-0.33816,-0.31487,-0.29139,-0.26773,-0.24391,-0.21995,-0.19585,-0.17163,-0.14730,-0.12289,
-0.09840,-0.07385,-0.04926,-0.02464,-0.00000};

const float sin[1024]={
0.00000,0.00614,0.01228,0.01842,0.02457,0.03070,0.03684,0.04298,0.04912,0.05525,0.06138,
0.06751,0.07364,0.07976,0.08588,0.09200,0.09811,0.10422,0.11033,0.11643,0.12253,0.12862,
0.13471,0.14079,0.14687,0.15295,0.15901,0.16507,0.17113,0.17718,0.18322,0.18925,0.19528,
0.20130,0.20731,0.21332,0.21931,0.22530,0.23128,0.23725,0.24321,0.24917,0.25511,0.26104,
0.26697,0.27288,0.27878,0.28468,0.29056,0.29643,0.30229,0.30814,0.31398,0.31980,0.32562,
0.33142,0.33721,0.34298,0.34874,0.35449,0.36023,0.36595,0.37166,0.37736,0.38304,0.38870,
0.39436,0.39999,0.40561,0.41122,0.41681,0.42239,0.42795,0.43349,0.43902,0.44453,0.45002,
0.45549,0.46095,0.46640,0.47182,0.47723,0.48261,0.48798,0.49334,0.49867,0.50398,0.50928,
0.51456,0.51981,0.52505,0.53027,0.53546,0.54064,0.54580,0.55093,0.55605,0.56114,0.56622,
0.57127,0.57630,0.58131,0.58629,0.59126,0.59620,0.60112,0.60602,0.61089,0.61574,0.62057,
0.62537,0.63016,0.63491,0.63965,0.64435,0.64904,0.65370,0.65834,0.66295,0.66753,0.67209,
0.67663,0.68114,0.68562,0.69008,0.69451,0.69892,0.70330,0.70765,0.71198,0.71628,0.72055,
0.72479,0.72901,0.73320,0.73736,0.74150,0.74561,0.74968,0.75373,0.75776,0.76175,0.76572,
0.76965,0.77356,0.77744,0.78128,0.78510,0.78889,0.79265,0.79638,0.80008,0.80375,0.80739,
0.81100,0.81458,0.81812,0.82164,0.82513,0.82858,0.83200,0.83539,0.83875,0.84208,0.84538,
0.84864,0.85188,0.85508,0.85825,0.86138,0.86449,0.86756,0.87060,0.87360,0.87657,0.87951,
0.88242,0.88529,0.88813,0.89094,0.89371,0.89645,0.89915,0.90182,0.90446,0.90706,0.90963,
0.91217,0.91467,0.91713,0.91956,0.92196,0.92432,0.92665,0.92894,0.93119,0.93342,0.93560,
0.93775,0.93987,0.94195,0.94399,0.94600,0.94797,0.94991,0.95181,0.95368,0.95551,0.95730,
0.95906,0.96078,0.96247,0.96411,0.96573,0.96730,0.96884,0.97035,0.97181,0.97324,0.97463,
0.97599,0.97731,0.97859,0.97984,0.98105,0.98222,0.98335,0.98445,0.98551,0.98653,0.98752,
0.98847,0.98938,0.99025,0.99109,0.99189,0.99265,0.99338,0.99406,0.99471,0.99532,0.99590,
0.99644,0.99694,0.99740,0.99782,0.99821,0.99856,0.99887,0.99914,0.99938,0.99957,0.99973,
0.99986,0.99994,0.99999,1.00000,0.99997,0.99990,0.99980,0.99966,0.99948,0.99926,0.99901,
0.99872,0.99839,0.99802,0.99761,0.99717,0.99669,0.99617,0.99562,0.99502,0.99439,0.99372,
0.99302,0.99228,0.99149,0.99068,0.98982,0.98893,0.98800,0.98703,0.98603,0.98498,0.98391,
0.98279,0.98164,0.98045,0.97922,0.97796,0.97665,0.97532,0.97394,0.97253,0.97108,0.96960,
0.96808,0.96652,0.96493,0.96329,0.96163,0.95992,0.95819,0.95641,0.95460,0.95275,0.95087,
0.94895,0.94699,0.94500,0.94297,0.94091,0.93881,0.93668,0.93451,0.93231,0.93007,0.92780,
0.92549,0.92314,0.92076,0.91835,0.91590,0.91342,0.91090,0.90835,0.90577,0.90315,0.90049,
0.89780,0.89508,0.89233,0.88954,0.88672,0.88386,0.88097,0.87805,0.87509,0.87210,0.86908,
0.86603,0.86294,0.85982,0.85667,0.85348,0.85026,0.84702,0.84374,0.84042,0.83708,0.83370,
0.83029,0.82686,0.82339,0.81989,0.81635,0.81279,0.80920,0.80557,0.80192,0.79823,0.79452,
0.79078,0.78700,0.78320,0.77936,0.77550,0.77161,0.76769,0.76374,0.75976,0.75575,0.75171,
0.74765,0.74356,0.73943,0.73529,0.73111,0.72691,0.72267,0.71841,0.71413,0.70982,0.70548,
0.70111,0.69672,0.69230,0.68785,0.68338,0.67889,0.67436,0.66981,0.66524,0.66064,0.65602,
0.65137,0.64670,0.64200,0.63728,0.63254,0.62777,0.62298,0.61816,0.61332,0.60846,0.60357,
0.59866,0.59373,0.58878,0.58380,0.57881,0.57379,0.56874,0.56368,0.55860,0.55349,0.54837,
0.54322,0.53805,0.53287,0.52766,0.52243,0.51719,0.51192,0.50663,0.50133,0.49601,0.49066,
0.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top