# Documentation

### This is machine translation

Translated by
Mouse over text to see original. Click the button below to return to the English verison of the page.

# fourier

Fourier transform

## Syntax

• ``fourier(f)``
example
• ``fourier(f,transVar)``
example
• ``fourier(f,var,transVar)``
example

## Description

example

````fourier(f)` returns the Fourier transform of `f` using the default independent variable `x` and the default transformation variable `w`. If `f` does not contain `x`, `fourier` uses `symvar`.```

example

````fourier(f,transVar)` uses the specified transformation variable `transVar` instead of `w`.```

example

````fourier(f,var,transVar)` uses the specified independent variable `var` and transformation variable `transVar` instead of `x` and `w` respectively.```

## Examples

### Fourier Transform of Symbolic Expression

Compute the Fourier transform of this expression with respect to the variable `x` for the transformation variable `y`.

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

### Default Independent Variable and Transformation Variable

Compute the Fourier transform of this expression calling the `fourier` function with one argument. If you do not specify the independent 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 transformation variable, `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 | w sqrt(pi) exp| - -- | 1i \ 4 / - ------------------------- 2```

Change the values of the Fourier parameters to `c = 1``s = 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 | w sqrt(pi) 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 independent variables and transformation variables.

```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

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

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

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

Transformation variable, 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 transformation variable, `fourier` uses the variable `w` by default. If `w` is the independent variable of `f`, then the default transformation variable is the variable `v`.

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\left(w\right)=c\underset{-\infty }{\overset{\infty }{\int }}f\left(x\right){e}^{iswx}dx.$`

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

### Tips

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

• If `transVar` 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.