Fourier Series Package
The Mathematica kernel provides the functions FourierTransform and InverseFourierTransform for computing the symbolic Fourier exponential transform and inverse transform. It also provides the functions FourierSinTransform, InverseFourierSinTransform, FourierCosTransform, and InverseFourierCosTransform for computing the symbolic Fourier sine and cosine transforms and their inverses. This package provides functions giving numerical approximations to these Fourier transforms. It also provides functions for Fourier series, Fourier coefficients, discretetime Fourier transforms, and their numerical counterparts. The numerical approximations use Mathematica's numerical integration and summation directly without first trying for an exact solution.
NFourierTransform[expr,t,]  find a numerical approximation to the Fourier transform of expr evaluated at the numerical value , where expr is treated as a function of t 
NInverseFourierTransform[expr,,t]  find a numerical approximation to the inverse Fourier transform of expr evaluated at the numerical value t, where expr is treated as a function of 
NFourierSinTransform[expr,t,]  find a numerical approximation to the Fourier sine transform of expr evaluated at the numerical value , where expr is treated as a function of t 
NInverseFourierSinTransform[expr,,t]  find a numerical approximation to the inverse Fourier sine transform of expr evaluated at the numerical value t, where expr is treated as a function of 
NFourierCosTransform[expr,t,]  find a numerical approximation to the Fourier cosine transform of expr evaluated at the numerical value , where expr is treated as a function of t 
NInverseFourierCosTransform[expr,,t]  find a numerical approximation to the inverse Fourier cosine transform of expr evaluated at the numerical value t, where expr is treated as a function of 
Finding numerical approximations to Fourier transforms.
This gives a numerical approximation to the Fourier transform of exp (t^{2})/ (1+t) with respect to at =1.
Out[2]=  

In addition to supporting the NIntegrate options, the numerical Fourier transform functions support the option FourierParameters. This option allows you to choose among the various conventions used for defining Fourier transforms.
  
Mathematica default  {0, 1}  
  
general case  {a, b}  
  
Effect of FourierParameters setting on Fourier transform.
Effect of FourierParameters setting on Fourier sine transform.
Effect of FourierParameters setting on Fourier cosine transform.
The Fourier transform is commonly used to transform a problem from the continuous "time domain" into the continuous "frequency domain." The Fourier transform may be viewed as the continuous analog of the Fourier series decomposition, which expresses a periodic function as a superposition of exponential or trigonometric functions. Fourier exponential and trigonometric series decompositions may be computed using the functions FourierSeries and FourierTrigSeries. The coefficients of the exponential series are found using FourierCoefficient and the coefficients of the trigonometric series are found using FourierSinCoefficient and FourierCosCoefficient. If the option setting FourierParameters > {a, b} is specified, the continuous function of t is treated as having a period of 1/b, instead of the default period of 1.
FourierCoefficient[expr,t,n]  give the n^{th} coefficient in the exponential series expansion of the periodic function of t equal to expr on the interval to 
FourierSinCoefficient[expr,t,n]  give the n^{th} coefficient in the sine series expansion 
FourierCosCoefficient[expr,t,n]  give the n^{th} coefficient in the cosine series expansion 
FourierSeries[expr,t,k]  give the exponential series expansion to order k of the periodic function of t equal to expr on the interval to 
FourierTrigSeries[expr,t,k]  give the trigonometric series expansion to order k 
Computing Fourier coefficients and series.
Here is a plot of the difference between t and the integer closest to t. It is a periodic function with fundamental interval from to .
Out[3]=  

This gives a piece of the Fourier trigonometric series of the difference function. The difference function is odd so its trigonometric series contains only sines.
Out[4]=  

The plot of the truncated series is similar to that of the function.
Out[5]=  

Here are the two plots on the same axes.
Out[6]=  

 
{0, 1}  
{a, b}  
Effect of FourierParameters setting on Fourier exponential coefficients.
  
{0, 1}  F_{n} e^{2int}  
{a, b}  b^{ (1+a)/2}F_{n} e^{2ibnt}  
Effect of FourierParameters setting on Fourier exponential series.
 c_{0}  c_{n} 
{0, 1}   
{a, b}   
Effect of FourierParameters setting on Fourier cosine coefficients.
 d_{n} 
{0, 1}  
{a, b}  
Effect of FourierParameters setting on Fourier sine coefficients.
 
{0, 1}  c_{0}+c_{n}cos (2nt)+d_{n}sin (2nt) 
{a, b}  b^{ (1+a)/2} (c_{0}+c_{n}cos (2bnt)+d_{n}sin (2bnt)) 
Effect of FourierParameters setting on Fourier trigonometric series.
In certain circumstances you will not want exact or symbolic coefficients, but numerical approximations to the coefficients. In these cases you can use the numerical versions of the Fourier series functions. The numerical approximation functions accept the FourierParameters option, allowing you to specify the period.
NFourierCoefficient[expr,t,n]  find a numerical approximation to the n^{th} coefficient in the exponential series expansion 
NFourierSinCoefficient[expr,t,n]  find a numerical approximation to the n^{th} coefficient in the sine series expansion 
NFourierCosCoefficient[expr,t,n]  find a numerical approximation to the n^{th} coefficient in the cosine series expansion 
NFourierSeries[expr,t,k]  find the exponential series expansion to order k using numerical approximations for the coefficients 
NFourierTrigSeries[expr,t,k]  find the trigonometric series expansion to order k using numerical approximations for the coefficients 
Finding approximate numerical values for Fourier coefficients and series.
Here is a piece of the trigonometric series of a function that looks like on the interval from to . The function elsewhere is obtained by repeating this with period 1.
Out[7]=  

Here is a plot of the trigonometric polynomial over three periods.
Out[8]=  

The function FourierCoefficient, giving the coefficients of the Fourier exponential series, can be thought of as a transform from the continuous time domain into the discrete frequency domain. Likewise, the (infinite sum) Fourier exponential series can be thought of as an inverse transform from the discrete frequency domain into the continuous time domain. This transform pair is given by FourierCoefficient and InverseFourierCoefficient, and the numerical counterparts are given by NFourierCoefficient and NInverseFourierCoefficient. If the option setting FourierParameters > {a, b} is specified, the period of the original function is taken to be 1/b, instead of the default period of 1.
FourierCoefficient[expr,t,n]  give F_{n}, a function of integer n and the n^{th} coefficient in the exponential series expansion of the periodic function f(t), equal to expr on the interval to 
InverseFourierCoefficient[expr,n,t]  give f(t), a periodic function of t, represented by the Fourier exponential series coefficients expr, where expr is treated as a function of integer n 
NFourierCoefficient[expr,t,n]  find a numerical approximation to the function F_{n} 
NInverseFourierCoefficient[expr,n,t]  find a numerical approximation to the function f(t) 
Continuoustime and discretefrequency transform pairs: exact and numerical approximations.
Here is a plot of a periodic function of t, with a period of .
Out[9]=  

The inverse of the Fourier coefficients gives the original periodic function.
Out[11]=  

  
{0, 1}   F_{n} e^{2int} 
{a, b}   b^{ (1+a)/2}F_{n} e^{2ibnt} 
Effect of FourierParameters setting on Fourier coefficient.
The Fourier transform from the discrete time domain into the continuous frequency domain is usually termed the discretetime Fourier transform, or DTFourierTransform. The inverse transform from the continuous frequency domain into the discrete time domain is given by InverseDTFourierTransform. Just as the Z transform is the discrete analog of the Laplace transform, the discretetime Fourier transform is the discrete analog of the continuoustime Fourier transform. If the option setting FourierParameters > {a, b} is specified, the period of the discretetime Fourier transform is taken to be 1/b, instead of the default period of 1.
DTFourierTransform[expr,n,omega]  give F(), a periodic function of , equal to the Fourier sum of expr, where expr is treated as a function of integer n 
InverseDTFourierTransform[expr,omega,n]  give f_{n}, a function of integer n and the inverse Fourier sum of the periodic function F(), where F() is equal to expr on the interval to 
NDTFourierTransform[expr,n,omega]  find a numerical approximation to the function F() 
NInverseDTFourierTransform[expr,omega,n]  find a numerical approximation to the function f_{n} 
Discretetime and continuousfrequency transform pairs: exact and numerical approximations.
This computes the Fourier transform of a discretetime rectangular function centered at n=0.
Out[12]=  

Here is a plot of the amplitude spectrum over three periods.
Out[13]=  

Here is a numerical approximation to the inverse discretetime Fourier transform, for n=5, ..., 5.
Out[14]=  

The Fourier exponential series and discretetime Fourier transforms are mathematically equivalent, if one exchanges the roles of time and frequency.
  
{0, 1}  f_{n} e^{2in}  
{a, b}  b^{ (1a)/2}f_{n} e^{2ibn}  
Effect of FourierParameters setting on discretetime Fourier transform.






