基于单片机128采样输出的正弦波输程序--查表法
比较简单,纯代码贴出,使用时只需要按一定的频率取出表中128点数据送给DA即可。
static unsigned int code Sin128N[128]= { 512, 537, 562, 587, 611, 636, 660, 684, 707, 730, 753, 775, 796, 816, 836, 855, 873, 891, 907, 923, 937, 951, 963, 974, 984, 993,1001,1008,1014,1018,1021,1023, 1023,1023,1021,1018,1014,1008,1002, 994, 985, 975, 963, 951, 938, 923, 908, 891, 874, 856, 837, 817, 797, 775, 753, 731, 708, 685, 661, 637, 612, 587, 562, 537, 512, 487, 462, 437, 412, 388, 364, 340, 316, 293, 271, 249, 228, 207, 187, 168, 150, 133, 116, 101, 86, 73, 60, 49, 39, 30, 22, 15, 10, 5, 2, 0, 0, 0, 2, 5, 9, 15, 21, 29, 38, 48, 59, 72, 85, 99, 115, 131, 148, 167, 186, 205, 226, 247, 269, 291, 314, 338, 361, 386, 410, 435, 460, 485, };
凯特网版权声明:以上内容允许转载,但请注明出处,谢谢!