別の質問があります。私がすでに尋ねた他のものと非常に似ています(そして大きな助けを得ました - ありがとうございました)。残念ながら、他のスレッドからの解決策はここでは機能しません: (http://stackoverflow.com/questions/8680909/fft-in-matlab-and-numpy-scipy-give-different-results)
今それは ifft についてです:
# i have an array 'aaa' of shape (6,) such as:
for i in aaa: print i
...
(1.22474487139+0j)
(-0.612372435696-1.06066017178j)
(-0.612372435696+1.06066017178j)
(1.22474487139+0j)
(-0.612372435696-1.06066017178j)
(-0.612372435696+1.06066017178j)
#when i perform np.ifft the result is:
np.fft.ifft(aaa)
array([ 1.48029737e-16 +1.48029737e-16j,
-8.26024733e-17 -1.72464044e-16j,
1.22474487e+00 -3.94508649e-16j,
3.70074342e-17 -2.96059473e-16j,
-2.22044605e-16 +2.46478913e-16j, 4.55950391e-17 +4.68523518e-16j])
###################################################################
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BUT IN MATLAB
% the same array...
aaa =
1.2247
-0.6124 - 1.0607i
-0.6124 + 1.0607i
1.2247
-0.6124 - 1.0607i
-0.6124 + 1.0607i
% ...gives the result:
ifft(aaa)
ans =
-0.0000
0
1.2247
0
0
0
range(1,6) のような実数で実験を行いました。結果は同じです。精度の問題だろうか。しかし、なぜ結果がそれほど大きく異なるのでしょうか? 多分誰かが問題を解決する方法を知っていますか?