Previous Up Next

6.26.2  Continuous Fourier Transform: fourier ifourier addtable

The Fourier transform of a function f is defined by

F(s)=
+∞


−∞
ei s x f(xdx,   s∈ℝ.     (5)

The fourier command computes the Fourier transform.

The inverse Fourier transform, as its name implies, takes a Fourier transform F(x) and returns the original function f(x). It is given by:

f(x)=
1
2 π
 
+∞


−∞
ei s x F(sds.     (6)

The ifourier command computes the inverse Fourier transform.

Note the similarity between the definitions of the Fourier transform (equation (5)) and its inverse (equation (6)). To compute the inverse transformation of F(s), it is enough to compute the Fourier transform with function F(s)/2π and using the variables s and x instead of x and s, and replacing x with −x in the result.

Arbitrary rational functions can be transformed.

Examples.

A range of other (generalized) functions and distributions can be transformed, as demonstrated in the following examples. If fourier does not know how to transform a function, it returns the unevaluated integral (5). In these cases you may try to evaluate the result using eval.


Examples.

The Fourier transform behaves nicely when combined with convolutions. Recall the convolution (see Section 15.2.8) of two functions f and g is

(f∗ g)(x) = 
+∞


−∞
f(tg(xtdt 

If F(f) represents the Fourier transform of a function f, then the convolution theorem states

F(f∗ g) = F(fF(g). 


Example.
In this example, the convolution theorem will be used to compute the convolution of f(x)=e−|x| with itself.
Input:

F:=fourier(exp(-abs(x)),x,s)

Output:

2
s2+1

Input:

ifourier(F^2,s,x)

Output:

x θ
x
ex+x θ
x
ex+e

x
 

The above result is the desired convolution (ff)(x)=∫−∞+∞f(tf(xtdt.


Piecewise functions can be transformed if defined as

piecewise(x<a1,f1,x<a2,f2,…,x<an,fn,f0)

for appropriate functions f0,…,fn and a1,a2,…,an are real numbers such that a1<a2<⋯<an . Inequalities may be strict or non-strict.


Example.
Input:

f:=piecewise(x<=-1,exp(x+1),x<=1,1,exp(2-2x))
F:=fourier(f,x,s)

Output:

s cossi s sins+4 sins
s 
s−2 i

s+i

You can obtain the original function f from the above result by applying ifourier.
Input:

ifourier(F,s,x)

Output:

θ
x−1
ex+1
x+1

x−1
e−2 x+2−θ
x−1

You can verify that the above expression is equal to f(x) by plotting them.


Some algebraic transformations of a function behave predictably under the Fourier transform. For example, if g(x) = f(xa), then F(g)(s) = e−2π i a sF(f)(s). The addtable command lets you assign a function name to the Fourier (or Laplace, see Section 6.57.2) transform of another function name, without specifying the either function. This allows you to alter the original function and see the effect on the Fourier (or Laplace) transform.


Examples.


Fourier transforms can be used for solving linear differential equations with constant coefficients. For example, to obtain a particular solution to the equation

y(x)+4 y(4)(x)=δ(x),

where δ is the Dirac delta function, you can first transform both sides of the above equation.
Input:

L:=fourier(y(x)+4*diff(y(x),x,4),x,s); R:=fourier(Dirac(x),x,s)

Output:

s4 Y
s
+Y
s
,1

Then you can solve the equation L=R for Y(s). Generally, you should apply csolve instead of solve.
Input:

sol:=csolve(L=R,Y(s))[0]

Output:

1
s4+1

Finally, you can apply ifourier to obtain y(x).
Input:

ifourier(sol,s,x)

Output:

1
4
 e

x
2
 
 


cos



x
2



+sin



x
2






The above solution can be combined with solutions of the corresponding homogeneous equation to obtain the general solution.


Previous Up Next