Sound Design Toolkit 075 Physically informed sound synthesis for everyday sounds

- Main Page
- Modules
- Data Structures
- Files

Typedefs | Functions
SDTFFT.h: Fast Fourier Transform

## Typedefs
typedef struct SDTFFT | SDTFFT
| Opaque data structure, representing a FFT object.

## Functions
SDTFFT * | SDTFFT_new (unsigned int n)
| Object constructor. More...
void | SDTFFT_free (SDTFFT *x)
| Object destructor. More...
void | SDTFFT_fft (SDTFFT *x, int inverse, SDTComplex *in, SDTComplex *out)
| Performs a direct or inverse FFT of a complex-valued signal. More...
void | SDTFFT_fftr (SDTFFT *x, double *in, SDTComplex *out)
| Performs a direct FFT of a real-valued signal. More...
void | SDTFFT_ifftr (SDTFFT *x, SDTComplex *in, double *out)
| Performs an inverse FFT of a signal known to be real-valued. More...

## Detailed Description

Data structures and functions to perform frequency analysis on signals by means of the Discrete Fourier Transform and its inverse. This implementation is based on the iterative version of the Cooley-Tukey algorithm, works with double precision floating point arithmetic and provides an optimization for the transformation of real-valued signals.

## Function Documentation

void SDTFFT_fft | ( | SDTFFT * | x,
|  | int | inverse,
|  | SDTComplex * | in,
|  | SDTComplex * | out
| ) |  |

Performs a direct or inverse FFT of a complex-valued signal.

Parameters

  [in] | inverse | Perform a direct FFT if 0, or an inverse FFT otherwise
  [in] | in | Input signal to transform, must be at least of length n
  [out] | out | Transformed output, must be at least of length n. When performing an inverse transform, divide every sample by n to obtain the original signal

void SDTFFT_fftr | ( | SDTFFT * | x,
|  | double * | in,
|  | SDTComplex * | out
| ) |  |

Performs a direct FFT of a real-valued signal.

Parameters

  [in] | in | Input signal to transform, must be at least of length 2n
  [out] | out | Transformed output

void SDTFFT_free | ( | SDTFFT * | x | ) |

Object destructor.

Parameters

  [in] | Pointer | to the instance to destroy

void SDTFFT_ifftr | ( | SDTFFT * | x,
|  | SDTComplex * | in,
|  | double * | out
| ) |  |

Performs an inverse FFT of a signal known to be real-valued.

Parameters

  [in] | in | Input FFT to invert
  [out] | out | Reconstructed signal. Divide every sample by n to obtain the original signal

SDTFFT* SDTFFT_new | ( | unsigned int | n | ) |

Object constructor.

Parameters

  [in] | n | FFT window length, must be a power of 2

Returns
  Pointer to the newly created instance, or NULL if n is not a power of 2