Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Change language to: Français - Português - 日本語

Scilab help >> FFTW > fftw

# fftw

Fast fourier transform based on the fftw library

### Calling Sequence

```[y]=fftw(x)
[y]=fftw(x,sign)
[y]=fftw(x,sign,dim,incr)
[y]=fftw(x,sign,[dim1 dim2 ...dimN],[incr1 incr2 ...incrN])```

### Arguments

y,x

matrix/vector of real/complex data. Input/output data to be transformed.

sign

Integer. 1 or -1. Set direct or inverse transform.

dim

integer. Set the dimension (the length) of the transform.

incr

integer. Set the stride (the span) of the transform.

### Description

This function realizes direct/inverse Discrete Fourier Transform (DFT) with the help of the FFTW library.

One can compute vector, 2D, M-D transform with this function.

For more details of fftw syntax see fft scilab function.

For more details about FFTW library see FFTW Web site : http://www.fftw.org

Remark: fftw function automatically stores his last parameters in memory to re-use it in a second time.

This improves greatly the time computation when consecutives calls (with same parameters) are performed.

### Examples

```//simple vector direct transform
a = rand(50,1)+%i*rand(50,1);
y = fftw(a);
y = fftw(a,-1);
//inverse transform
b = fftw(y,1);

//2D transform
a = rand(512,512)+%i*rand(512,512);
y = fftw(a);

//M-D transform -old calling sequence-
a = rand(120,1);
y = a;
dim=[5 6 4];incr=[1 5 30];
for i=1:3
y = fftw(y,-1,dim(i),incr(i));
end

//M-D transform -new calling sequence-
//More efficient than old
y = fftw(a,-1,[5 6 4],[1 5 30]);
b = fftw(y,1,[5 6 4],[1 5 30]);```

### Bibliography

Matteo Frigo and Steven G. Johnson, "FFTW Manual fo version 3.1.2" June 2006. Available : http://www.fftw.org