Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

2D FFT Scaling ippiFFTInv_PackToR_32s8u_C3RSfs

support3
Beginner
1,238 Views
I'm trying to use function ippiFFTFwd_RToPack_8u32s_C3RSfs. The input is 512x512 RGB image. When I perfom forward and then inverse FFT, the image is either very dark or completly white, depending on the normalization I use.
For example, if I use any normalization other than IPP_FFT_NODIV_BY_ANY, resulting image will be very dark. If I use IPP_FFT_NODIV_BY_ANY, then I must specify 17 as a scale factor in the inverse FFT, otherwise the image is completly white.
Documentation is very vague about this (and many other) issues. I would assume that I don't need a scale factor (scale factor=1) to do froward and then inverse FFT to get the original image. Is this due to integer nature of this specific fft? Cananyone shed some light on this?


Thanks,
Miro
0 Kudos
2 Replies
Vladimir_Dudnik
Employee
1,238 Views
Hi Miro,
reqarding our expert, some small difference is allowable when you specify IPP_FFT_DIV_BY_SQRTNor IPP_FFT_DIV_INV_BY_N flags in call of ippiFFTFwd_RToPack_8u32s_C3RSfs / ippiFFTInv_PackToR_32s8u_C3RSfs functions.
When you use IPP_FFT_NODIV_BY_ANY flag for images 512x512 you need to calculate scaleFactor as scaleFactor=18. Because of9+9 (512=2^9), in this case you also should get close results.
If you still have big differences please check if you call IPPfunctions with correct parameters.
Regards,
Vladimir
0 Kudos
support3
Beginner
1,238 Views
Vladimir,
thank you very much. I didn't realize that scaling factor is actually a power of two. Documentation doesn't mention that (did I miss it?)
Thanks,
Miro
0 Kudos
Reply