- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

IppStatus ippgDFTFwd_CToC_32fc(const Ipp32fc*pSrc, Ipp32fc*pDst, intlen, intflag);

IppStatus ippgDFTFwd_CToC_64fc(const Ipp64fc*pSrc, Ipp64fc*pDst, intlen, intflag);

it says :

supported value for

How should I specify the length and theIppsDFTSpec if I have a two dimention array such as 4096*4096?

Thanks.

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

the lenmay be 12 (log2(4096)ifarrary is 4096. But the functions ippsDFT_* orippgDFT_* in ipps manual ippsman.pdf aresupposed for 1D signal.

Iffor two dimention array, you may try the function in ippiman.pdf, for example,

IppStatus ippiDFTFwd_CToC_32fc_C1R(). And on the manual, you may refer tothe example

**Example 10-2 Fast Fourier Transform of a Complex Image**for how to specify the DFTSpec. (the usage of FFTSpec and DFTSpecis almost same andit is not need to specify the length)

Regards,

Ying

The function flavors ippgDFTFwd_CToC and ippgDFTFwd_CToC_

forward DFT of the fixed length. They do not need the DFT specification structure. The length

of transform can be specified by the parameter len, or ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

*.re = i;*

*.im = 0.0f;*

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I think you need to initialize your pDFTSpec buffer first using the

*ippiDFTInitAlloc()*function. See this excerpt from the image processing documentation:

The function ippiDFTInitAlloc is declared in the ippi.h file. This function allocates memory and initializes the context structure pDFTSpec needed to compute the forward and inverse DFT of a two-dimensional image data.

The ippiDFTFwd and ippiDFTInv functions called with the pointer to the initialized pDFTSpec structure as an argument will compute the discrete Fourier transform for points in the ROI of size roiSize, with results normalization mode set according to flag (see Table Normalization Factors for Fourier Transform Results), and computation algorithm indicated by hint.

Paul

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hello zlw,

there are may be some tiny error in the code.

First, (a potentialerror):**IppiSize** slen = {lenx, leny};

let's suppose that you have 5x10 matrix. Then **the "image" width** is 10 and **the height** is 5.

then lenx=10, leny=5;

second, the **srcSteps, dstSteps**: **Distance in bytes** between starts of consecutive lines

in theimage.

So status = ippiDFTFwd_CToC_32fc_C1R(pSrc, leny, pDst, leny, pDFTSpec, 0 );

should beat least;

ippiDFTFwd_CToC_32fc_C1R(pSrc, leny*sizeof(Ipp32fc) , pDst, leny*(Ipp32fc), pDFTSpec, 0 );

Note, leny should be **the image width, should be slen.width= lenx.**So you may take sure of the two things and make sure what is the input you hoped.

I did a small modification and then the program run ok.

//ippiDFT_test.cpp

#include

#include "ipp.h"

int main()

{

int lenx=5, leny=10; //5x10 matrix

Ipp32fc* pSrc;

Ipp32fc* pDst;

pSrc = ippsMalloc_32fc(lenx*leny);

pDst = ippsMalloc_32fc(lenx*leny);

for (int i = 0; i < lenx*leny; i++) {

pSrc*.re = i; pSrc .im = 0.0f; }IppiDFTSpec_C_32fc *pDFTSpec; IppStatus status; IppiSize slen = {leny, lenx}; ippiDFTInitAlloc_C_32fc( &pDFTSpec, slen, IPP_FFT_NODIV_BY_ANY, ippAlgHintAccurate ); status = ippiDFTFwd_CToC_32fc_C1R(pSrc, leny*sizeof(Ipp32fc), pDst, leny*sizeof(Ipp32fc), pDFTSpec, 0 );*

printf("%d : %s\n", status, ippGetStatusString(status));

printf("%f, %f, %f, %f\n", pDst[0].re, pDst[0].im, pDst[1].re, pDst[1].im);

status = ippiDFTFree_C_32fc(pDFTSpec); // expect ippStsNoErr

printf("%d : %s\n", status, ippGetStatusString(status));

return 0;

}

run result:

0 : ippStsNoErr: No error, it's OK

1225.000000, 0.000000, -25.000000, 76.942093

0 : ippStsNoErr: No error, it's OK

Press any key to continue . . .

Hope it helps.

Ying

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

I used this example to set up my 2D DFT. It works great for small examples, but when I use it for a real image (1024x1024) I get a stack overflow. Is there a work around?

Brooke

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

I am using IPP 7.1 on a Windows 7 machine and using VS 2008 Pro. By updating the linker settings as suggested, I can now run the 2D fft test code in my debugger, but when I compile my image processing library as a dll and call it from my Application (C# GUI) , I still get a stack oferflow error (0xc00000fd) when I try the first 2Dfft.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page