Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Problems with multi-dimensional Dfti

martincco
Beginner
466 Views

I am new to the MKL, and hope that this will be a simple solution. I am using version 8.0

I am trying to run a 2D dfti.For testing, I set up a small 3x2 array in MatLab, and ran an fft( ) on it. I then pumped the same array into the MKL, and hoped to get the same results, but I cannot get the results I am looking for.

Here is the code I am trying to run:

double q[5][4];

for (a = 0; a < 5; a++)
for (b = 0; b < 4; b++)
q = 0.0;

q[0][0] = 1.2;
q[0][1] = -.5;
q[1][0] = .3;
q[1][1] = 1.8;
q[2][0] = -1.1;
q[2][1] = .7;

DFTI_DESCRIPTOR_HANDLE myDescHandle;
long status;
long l[2];
l[0] = 3;
l[1] = 2;

status = DftiCreateDescriptor(&myDescHandle, DFTI_DOUBLE, DFTI_REAL, 2, l);
status = DftiCommitDescriptor(myDescHandle);
status = DftiComputeForward(myDescHandle, q);
status = DftiFreeDescriptor(&myDescHandle);

When I print out q, I get some very strange results.

I have tried switching out so that I pipe in a complex, and it seems to make little difference. I have done both INPLACE and NOT_INPLACE. I have tried different data storage formats (PACK vs CCS). I have tried pumping in single precision, rather than double precision. I am assuming/hoping that it is a silly configuration item. Either that, or MatLab's fft works differently and I cannot get the results I want.

By the way, I ran a single dimension fft vs Dfti, and the results from MatLab and MKL were identical.

I would appreciate any help you can offer.

- Martin

0 Kudos
1 Reply
martincco
Beginner
466 Views

Spoke (again) with our MatLab guy, and he realized that in MatLab, fft( ) is not a true 2D fft. Rather, it performs an fft on each column individuallly, then combines the results.

Is therea way to do similar action in the MKL? Is using Strides the right way? I am unfamiliar with them. Thanks.

- Martin

0 Kudos
Reply