X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fapi.git;a=blobdiff_plain;f=fourier%2Ffourier.h;h=f3cab6b27977d56ccba1d2e50b0968afc9f60ffa;hp=5a8ddb38d117aa91da9ae88247b528cea0907861;hb=81e8529f1b659c27e65c66d12cb122ad19fcfba3;hpb=15a0affd01053e899568c0ee1e7bd1315e11f925 diff --git a/fourier/fourier.h b/fourier/fourier.h index 5a8ddb3..f3cab6b 100644 --- a/fourier/fourier.h +++ b/fourier/fourier.h @@ -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