FFT from scilab is different than wolfram alpha

396 Views Asked by At

I am getting completely different values of FFT([1,2]) in scilab and Wolfram. I wondering what is going on and who is right.

Wolfram alpha: fft([1,2]):
{2.12132, -0.707107}

Wolfram alpha output image

Scilab fft([1,2]):
3.  -1.

Scilab output image

1

There are 1 best solutions below

8
On BEST ANSWER

It really depends on the definition... Scilab is using $$ X_k = \sum_{n=0}^{N-1}x_ n e^{-i 2 \pi k n/N}, \quad k = 0, \cdots, N-1 $$

While Wolfram's default definition is

$$ X_k = \frac{1}{\sqrt{N}}\sum_{n=0}^{N-1}x_ n e^{-i 2 \pi k n/N}, \quad k = 0, \cdots, N-1 $$

If you want Wolfram to use the same definition, you must use the parameter "FourierParameters->{1,-1}". The general case in Wolfram ({a,b}) is

$$ X_k = \frac{1}{n^{(1-a)/2}}\sum_{n=0}^{N-1}x_ n e^{i 2 b \pi k n/N}, \quad k = 0, \cdots, N-1 $$