This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP2812调用FFT库,相位计算不对



rfft.ipcbptr = ipcb; 
rfft.magptr = mag; 
rfft.winptr = (long *)win;
rfft.init(&rfft);

RFFT32_brev(ipcb, ipcb, FFT_SIZE);
rfft.calc(&rfft);
rfft.split(&rfft); 
rfft.mag(&rfft);

计算结果中的mag[]数组里面的各次谐波幅值是正确的,看文档,计算后的ipcb[2i]和ipcb[2i+1]存放实部和虚部,所以我用的相位计算为artan(ipcb[2i]/ipcb[2i+1]),计算出的相位一直在波动,查看后ipcb[2i]和ipcb[2i+1]这两个值也是波动的,难道mag[i]不等于ipcb[2i]和ipcb[2i+1]的平方和?如果是这样的话,相位如何计算?求指教