19.4.2 Continuous Fourier Transform
The Fourier transform of a function f is defined by
F(s)= | ∫ | | e−i s x f(x) dx, s∈ℝ.
(1) |
The fourier
command computes the Fourier transform.
-
fourier takes one mandatory argument and two optional
arguments:
-
expr, an expression which defines a function
f(x)=expr.
- Optionally, x, the variable for f (by default
x).
- Optionally, s, the variable for the Fourier
transform (by default x).
- fourier(expr ⟨,x,s ⟩) returns
the Fourier transform F(s). If s
is not given, then x will be used.
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)= | | | ∫ | | ei s x F(s) ds.
(2) |
The ifourier
command computes the inverse Fourier transform.
-
ifourier takes one mandatory argument and two optional
arguments:
-
expr, an expression which defines a function
F(x)=expr.
- Optionally, x, the variable for F (by default
x).
- Optionally, X, the variable for the original
function f (by default x).
- ifourier(expr ⟨,x,X ⟩) returns
the inverse Fourier transform f(X). If X
is not given, then x will be used.
Note the similarity between the definitions of the Fourier
transform (1) and its inverse (2).
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.
Transforming rational functions.
An arbitrary rational function can be transformed as long as
its full partial fraction decomposition can be found.
Examples
Find the Fourier transform of f(x)=x/x3−19 x+30.
F:=fourier(x/(x^3-19x+30),x,s) |
|
| | π sign | ⎛
⎝ | s | ⎞
⎠ | ⎛
⎝ | 16 i e−2 i s
−21 i e−3 i s
+5 i e5 i s | ⎞
⎠ |
| | | | | | | | | | |
|
Find the transform of f(x)=x2+1/x2−1.
F:=fourier((x^2+1)/(x^2-1),x,s) |
|
2 π | ⎛
⎝ | δ | ⎛
⎝ | s | ⎞
⎠ | −sign | ⎛
⎝ | s | ⎞
⎠ | sins | ⎞
⎠ |
| | | | | | | | | | |
|
Transforming general functions.
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 (1). In these cases you
may try to evaluate the result using eval.
Examples
|
2 π | ⎛
⎝ | δ | ⎛
⎝ | s | ⎞
⎠ | +2 i δ | ⎛
⎝ | s,1 | ⎞
⎠ | −3 δ | ⎛
⎝ | s,2 | ⎞
⎠ | ⎞
⎠ |
| | | | | | | | | | |
|
fourier(Dirac(x-1)+Dirac(x+1),x,s) |
fourier(exp(-2*abs(x-1)),x,s) |
fourier(atan(1/(2x^2)),x,s) |
fourier(BesselJ(3,x),x,s) |
|
− | s | ⎛
⎝ | 4 s2−3 | ⎞
⎠ | ⎛
⎝ | −i sign | ⎛
⎝ | s+1 | ⎞
⎠ | +i sign | ⎛
⎝ | s−1 | ⎞
⎠ | ⎞
⎠ |
|
|
|
|
| | | | | | | | | | |
|
F:=fourier(sin(x)*sign(x),x,s) |
|
− | π | ⎛
⎝ | 2 γ δ | ⎛
⎝ | s | ⎞
⎠ | ⎪
⎪ | s | ⎪
⎪ | +1 | ⎞
⎠ |
|
|
|
|
| | | | | | | | | | |
|
fourier(exp(-abs(x))*sinc(x),x,s) |
|
arctan | ⎛
⎝ | s+1 | ⎞
⎠ | −arctan | ⎛
⎝ | s−1 | ⎞
⎠ |
| | | | | | | | | | |
|
fourier(1/sqrt(abs(x)),x,s) |
F:=fourier(1/cosh(2x),x,s) |
fourier(Airy_Ai(x/2),x,s) |
F:=fourier(Gamma(1+i*x/3),x,s) |
F:=fourier(atan(x/4)/x,x,s) |
|
π ugamma | ⎛
⎝ | 0,4 | ⎪
⎪ | s | ⎪
⎪ | ⎞
⎠ |
| | | | | | | | | | |
|
assume(a>0);
fourier(exp(-a*x^2+b),x,s) |
Piecewise functions can be transformed if defined as
piecewise(x<a1,f1,x<a2,f2,…,x<an,fn,f0)
where f0,…,fn are expressions
and a1,a2,…,an are real numbers such that
a1<a2<⋯<an . Inequalities may be strict or non-strict.
For example:
f:=piecewise(x<=-1,exp(x+1),x<=1,1,exp(2-2x)):;
F:=fourier(f,x,s) |
You can obtain the original function f from the above result by
using ifourier.
|
θ | ⎛
⎝ | −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.
Convolution Theorem and applications.
The Fourier transform behaves nicely when applied to convolutions.
Recall that the convolution f∗ g (see Section 19.2.4)
of two functions f and g is defined by
(f∗ g)(x)= | ∫ | | f(t) g(x−t) dt.
|
The Convolution Theorem states that
As an example, we use this result for computing the
convolution of f(x)=e−|x| with itself.
F:=fourier(exp(-abs(x)),x,s) |
|
−x θ | ⎛
⎝ | −x | ⎞
⎠ | ex+x θ | ⎛
⎝ | x | ⎞
⎠ | e−x+e | |
| | | | | | | | | | |
|
The above result is the desired convolution
(f∗ f)(x)=∫−∞+∞f(t) f(x−t) dt.