Mathematica 9 is now available
Previous section-----Next section

3.8.4 Fourier Transforms

A common operation in analyzing various kinds of data is to find the Fourier transform, or spectrum, of a list of values. The idea is typically to pick out components of the data with particular frequencies, or ranges of frequencies.

Fourier[{ ,  , ... ,  }] Fourier transform
InverseFourier[{ ,  , ... ,  }] inverse Fourier transform

Fourier transforms.
Here is some data, corresponding to a square pulse.

In[1]:=  {-1, -1, -1, -1, 1, 1, 1, 1}

Out[1]=

Here is the Fourier transform of the data. It involves complex numbers.

In[2]:=  Fourier[%]

Out[2]=

Here is the inverse Fourier transform.

In[3]:=  InverseFourier[%]

Out[3]=

Fourier works whether or not your list of data has a length which is a power of two.

In[4]:=  Fourier[{1, -1, 1}]

Out[4]=

This generates a length-200 list containing a periodic signal with random noise added.

In[5]:=  data = Table[ N[Sin[30 2 Pi n/200] + (Random[ ] - 1/2)],
{n, 200} ] ;

The data looks fairly random if you plot it directly.

In[6]:=  ListPlot[ data, PlotJoined -> True ]

Out[6]=

The Fourier transform, however, shows a strong peak at  , and a symmetric peak at  , reflecting the frequency component of the original signal near  .

In[7]:=  ListPlot[ Abs[Fourier[data]], PlotJoined -> True,
PlotRange -> All ]

Out[7]=

In Mathematica, the discrete Fourier transform  of a list  of length  is by default defined to be  . Notice that the zero frequency term appears at position 1 in the resulting list.

The inverse discrete Fourier transform  of a list  of length  is by default defined to be  .

In different scientific and technical fields different conventions are often used for defining discrete Fourier transforms. The option FourierParameters in Mathematica allows you to choose any of these conventions you want.

common convention setting discrete Fourier transform inverse discrete Fourier transform
Mathematica default {0, 1}
data analysis {-1, 1}
signal processing {1, -1}
general case {a, b}

Typical settings for FourierParameters with various conventions.

Fourier[{{ ,  , ... }, { ,  , ... }, ... }]
two-dimensional Fourier transform

Two-dimensional Fourier transform.

Mathematica can find Fourier transforms for data in any number of dimensions. In  dimensions, the data is specified by a list nested  levels deep. Two-dimensional Fourier transforms are often used in image processing.



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.