# Documentation

### This is machine translation

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

# fourier

Fourier transform

## Syntax

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

## Description

example

````fourier(f)` returns the Fourier Transform of `f`. By default, the function `symvar` determines the independent variable, and `w` is the transformation variable.```

example

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

example

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

## Examples

collapse all

Compute the Fourier transform of `exp(-t^2)`. By default, the transform is in terms of `w`.

```syms t f = exp(-t^2); ft_f = fourier(f)```
```ft_f = pi^(1/2)*exp(-w^2/4)```

Compute the Fourier transform of `exp(-t^2-x^2)`. By default, `symvar` determines the independent variable, and `w` is the transformation variable. Here, `symvar` chooses `x`.

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

Specify the transformation variable as `y`. If you specify only one variable, that variable is the transformation variable. `symvar` still determines the independent variable.

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

Specify both the independent and transformation variables as `t` and `y` in the second and third arguments, respectively.

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

Compute the following Fourier transforms. The results are in terms of 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)```

Specify parameters of the Fourier transform.

Compute the Fourier transform of `f` using the default values of the Fourier parameters `c = 1`, `s = -1`. For details, see Fourier Transform.

```syms t w f = t*exp(-t^2); fourier(f,t,w)```
```ans = -(w*pi^(1/2)*exp(-w^2/4)*1i)/2```

Change the Fourier parameters to `c = 1`, ```s = 1``` by using `sympref`, and compute the transform again. The result changes.

```sympref('FourierParameters',[1 1]); fourier(f,t,w)```
```ans = (w*pi^(1/2)*exp(-w^2/4)*1i)/2```

Change the Fourier parameters to `c = 1/(2*pi)`, ```s = 1```. The result changes.

```sympref('FourierParameters', [1/(2*sym(pi)), 1]); fourier(f,t,w)```
```ans = (w*exp(-w^2/4)*1i)/(4*pi^(1/2))```

Preferences set by `sympref` persist through your current and future MATLAB® sessions. Restore the default values of `c` and `s` by setting `FourierParameters` to `'default'`.

`sympref('FourierParameters','default');`

Find the Fourier transform of the matrix `M`. Specify the independent and transformation variables for each matrix entry by using matrices of the same size. When the arguments are nonscalars, `fourier` acts on them element-wise.

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

If `fourier` is called with both scalar and nonscalar arguments, then it expands the scalars to match the nonscalars by using scalar expansion. Nonscalar arguments must be the same size.

`fourier(x,vars,transVars)`
```ans = [ 2*pi*x*dirac(a), pi*dirac(1, b)*2i] [ 2*pi*x*dirac(c), 2*pi*x*dirac(d)]```

If `fourier` cannot transform the input then it returns an unevaluated call.

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

Return the original expression by using `ifourier`.

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

## Input Arguments

collapse all

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

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 variable, then `fourier` uses the function `symvar` to determine the independent variable.

Transformation variable, specified as a symbolic variable, expression, vector, or matrix. This variable is often called the "frequency variable." By default, `fourier` uses `w`. If `w` is the independent variable of `f`, then `fourier` uses `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

`$F\left(w\right)=c\underset{-\infty }{\overset{\infty }{\int }}f\left(x\right){e}^{iswx}dx.$`

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

## Tips

• If any argument is an array, then `fourier` acts element-wise on all elements of the array.

• If the first argument contains a symbolic function, then the second argument must be a scalar.

• To compute the inverse Fourier transform, use `ifourier`.

## References

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