Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
6680 Discussions

what is the corresponding function of DFT in IPP?

missing__zlw
Beginner
146 Views
Hi,
I am trying to comparing using MKL's DFT and IPP's DFT.
However, my test program gives different results:
In MKL:
MKL_LONG status = DftiCreateDescriptor( &my_desc1_handled, DFTI_SINGLE, DFTI_COMPLEX, 2, l);
status = DftiSetValue( my_desc1_handled, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status = DftiCommitDescriptor( my_desc1_handled);
status = DftiComputeForward( my_desc1_handled, A, B0 );
status = DftiFreeDescriptor(&my_desc1_handled);
In IPP:
IppsDFTSpec_C_32fc *pDFTSpec;
ippsDFTInitAlloc_C_32fc( &pDFTSpec, len, IPP_FFT_DIV_INV_BY_N,
ippAlgHintAccurate );
ippsDFTFwd_CToC_32fc(pSrc, (Ipp32fc*)pDst, pDFTSpec, 0 );
ippsDFTFree_C_32fc(pDFTSpec);
I am looking forward to complex to complex transform with matrix M*N dimension.
Two question:
1. what settings did I use wrong as my IPP give different result compared to MKL.
2. How do I specify the 2 D dimension in IPP? Here "len" inippsDFTInitAlloc_C_32fc is a 1d number which I used M*N value.
Thanks.
0 Kudos
1 Reply
Evgueni_P_Intel
Employee
146 Views
Hi zlw,

Intel IPP libraries do only single precision 2D FFTs. Here's a simple example that is supposed to do complex FFT(5x10). Please consult the documentation for the Intel IPP Image Processing library for more information.

[cpp]#include "ipp.h"
#include 

int main()
{
    float _Complex x[5][10], y[5][10];
    IppiSize len = {5, 10};
    IppiDFTSpec_C_32fc *fft = NULL;
    IppStatus status = ippStsNoErr;
    status = ippiDFTInitAlloc_C_32fc(&fft, len, IPP_FFT_NODIV_BY_ANY, ippAlgHintAccurate); // expect ippStsNoErr
    status = ippiDFTFwd_CToC_32fc_C1R(x, 10, y, 10, fft, NULL); // expect ippStsNoErr
    status = ippiDFTFree_C_32fc(fft); // expect ippStsNoErr
    return 0;
}
[/cpp]
Reply