Sound Design Toolkit  078
Physically informed sound synthesis for everyday sounds
SDTFFT.h: Fast Fourier Transform

Typedefs

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

Functions

SDTFFTSDTFFT_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]inversePerform a direct FFT if 0, or an inverse FFT otherwise
[in]inInput signal to transform, must be at least of length n
[out]outTransformed 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]inInput signal to transform, must be at least of length 2n
[out]outTransformed output
void SDTFFT_free ( SDTFFT x)

Object destructor.

Parameters
[in]Pointerto 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]inInput FFT to invert
[out]outReconstructed signal. Divide every sample by n to obtain the original signal
SDTFFT * SDTFFT_new ( unsigned int  n)

Object constructor.

Parameters
[in]nFFT 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