fourn


Viviana
01-06-2005, 04:50 AM
Hallo everybody

I'm new in this forum.. I'm trying to use fft in more than one dimensions but I have some problems... Can someone help me?
This is my code to make a two dimension fft to a matrix of 4 rows and 4 colums, all elements equal 1. The result should be a matrix with all 0 except a 16. Isn't so? But I received something else... Where am I wrong?
int main(){
double *data;
int i;
unsigned long dim[2];

data = (double *)malloc(2*N*N*sizeof(double));
for (i=0; i<2*N*N; i++)
{ data[i]=1;
data[++i]=0; }
dim[0]=N;
dim[1]=N;
fourn(data-1, dim-1, 2, 1);
free(data);