scidart icon indicating copy to clipboard operation
scidart copied to clipboard

rifft is giving diffrent values from np.fft.irfft

Open vishalideastoimpact opened this issue 2 years ago • 0 comments

In dart: var X = ArrayComplex([ Complex(real: 31.108143074615633, imaginary: -4.037293439117874), Complex(real: -22.413467454124664, imaginary: 0.5718233105591632), Complex(real: 11.988831263334843, imaginary: 0.04538347618383224), ]);

var mockPrint = ff.rifft(X); print(mockPrint);

output: Array([1.0876611583738058, 4.608367320860204, 22.003620671218734, 5.167541335271735])

In python: mockPrint = np.fft.irfft([31.108143074615633-4.037293439117874j,-22.413467454124664+0.5718233105591632j, 11.988831263334843+0.04538347618383224j])

print(mockPrint[0]) 
print(mockPrint[1]) 
print(mockPrint[2]) 
print(mockPrint[3]) 

output: -0.4324901425747125 4.493916297540616 21.98097731154995 5.065739608099778

for large chunk of data ouput vary the most

vishalideastoimpact avatar May 23 '22 09:05 vishalideastoimpact