# Discrete Fourier Transforms

A common operation in analyzing various kinds of data is to find the discrete 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[{u_{1},u_{2},...,u_{n}}] | discrete Fourier transform |

InverseFourier[{v_{1},v_{2},...,v_{n}}] | inverse discrete Fourier transform |

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

In[3]:= |

Out[3]= |

In[4]:= |

Out[4]= |

In[5]:= |

In[6]:= |

Out[6]= |

In[7]:= |

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 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[{{u_{11},u_{12},...},{u_{21},u_{22},...},...}] | |

two-dimensional discrete Fourier transform |

Two-dimensional discrete Fourier transform.

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

One issue with the usual discrete Fourier transform for real data is that the result is complex-valued. There are variants of real discrete Fourier transforms that have real results. *Mathematica* has commands for computing the discrete cosine transform and the discrete sine transform.

FourierDCT[list] | Fourier discrete cosine transform of a list of real numbers |

FourierDST[list] | Fourier discrete sine transform of a list of real numbers |

Discrete real Fourier transforms.

In[8]:= |

Out[8]= |

In[9]:= |

Out[9]= |

In[10]:= |

Out[10]= |

There are four types each of Fourier discrete sine and cosine transforms typically in use, denoted by number or sometimes roman numeral as in "DCTII" for the discrete cosine transform of type 2.

FourierDCT[list,m] | Fourier discrete cosine transform of type m |

FourierDST[list,m] | Fourier discrete sine transform of type m |

Discrete real Fourier transforms of different types.

The default is type 2 for both FourierDCT and FourierDST.

*Mathematica* does not need or functions because FourierDCT and FourierDST are their own inverses when used with the appropriate type. The inverse transforms for types 1, 2, 3, 4 are types 1, 3, 2, 4, respectively.

In[11]:= |

Out[11]= |

The discrete real transforms are convenient to use for data or image compression.

In[12]:= |

Out[12]= |

In[13]:= |

Out[13]= |

In[14]:= |

Out[14]= |