6
/* this is from ddcmath.h */
8
#define DDC_PI (3.14159265358979323846)
10
/*============================================================================
12
fourier.h - Don Cross <dcross@intersrv.com>
14
http://www.intersrv.com/~dcross/fft.html
16
Contains definitions for doing Fourier transforms
17
and inverse Fourier transforms.
19
============================================================================*/
26
** If you change anything here, make sure to check if
27
** the offsets used in the asm version of BandPass() are affected
42
void BandPassInit(struct BandPassInfo *i, float center, float bw);
43
void BandPass(struct BandPassInfo *ip, float *inbuffer, float *outbuffer, unsigned long samples);
46
** fft() computes the Fourier transform or inverse transform
47
** of the complex inputs to produce the complex outputs.
48
** The number of samples must be a power of two to do the
49
** recursive decomposition of the FFT algorithm.
50
** See Chapter 12 of "Numerical Recipes in FORTRAN" by
51
** Press, Teukolsky, Vetterling, and Flannery,
52
** Cambridge University Press.
54
** Notes: If you pass ImaginaryIn = NULL, this function will "pretend"
55
** that it is an array of all zeroes. This is convenient for
56
** transforming digital samples of real number data without
61
unsigned NumSamples, /* must be a power of 2 */
62
int InverseTransform, /* 0=forward FFT, 1=inverse FFT */
63
float *RealIn, /* array of input's real samples */
64
float *ImaginaryIn, /* array of input's imag samples */
65
float *RealOut, /* array of output's reals */
66
float *ImaginaryOut ); /* array of output's imaginaries */
70
int IsPowerOfTwo ( unsigned x );
71
unsigned NumberOfBitsNeeded ( unsigned PowerOfTwo );
72
unsigned ReverseBits ( unsigned index, unsigned NumBits );
76
** The following function returns an "abstract frequency" of a
77
** given index into a buffer with a given number of frequency samples.
78
** Multiply return value by sampling rate to get frequency expressed in Hz.
81
double Index_to_frequency ( unsigned NumSamples, unsigned Index );