Documentation

fourier

Fourier transform

Syntax

  • fourier(f,trans_var,eval_point) example

Description

example

fourier(f,trans_var,eval_point) computes the Fourier transform of f with respect to the transformation variable trans_var at the point eval_point.

Examples

Fourier Transform of Symbolic Expression

Compute the Fourier transform of this expression with respect to the variable x at the evaluation point y.

syms x y
f = exp(-x^2);
fourier(f, x, y)
ans =
pi^(1/2)*exp(-y^2/4)

Default Transformation Variable and Evaluation Point

Compute the Fourier transform of this expression calling the fourier function with one argument. If you do not specify the transformation variable, then fourier uses the variable x.

syms x t y
f = exp(-x^2)*exp(-t^2);
fourier(f, y)
ans =
pi^(1/2)*exp(-t^2)*exp(-y^2/4)

If you also do not specify the evaluation point, fourier uses the variable w.

fourier(f)
ans =
pi^(1/2)*exp(-t^2)*exp(-w^2/4)

Fourier Transforms Involving Dirac and Heaviside Functions

Compute the following Fourier transforms that involve the Dirac and Heaviside functions.

syms t w
fourier(t^3, t, w)
ans =
-pi*dirac(3, w)*2i
syms t0
fourier(heaviside(t - t0), t, w)
ans =
exp(-t0*w*1i)*(pi*dirac(w) - 1i/w)

Fourier Transform Parameters

Specify parameters of the Fourier transform.

Compute the Fourier transform of this expression using the default values c = 1, s = -1 of the Fourier parameters. (For details, see Fourier Transform.)

syms t w
pretty(fourier(t*exp(-t^2), t, w))
                /    2 \
                |   w  |
  sqrt(pi) w exp| - -- | 1i
                \    4 /
- -------------------------
              2

Change the values of the Fourier parameters to c = 1s = 1 by using sympref. Then compute the Fourier transform of the same expression again.

sympref('FourierParameters', [1, 1]);
pretty(fourier(t*exp(-t^2), t, w))
              /    2 \
              |   w  |
sqrt(pi) w exp| - -- | 1i
              \    4 /
-------------------------
            2

Change the values of the Fourier parameters to c = 1/2πs = 1 by using sympref. Compute the Fourier transform using these values.

sympref('FourierParameters', [1/(2*sym(pi)), 1]);
pretty(fourier(t*exp(-t^2), t, w))
     /    2 \
     |   w  |
w exp| - -- | 1i
     \    4 /
----------------
   4 sqrt(pi)

The preferences set by sympref persist through your current and future MATLAB® sessions. To restore the default values of c and s, set sympref to 'default'.

sympref('FourierParameters','default');

Fourier Transform of Function and Its Derivative

The Fourier transform of a function is related to the Fourier transform of its derivative.

syms f(t) w
fourier(diff(f(t), t), t, w)
ans =
w*fourier(f(t), t, w)*1i

Fourier Transform of Matrix

Find the Fourier transform of this matrix. Use matrices of the same size to specify the transformation variable and evaluation point.

syms a b c d w x y z
fourier([exp(x), 1; sin(y), i*z],[w, x; y, z],[a, b; c, d])
ans =
[                2*pi*exp(x)*dirac(a),     2*pi*dirac(b)]
[ -pi*(dirac(c - 1) - dirac(c + 1))*1i, -2*pi*dirac(1, d)]

When the input arguments are nonscalars, fourier acts on them element-wise. If fourier is called with both scalar and nonscalar arguments, then fourier expands the scalar arguments into arrays of the same size as the nonscalar arguments with all elements of the array equal to the scalar.

syms w x y z a b c d
fourier(x,[x, w; y, z],[a, b; c, d])
ans =
[ pi*dirac(1, a)*2i, 2*pi*x*dirac(b)]
[    2*pi*x*dirac(c), 2*pi*x*dirac(d)]

Note that nonscalar input arguments must have the same size.

Fourier Transform of Vector of Symbolic Functions

When the first argument is a symbolic function, the second argument must be a scalar.

syms f1(x) f2(x) a b
f1(x) = exp(x);
f2(x) = x;
fourier([f1, f2],x,[a, b])
ans =
[ fourier(exp(x), x, a), pi*dirac(1, b)*2i]

If Fourier Transform Cannot be Found

If fourier cannot find an explicit representation of the transform, it returns an unevaluated call.

syms f(t) w
F = fourier(f, t, w)
F =
fourier(f(t), t, w)

ifourier returns the original expression.

ifourier(F, w, t)
ans =
f(t)

Input Arguments

collapse all

f — Input functionsymbolic expression | symbolic function | vector of symbolic expressions or functions | matrix of symbolic expressions or functions

Input function, specified as a symbolic expression or function or a vector or matrix of symbolic expressions or functions.

trans_var — Transformation variablex (default) | symbolic variable

Transformation variable, specified as a symbolic variable. This variable is often called the "time variable" or the "space variable".

If you do not specify the transformation variable, fourier uses the variable x by default. If f does not contain x, then the default variable is determined by symvar.

eval_point — Evaluation pointw (default) | v | symbolic variable | symbolic expression | vector of symbolic variables or expressions | matrix of symbolic variables or expressions

Evaluation point, specified as a symbolic variable, expression, or vector or matrix of symbolic variables or expressions. This is often called the "frequency variable".

If you do not specify the evaluation point, fourier uses the variable w by default. If w is the transformation variable of f, then the default evaluation point is the variable v.

More About

collapse all

Fourier Transform

The Fourier transform of the expression f = f(x) with respect to the variable x at the point w is defined as follows:

F(w)=cf(x)eiswxdx.

Here, c and s are parameters of the Fourier transform. The fourier function uses c = 1, s = –1.

Tips

  • If you call fourier with two arguments, it assumes that the second argument is the evaluation point eval_point.

  • If f is a matrix, fourier acts element-wise on all components of the matrix.

  • If eval_point is a matrix, fourier acts element-wise on all components of the matrix.

  • To compute the inverse Fourier transform, use ifourier.

References

[1] Oberhettinger F., "Tables of Fourier Transforms and Fourier Transforms of Distributions", Springer, 1990.

Introduced before R2006a

Was this topic helpful?