第一列是采样时刻,第二列是变量p->test=(p->ualpha-p->za)*_IQ12(0.01367);(这一步数据没有问题)是正常的正弦波形
第三列是变量p->test1=p->test/4096;(/4096这一步出现错误,但是波形变化是正常的,还是同步的正弦)怎么会有这么大的偏差呢?
简而言之,我的问题就是:为什么第二列的数据除以4096或者说右移12位,会得到第三列的结果???所以变量均是定义的32位、、、
1,27390,-873
2,28930,-872
3,28545,-873
4,27005,-873
5,25630,-873
6,22935,-874
7,21175,-874
8,18865,-875
9,16225,-876
10,13200,-876
11,10065,-877
12,6380,-878
13,2310,-879
14,-1540,-880
15,-5060,-881
16,-6710,-881
17,-9570,-882
18,-10780,-882
19,-12485,-883
20,-13915,-883
21,-16170,-883
22,-17380,-884
23,-16665,-884
24,-15235,-883
25,-12870,-883
26,-10615,-882
27,-7645,-881
28,-5335,-881
29,-3410,-880 |