`fft`

—

fast Fourier transform

```
#include
<fft.h>
```

`int`
`fft`

(

`double complex
*const buf`,

`size_t const n`);

Header-only naive implementation of the fast Fourier transform algorithm.

Requires C99, specifically

**<complex.h>**.

Returns 0 on success, and -1 on error.

View example.c, which can be built with

gcc(1)
using

**make example**.

`fft`

() can fail with the following error:

- [
`EINVAL`

]
- Given
`n` was not a power of two. You can
pad with zeroes to avoid this error.

By default

**<fft.h>** includes the libraries it needs. To remove

**<fft.h>**'s included libraries, #define FFT_NO_INCLUDES.

Unless FFT_NO_INCLUDES is defined,

`fft`

() uses

**<math.h>**. In which case you may need to link with

**-lm**.

By default

`fft`

() is declared with

**extern**. To have

`fft`

() be declared
with

**static**, #define FFT_PRIVATE.

The FFTW library provides an optimal implementation of the fast Fourier
transform algorithm.