FFT from scilab is different than wolfram alpha [closed]

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

closed as off-topic by Xander Henderson, Alexander Gruber♦May 21 at 1:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is not about mathematics, within the scope defined in the help center." – Xander Henderson, Alexander Gruber
If this question can be reworded to fit the rules in the help center, please edit the question.

• There are different definitions of the discrete Fourier transform that are normalized differently. Within a consistent definition, a change to the forward transform causes the opposite change to the inverse transform, so they still invert one another. – Ian May 20 at 13:33
• @someuser The ratio is the same. – PierreCarre May 20 at 13:33
• I doubt that both numbers are exactly integers. Does Scilab round the result somehow (then it might be the same result, before the rounding)? – Dirk May 20 at 13:43
• @PierreCarre You are right, didn't noticed that. When I compute in Wolfram fft([1,2])*sqrt(2) it's exactly the same as Scilab. But still do not understand why. – someuser1 May 20 at 13:45
• @Dirk No, they're integers in this convention; the first one is $1 \cdot e^0 + 2 \cdot e^0=3$ and the second one is $1 \cdot e^0+2 \cdot e^{\pi i}=-1$. – Ian May 20 at 13:58

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$$

• Now, it's more clear :) 1/sqrt(N) is about normalization? – someuser1 May 20 at 14:03
• @someuser1 Yes, as it was mentioned in a comment, the important thing is to define the inverse discrete Fourier transform in a compatible way. – PierreCarre May 20 at 14:05
• @someuser1 In Wolfram's documentation they mention that {1,-1} is the usual convention in signal processing, while {1,-1} is the usual convention in data analysis. Their default is {0,1}. – PierreCarre May 20 at 14:09
• @PierreCarre Sign error in your last comment. – Jean-Claude Arbaut May 20 at 14:11
• @someuser1 See also reference.wolfram.com/language/tutorial/FourierTransforms.html – Jean-Claude Arbaut May 20 at 14:12