Quantcast
Channel: Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1294

Using 2D DFT Transformation in Intel IPP 8.2 (Image DFT)

$
0
0

Hello,

I'm comparing the results of the magnitude of DFT Transform of Intel DFTFwd to MATLAB's fft.

The input is Real Image in 32fC1 format.
The code snippet is:

int sizeSpec;
int sizeInit;
int sizeBuffer;
/// get sizes for required buffers
	IppStatus status = ippiDFTGetSize_R_32f(mI.size_, IPP_FFT_DIV_FWD_BY_N, ippAlgHintNone,&sizeSpec, &sizeInit, &sizeBuffer);

    /// allocate memory for required buffers
    IppiDFTSpec_R_32f* pMemSpec = (IppiDFTSpec_R_32f*)ippMalloc(sizeSpec);

Ipp8u* pMemInit   = NULL;
Ipp8u* pMemBuffer = NULL;
    if (sizeInit > 0)
         pMemInit = (Ipp8u*)ippMalloc(sizeInit);

    if (sizeBuffer > 0)
         pMemBuffer = (Ipp8u*)ippMalloc(sizeBuffer);

    /// initialize DFT specification structure
    status = ippiDFTInit_R_32f(mI.size_, IPP_FFT_DIV_FWD_BY_N, ippAlgHintNone, pMemSpec, pMemInit);

    /// free initialization buffer
    if (sizeInit > 0)
        ippFree(pMemInit);

    /// perform forward DFT to put source data to frequency domain
status = ippiDFTFwd_RToPack_32f_C1IR(mI, mI.bytes_step_[0], pMemSpec, pMemBuffer);
status = ippiMagnitudePack_32f_C1R(mI, mI.bytes_step_[0], mI, mI.bytes_step_[0], mI.size_);
//status = ippiPhasePack_32f_C1R(mI, mI.bytes_step_[0], mI, mI.bytes_step_[0], mI.size_);

/// ...

    /// free buffers
    if (sizeBuffer > 0)
        ippFree(pMemBuffer);

    ippFree(pMemSpec);
}

 

The result is different from MATLAB's (In the bottom right quadrant).
I also tried the phase and got it is different as well (Again, all perfect but certain quadrant).

Any idea what's happening?
Have I missed something?

Thank You.


Viewing all articles
Browse latest Browse all 1294

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>