- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to compute 1D FFT of a 2D array stored as a 1D array in another dimension. For example the 2D array is stored as:
for(int j=0; j<NJ; j++) //rows
{
for(int i=0; i<NI; i++) //colums
{
Ori_2D_array[i+j*NI]=1.0;
}
}
Now I want to compute the 1D FFT of the Ori_2D_array in the row dimension. The only way I can think out is reshaping the Ori_2D_array then doing the fft:
for (int i=0; i<NI; i++)
{
for (int j=0; j<NJ; j++)
{
2D_array[j+i*NJ]=Ori_2D_array[i+j*NI];
}
}
DFTI_DESCRIPTOR_HANDLE desc_x = 0;
DftiCreateDescriptor(&desc_x, DFTI_PREC, DFTI_COMPLEX, 1, NJ);
DftiSetValue(desc_x, DFTI_NUMBER_OF_TRANSFORMS, NI);
DftiSetValue(desc_x, DFTI_INPUT_DISTANCE, NJ);
DftiCommitDescriptor(desc_x);
DftiComputeForward(desc_x, 2D_array);
Reshaping Ori_2D_array wasting too much time. Is there anyway to do the FFT without reshaping Ori_2D_arra.
Please advise!
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page