FFTS FFT 和 Matlab FFT 之间的不同结果值

Different result value between FFTS FFT and Matlab FFT

我是 fft 新手。我正在将代码从 Matlab 转换为 java/c 以便在 Android 设备中使用。我可以使用像 Jtransform 和 Jwave 这样的纯 java fft 库来做到这一点,但我想使用 FFTS (https://github.com/anthonix/ffts) for native performance but the output not the same, i don't know why. I read on Matlab site they say about scaling (http://www.mathworks.com/matlabcentral/answers/15770-scaling-the-fft-and-the-ifft),但我找不到匹配两个结果值的缩放比例。

我更新输出: Matlab:

x = [0,1,2,3,4,5,6,7]
X=fft(x,8);

28.0000000000000 + 0.00000000000000i    
-4.00000000000000 + 9.65685424949238i
-4.00000000000000 + 4.00000000000000i
-4.00000000000000 + 1.65685424949238i
-4.00000000000000 + 0.00000000000000i
-4.00000000000000 - 1.65685424949238i
-4.00000000000000 - 4.00000000000000i
-4.00000000000000 - 9.65685424949238i

FFTS:

FFTS fft = FFTS.real(FFTS.FORWARD, 8);
fft.execute(x,output);

28.000000 + 0.000000i
-4.000000 + 9.656855i
-4.000000 + 4.000000i
-4.000000 + 1.656854i
0.000000 + 0.000000i
0.000000 + 0.000000i
0.000000 + 0.000000i
0.000000 + 0.000000i

真正的 FFT (fft.real()) 不会 return 完整 FFT 结果的第二部分。这是因为,给定严格的实数输入(不是复数据类型,或所有虚部都为零),FFT 结果是共轭对称的;因此第二部分是多余的(共轭后)。

完整的 FFT return 是复数结果向量的第二半,即使是冗余的。 (仅当输入为具有非零虚部的复数时,完整 FFT 的第二部分才是非冗余的。fft.real() 不允许这种输入。)