Hi, I have been struggling to get expected results using an input array of 256 in length when compared to the equivalent in scipy. It seems to work fine when using a smaller input, e.g. length 8.
I might be missing something.
Here's the python script I have used to generate the expected results:
`import numpy as np
import scipy as sc
arr = np.array([
0.89968999,
0.89968999,
0.89968999,
0.89968999,
0.89968999,
0.61548992,
0.89968999,
0.61548992,
0.61548992,
0.33128984,
0.33128984,
0.047089768,
0.047089768,
0.33128984,
0.33128984,
0.33128984,
0.61548992,
0.89968999,
1.1838901,
0.61548992,
0.047089768,
-0.23711031,
0.047089768,
0.89968999,
0.33128984,
-1.3739106,
-1.3739106,
-1.3739106,
-0.23711031,
0.047089768,
0.61548992,
0.61548992,
-0.52131038,
-1.6581107,
-2.2265108,
-1.9423108,
-0.80551046,
-0.52131038,
0.33128984,
0.33128984,
0.61548992,
0.33128984,
0.047089768,
-0.23711031,
-0.23711031,
-0.52131038,
-0.80551046,
-0.80551046,
-0.52131038,
-0.52131038,
-0.52131038,
-0.23711031,
-0.52131038,
-0.23711031,
-0.23711031,
-0.23711031,
-0.52131038,
-0.52131038,
-0.52131038,
-0.52131038,
0.047089768,
0.33128984,
0.89968999,
0.33128984,
0.89968999,
0.89968999,
-0.23711031,
-0.80551046,
-0.80551046,
0.047089768,
1.1838901,
1.4680901,
0.89968999,
-0.52131038,
-0.80551046,
-0.52131038,
-0.23711031,
0.047089768,
-0.23711031,
-0.52131038,
-0.52131038,
0.047089768,
0.047089768,
0.33128984,
0.047089768,
0.047089768,
0.047089768,
0.047089768,
0.047089768,
0.047089768,
-0.23711031,
-0.23711031,
0.047089768,
0.047089768,
0.33128984,
0.047089768,
-0.23711031,
-0.23711031,
0.047089768,
0.89968999,
0.89968999,
1.1838901,
0.61548992,
-0.23711031,
0.047089768,
-0.23711031,
-0.23711031,
-0.23711031,
-0.23711031,
-0.52131038,
-0.52131038,
-1.9423108,
-2.2265108,
-2.5107109,
-1.6581107,
-0.52131038,
0.33128984,
1.4680901,
1.1838901,
0.61548992,
-0.23711031,
-0.52131038,
-0.52131038,
-0.52131038,
-0.52131038,
0.047089768,
0.047089768,
0.047089768,
-0.23711031,
-0.52131038,
-0.80551046,
-0.80551046,
-0.23711031,
0.047089768,
0.047089768,
-0.23711031,
-0.23711031,
-0.23711031,
-0.23711031,
0.047089768,
0.33128984,
0.33128984,
1.7522902,
0.89968999,
0.33128984,
0.33128984,
-0.80551046,
-0.80551046,
-1.0897105,
-0.23711031,
0.61548992,
0.61548992,
-0.23711031,
-0.80551046,
-1.0897105,
-0.80551046,
-0.23711031,
0.047089768,
0.047089768,
0.047089768,
-0.23711031,
0.33128984,
0.61548992,
0.61548992,
0.61548992,
0.33128984,
0.33128984,
0.33128984,
0.047089768,
0.047089768,
-0.23711031,
-0.23711031,
0.047089768,
0.047089768,
0.047089768,
0.047089768,
-0.23711031,
0.047089768,
0.33128984,
0.61548992,
0.61548992,
0.89968999,
0.33128984,
-0.52131038,
0.33128984,
-0.23711031,
-0.23711031,
-0.23711031,
-0.23711031,
-0.23711031,
-0.52131038,
-1.3739106,
-2.2265108,
-2.794911,
-2.2265108,
-0.80551046,
0.89968999,
1.4680901,
1.1838901,
0.33128984,
-0.23711031,
-0.23711031,
-0.80551046,
-1.0897105,
-0.52131038,
0.047089768,
0.61548992,
0.61548992,
0.33128984,
0.047089768,
-0.23711031,
-0.23711031,
-0.23711031,
-0.23711031,
0.047089768,
0.33128984,
0.89968999,
0.89968999,
1.1838901,
0.89968999,
-0.23711031,
0.047089768,
2.0364903,
2.3206904,
0.61548992,
-0.52131038,
-1.0897105,
-0.52131038,
0.33128984,
0.61548992,
-0.23711031,
-0.80551046,
-1.6581107,
-1.9423108,
-1.0897105,
-0.52131038,
-0.23711031,
-0.52131038,
-0.23711031,
0.047089768,
0.33128984,
0.89968999,
0.61548992,
0.89968999,
0.61548992,
0.61548992,
0.61548992,
0.61548992,
0.61548992,
0.33128984,
0.33128984,
0.33128984,
0.33128984,
0.047089768,
0.33128984,
0.33128984
]);
v1 = sc.fft(arr)
for p in v1:
print("Complex(real: {0}, imaginary: {1}),".format(p.real,p.imag))`
I have been trying to test by modifying the 'fft of a signal' test in: test/scidart/fftpack/fft/fft_test.dart.
The first result at position 0 matches, but from position 1 on there is a mismatch.
Error in test from position 1:
Expected: <17.68839497>
Actual: <11.41557497>
Thanks.