---
name: "wnfft"
section: "3"
platform: "linux"
package: "libwn-dev"
version: "6.0-17"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/wnfft"
---

# wnfft(3)

discrete Fourier transform package

## NAME

wn\_fft\_vect, wn\_inverse\_fft\_vect, wn\_sft\_vect, wn\_inverse\_sft\_vect - discrete Fourier transform package

## SYNOPSIS

```
#include <wn/wnfft.h>

wn_fft_vect(vector, len_i)
wn_cplx vector[];
int len_i;

wn_inverse_fft_vect(vector, len_i)
wn_cplx vector[];
int len_i;

wn_sft_vect(vector, len_i)
wn_cplx vector[];
int len_i;

wn_inverse_sft_vect(vector, len_i)
wn_cplx vector[];
int len_i;
```

## DESCRIPTION

This package implements the discrete Fourier transform and its inverse.  *vector* is the data to be transformed; *len\_i* is its length.  The resulting transformed data is also placed in *vector*.

**wn\_fft\_vect** and **wn\_sft\_vect** implement the following DFT:

out\[f\] = (*len\_i*^(-1/2))\*sum\_over(0\<=t\<*len\_i*){in\[t\]\*exp(-j\*2\*PI\*f\*t/*len\_i*)}

**wn\_inverse\_fft\_vect** and **wn\_inverse\_sft\_vect** implement  the following inverse DFT:

out\[t\] =  (*len\_i*^(-1/2))\*sum\_over(0\<=f\<*len\_i*){in\[f\]\*exp(j\*2\*PI\*f\*t/*len\_i*)}

where j == (-1)^(1/2).

"sft" stands for "slow Fourier transform" while "fft" stands for "fast Fourier transform".  The fft routines are much faster, but they require that *len\_i* be a power of 2.  The sft routines are much slower, but place no restriction on *len\_i*.

Applying fft and then inverse\_fft to a *vector* yields the original vector.

## RESOURCES

**wn\_fft\_vect** and **wn\_inverse\_fft\_vect** require

WORST and AVERAGE CASE:

time = *len\_i*\*log(*len\_i*)\
 stack memory = log(*len\_i*)\
 dynamic memory = *len\_i*

**wn\_sft\_vect** and **wn\_inverse\_sft\_vect** require

WORST and AVERAGE CASE:

time = *len\_i*^2\
 stack memory = 1\
 dynamic memory = *len\_i*

## BUGS

This code is new and has not been tested in large industrial applications.

## SEE ALSO

*acc/complex/examples.c*

## AUTHOR

Will Naylor
