BRL-CAD
fftfast.c File Reference
#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include "fft.h"
Include dependency graph for fftfast.c:

Go to the source code of this file.

Macros

#define MAXSIZE   65536 /* Needed for sin/cos tables */
 

Functions

void scramble (int numpoints, COMPLEX *dat)
 
void butterflies (int numpoints, int inverse, COMPLEX *dat)
 
int init_sintab (int size)
 
void cfft (COMPLEX *dat, int num)
 
void icfft (COMPLEX *dat, int num)
 
void cadd (COMPLEX *result, COMPLEX *val1, COMPLEX *val2)
 
void csub (COMPLEX *result, COMPLEX *val1, COMPLEX *val2)
 
void cmult (COMPLEX *result, COMPLEX *val1, COMPLEX *val2)
 
void cdiv (COMPLEX *result, COMPLEX *val1, COMPLEX *val2)
 

Variables

int _init_size = 0
 
double * sintab
 
double * costab
 

Detailed Description

Complex Number and FFT Library

"Fast" Version - Function calls to complex math routines removed. Uses pre-computed sine/cosine tables.

The FFT is:

         N-1
 Xf(k) = Sum x(n)(cos(2PI(nk/N)) - isin(2PI(nk/N)))
         n=0

Definition in file fftfast.c.

Macro Definition Documentation

#define MAXSIZE   65536 /* Needed for sin/cos tables */

Definition at line 43 of file fftfast.c.

Referenced by init_sintab().

Function Documentation

void scramble ( int  numpoints,
COMPLEX dat 
)

Definition at line 176 of file fftfast.c.

References COMPLEX::im, and COMPLEX::re.

Referenced by cfft(), and icfft().

void butterflies ( int  numpoints,
int  inverse,
COMPLEX dat 
)

Definition at line 201 of file fftfast.c.

References costab, COMPLEX::im, COMPLEX::re, and sintab.

Referenced by cfft(), and icfft().

int init_sintab ( int  size)

Definition at line 114 of file fftfast.c.

References _init_size, costab, M_PI, MAXSIZE, and sintab.

Referenced by cfft(), and icfft().

void cfft ( COMPLEX dat,
int  num 
)

Definition at line 55 of file fftfast.c.

References _init_size, butterflies(), init_sintab(), and scramble().

Referenced by main().

Here is the call graph for this function:

void icfft ( COMPLEX dat,
int  num 
)

Definition at line 73 of file fftfast.c.

References _init_size, butterflies(), init_sintab(), and scramble().

Referenced by main().

Here is the call graph for this function:

void cadd ( COMPLEX result,
COMPLEX val1,
COMPLEX val2 
)

Definition at line 273 of file fftfast.c.

References COMPLEX::im, and COMPLEX::re.

void csub ( COMPLEX result,
COMPLEX val1,
COMPLEX val2 
)

Definition at line 283 of file fftfast.c.

References COMPLEX::im, and COMPLEX::re.

void cmult ( COMPLEX result,
COMPLEX val1,
COMPLEX val2 
)

Definition at line 293 of file fftfast.c.

References COMPLEX::im, and COMPLEX::re.

void cdiv ( COMPLEX result,
COMPLEX val1,
COMPLEX val2 
)

Definition at line 303 of file fftfast.c.

References COMPLEX::im, and COMPLEX::re.

Variable Documentation

int _init_size = 0

Definition at line 44 of file fftfast.c.

Referenced by cfft(), icfft(), and init_sintab().

double* sintab

Definition at line 90 of file fftfast.c.

Referenced by butterflies(), and init_sintab().

double* costab

Definition at line 91 of file fftfast.c.

Referenced by butterflies(), and init_sintab().