Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Obsolete Editions Forum > Methods: Chapters 12 and 13

Reply
 
Thread Tools Display Modes
  #1  
Old 01-06-2005, 04:50 AM
Viviana Viviana is offline
Member
 
Join Date: Jan 2005
Posts: 1
fourn

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?
Code:
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);
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:05 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.