13
$\begingroup$

Is there a fast Fourier transform in Mathematica? Although looking in the help I could not find one.

I am looking to implement the equivalent of fft in MATLAB.

$\endgroup$
  • $\begingroup$ There is definitely something different going on with Fourier[] than the fft function in Matlab. If you take the fft(eye(n)) in Matlab you get the FourierMatrix of n. In Mathematica you do not. FourierMatrix[n] does exist, but the method of obtaining it via Fourier[IdentityMatrix[n]] does not work in Mathematica, so the fft and Fourier functions are different somehow. $\endgroup$ – David Apr 14 '18 at 22:30
17
$\begingroup$

Fourier[list] computes the discrete Fourier transform of list. I assume it uses the FFT when it can.

$\endgroup$
  • 8
    $\begingroup$ Note that the normalization used by Mathematica is quite different from conventional (e.g. physics, signal processing) normalizations. Check the definition you are using, and set the option FourierParameters accordingly. $\endgroup$ – J. M. will be back soon Feb 2 '12 at 14:15
  • $\begingroup$ Is there a way to strip it out ? In Matalab syntax I need to do the following : function fs = MyFFT(fx) y = fftshift(fx); tmp = fft(y)/sqrt(length(fx)); fs = fftshift(tmp); $\endgroup$ – 500 Feb 2 '12 at 14:27
  • $\begingroup$ fftshift[vec_?VectorQ] := RotateRight[vec, Quotient[Length[vec], 2]] $\endgroup$ – J. M. will be back soon Feb 2 '12 at 14:39
  • 10
    $\begingroup$ For reference: MATLAB's fft(stuff) is equivalent to Mathematica's Fourier[stuff, FourierParameters -> {1, -1}]. To do fft(y)/sqrt(length(y)), one doesn't need to do an explicit division, as the adjustment of FourierParameters is all that's needed: Fourier[y, FourierParameters -> {0, -1}]. $\endgroup$ – J. M. will be back soon Feb 2 '12 at 15:00
  • 1
    $\begingroup$ @A.Vieira, under the fifth and sixth bullets of "Details and Options" for Fourier[] and fourth and fifth bullets of "Details and Options" for FourierTransform[], are explanations on how the FourierParameters option affects them. There should be similar notations in the other Fourier-related functions of Mathematica that take the FourierParameters setting. $\endgroup$ – J. M. will be back soon Sep 8 '17 at 14:29
14
$\begingroup$

Fourier uses FFT when possible

$\endgroup$

protected by J. M. will be back soon Mar 17 at 14:57

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.