Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® Integrated Performance Primitives
- Problems with ippsFFTInv_CToC

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

c__a

Beginner

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

03-07-2011
07:39 AM

49 Views

Problems with ippsFFTInv_CToC

Hi,

I observe a very strange behaviour of ippsFFTInv_CToC: the results are multiplied by the FFT length even if IPP_FFT_NODIV_BY_ANY is used as a flag for FFTSpec allocation.

Below is my example code, which generates a signal, performs an FFT on it and afterwards an IFFT on the output of the FFT. I would expect the final output to be exactly the same as the generated signal (except for rounding error of course), but this is not the case: the output values need to be divided by the FFT length in order to be correct.

As far as I could understand by reading the documentation, it doesnt seem to me that this behaviour is correct. But maybe I am making some mistake.

Any help would be greatly appreciated.

[cpp]void fftIPPTest() { unsigned int nDataPow2 = 1024; unsigned int order = 10; Ipp64fc* input = ippsMalloc_64fc(nDataPow2); Ipp64fc* output = ippsMalloc_64fc(nDataPow2); Ipp64fc* output_ifft = ippsMalloc_64fc(nDataPow2); ippsZero_64fc(input, nDataPow2); ippsZero_64fc(output, nDataPow2); ippsZero_64fc(output_ifft, nDataPow2); /*Generate some signal*/ for (int i = 0; i < nDataPow2; i++) { input.re = i; input.im = i; } IppsFFTSpec_C_64fc* fftConfig; IppStatus st = ippsFFTInitAlloc_C_64fc(&fftConfig, order, IPP_FFT_NODIV_BY_ANY, ippAlgHintAccurate); /*FFT*/ st = ippsFFTFwd_CToC_64fc(input, output, fftConfig, NULL); /*IFFT*/ st = ippsFFTInv_CToC_64fc(output, output_ifft, fftConfig, NULL); for (int i = 0; i < nDataPow2; i++) { Ipp64f diff_re = input.re - output_ifft.re; Ipp64f diff_im = input.im - output_ifft.im; printf("-----\n"); printf("%d re: in -> %e | out -> %e | diff: %e\n", i, input.re, output_ifft.re, diff_re); printf("%d im: in -> %e | out -> %e | diff: %e\n", i, input.im, output_ifft.im, diff_im); printf("-----\n"); } st = ippsFFTFree_C_64fc(fftConfig); ippsFree(input); ippsFree(output); ippsFree(output_ifft); }[/cpp]

Link Copied

2 Replies

Chao_Y_Intel

Employee

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

03-08-2011
10:17 PM

49 Views

Hi AC,

According to FFT formula, either forward transform is done with the 1/N normalization, or inverse transform is done

With the 1/N normalization, or forward and inverse transform is done with the N^1/2 normalization, the input and out will get same result.

so, it needs to use one of the following flags:

IPP_FFT_DIV_FWD_BY_N/IPP_FFT_DIV_INV_BY_N/IPP_FFT_DIV_BY_SQRTN.

Thanks,

Chao

c__a

Beginner

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

03-09-2011
11:29 AM

49 Views

Ok, I got it now.

Thanks.

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

For more complete information about compiler optimizations, see our Optimization Notice.