R
Renjini
hi everyone,
i have a problem. i have been using an FFT method for 1D arrays. now i
need to extend the code for 2D arrays..i thought it would be simple and
i managed to implement the FFT method for every row in the array..the
problem is now that i need to do the same for each of the
coloumns...and the elements shud not be copied into any other
arrays..because the FFT is to be applied on the original array...and
the same must be given as output..can anyone tell me how i could get
the coloumns each as a 1D array...?? i am including the int main()
here.
i'd be so thankful for the help.
int main(int argc, char *argv[])
{
double x1[][]={{2,3,4,5},{4,-1,2,3},{1,2,3,4}};
double y1[][]={{-1,0,2,0},{1,2,2,1},{0,0,0,0}};
cout << "\nInput: \n\n";
for (int i=0;i<3;i++)
{
for(int j=0;j<4;j++)
{
cout << x1[j] << "+" << y1[j] <<"i \t";
}
cout<<"\n";
}
for(int i=0;i<3;i++)
{
// FFT method for each row
FFT(-1,2,x1,y1);
}
/* for (int i=0;i<(sizeof(x1)/sizeof(x1[0]));i++)
cout << "Output: " << x1 << " + i " << y1 <<"\n";
//cout << x1[1] <<"\n";*/
cout<<"\nOuput: \n\n";
for (int i=0;i<3;i++)
{
for(int j=0;j<4;j++)
{
cout << x1[j] << "+" << y1[j] <<"i \t";
}
cout<<"\n";
}
getch();
return 0;
}
i have a problem. i have been using an FFT method for 1D arrays. now i
need to extend the code for 2D arrays..i thought it would be simple and
i managed to implement the FFT method for every row in the array..the
problem is now that i need to do the same for each of the
coloumns...and the elements shud not be copied into any other
arrays..because the FFT is to be applied on the original array...and
the same must be given as output..can anyone tell me how i could get
the coloumns each as a 1D array...?? i am including the int main()
here.
i'd be so thankful for the help.
int main(int argc, char *argv[])
{
double x1[][]={{2,3,4,5},{4,-1,2,3},{1,2,3,4}};
double y1[][]={{-1,0,2,0},{1,2,2,1},{0,0,0,0}};
cout << "\nInput: \n\n";
for (int i=0;i<3;i++)
{
for(int j=0;j<4;j++)
{
cout << x1[j] << "+" << y1[j] <<"i \t";
}
cout<<"\n";
}
for(int i=0;i<3;i++)
{
// FFT method for each row
FFT(-1,2,x1,y1);
}
/* for (int i=0;i<(sizeof(x1)/sizeof(x1[0]));i++)
cout << "Output: " << x1 << " + i " << y1 <<"\n";
//cout << x1[1] <<"\n";*/
cout<<"\nOuput: \n\n";
for (int i=0;i<3;i++)
{
for(int j=0;j<4;j++)
{
cout << x1[j] << "+" << y1[j] <<"i \t";
}
cout<<"\n";
}
getch();
return 0;
}