1d fourier trafo function added
[my-code/api.git] / fourier / fourier.h
index 5a8ddb3..f3cab6b 100644 (file)
@@ -9,12 +9,9 @@
 /* defines */
 #define F_SUCCESS 1
 #define F_ERROR -1
-#define F_DIM_ERROR -2
-#define F_DLEN_ERROR -3
-#define F_MALLOC_ERROR -4
-#define F_SET_DLEN_ERROR -5
-
-#define MAX_DIM 3
+#define F_NOT_SUPPORTED -2
+#define F_DIM_FAILURE -3
+#define F_ALLOC_FAIL -4
 
 /* fourier specific variables */
 typedef struct s_complex {
@@ -25,9 +22,20 @@ typedef struct s_complex {
 typedef struct s_fourier {
   int outfd;
   unsigned char type;
+#define DFT (1<<0)
+#define FFT (1<<1)
+#define FWD (1<<2)
+#define BWD (1<<3)
   int dim;
+#define MAX_DIM 3
   t_complex *data[MAX_DIM];
+  t_complex *ftdata[MAX_DIM];
   int data_len[MAX_DIM];
 } t_fourier;
 
+/* function prototypes */
+int fourier_init(t_fourier *fourier,int outfd);
+int fourier_dft_1d(t_fourier *fourier);
+int fourier_calc(t_fourier *fourier);
+
 #endif