BRL-CAD
fft.h
Go to the documentation of this file.
1 /* F F T . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @file fft.h
21  *
22  */
23 
24 #ifndef FFT_H
25 #define FFT_H
26 
27 #include "common.h"
28 
29 #include <math.h>
30 
32 
33 /* NOTE: intentionally not using vmath.h to avoid dependency */
34 #ifndef M_PI
35 # define M_PI 3.14159265358979323846264338328
36 #endif
37 #ifndef M_SQRT1_2
38 # define M_SQRT1_2 0.70710678118654752440084436210
39 #endif
40 
41 #ifndef FFT_EXPORT
42 # if defined(FFT_DLL_EXPORTS) && defined(FFT_DLL_IMPORTS)
43 # error "Only FFT_DLL_EXPORTS or FFT_DLL_IMPORTS can be defined, not both."
44 # elif defined(FFT_DLL_EXPORTS)
45 # define FFT_EXPORT __declspec(dllexport)
46 # elif defined(FFT_DLL_IMPORTS)
47 # define FFT_EXPORT __declspec(dllimport)
48 # else
49 # define FFT_EXPORT
50 # endif
51 #endif
52 
53 /* The COMPLEX type used throughout */
54 typedef struct {
55  double re; /* Real Part */
56  double im; /* Imaginary Part */
57 } COMPLEX;
58 
59 FFT_EXPORT extern void splitdit(int N, int M);
60 FFT_EXPORT extern void ditsplit(int n /* length */, int m /* n = 2^m */);
61 FFT_EXPORT extern void rfft(double *X, int N);
62 FFT_EXPORT extern void irfft(double *X, int n);
63 FFT_EXPORT extern void cfft(COMPLEX *dat, int num);
64 FFT_EXPORT extern void icfft(COMPLEX *dat, int num);
65 FFT_EXPORT extern void cdiv(COMPLEX *result, COMPLEX *val1, COMPLEX *val2);
66 
67 /* These should come from a generated header, but until
68  * CMake is live we'll just add the ones used by our current code */
69 FFT_EXPORT extern void rfft256(register double X[]);
70 FFT_EXPORT extern void irfft256(register double X[]);
71 
73 
74 #endif /* FFT_H */
75 
76 /*
77  * Local Variables:
78  * mode: C
79  * tab-width: 8
80  * indent-tabs-mode: t
81  * c-file-style: "stroustrup"
82  * End:
83  * ex: shiftwidth=4 tabstop=8
84  */
double im
Definition: fft.h:56
void irfft256(register double X[])
#define N
Definition: randmt.c:39
Header file for the BRL-CAD common definitions.
Definition: color.c:49
void rfft(double *X, int N)
Definition: splitdit.c:37
#define __BEGIN_DECLS
Definition: common.h:73
void rfft256(register double X[])
Definition: fft.h:54
void ditsplit(int n, int m)
Definition: ditsplitc.c:43
void irfft(double *X, int n)
Definition: ditsplit.c:39
void cfft(COMPLEX *dat, int num)
Definition: fftfast.c:55
void icfft(COMPLEX *dat, int num)
Definition: fftfast.c:73
double re
Definition: fft.h:55
#define __END_DECLS
Definition: common.h:74
void cdiv(COMPLEX *result, COMPLEX *val1, COMPLEX *val2)
Definition: fftfast.c:303
void splitdit(int N, int M)
Definition: splitditc.c:38
#define M
Definition: msr.c:52