irregular result of invers FFT!
I trying to FFT filter operation using ippi.
What I implement procedure is summarized below.
1. Alloc ippi values and initialize FFT context
=> ippiFFTInitAlloc_R_32f(&specR, 11, 0, IPP_FFT_DIV_INV_BY_N, ippAlgHintAccurate);
2. Read file (2000 x 1 (width x height)) and padding to 2048 x 1 and adopt forward FFT.
3. Multiply filter kernel using ippiMulPack_32f_C1IR.
4. Do invers FFT.
5. Repeat above (1000 x 250)/(number of CPU core) times.
6. Free all variables and FFT context.
Above procedure runs on multithreads corresponding to the number of cpu core.
It works good, but sometimes (I can not expect when it occur) the result of inverse FFT is bad, garbage value.
(Once the result of inverse FFT is bad, all the repeated (1000 x 250 times) result is bad.)
My development system: Windows7 ultimate x86, Visual Studio 2005.
Can you advice to fix the program?
Is it ok using ippi on multithread?
Hello Paul, First thanks for your kind reply.
I repeated steps 2-5, and I created own threads to run that sequence. and (1000 x 250)/(number of cores) means that I repeated 250,000 times and these are divided over multiple cores. Furthermore, each threads run independently.
Do Iallocate asingle memory for multiple threads for my own?
For the specific information see below.
- Create threads as many as the number of cpu core (N).
Alloc ippi valiables and initialize FFT context
for((1000 x 250)/(number of cores) times)
Read file (2000 x 1 (width x height)) and padding to 2048 x 1.
Do forward FFT
Multiply filter kernel using ippiMulPack_32f_C1IR.
Do invers FFT
Free all variables and FFT context.
It seems hard to understand clearly for my english skill.
int StepBytes_p32fc = 0;
p32fc = ippiMalloc_32fc_C1(2048, 1, &StepBytes_p32fc);
Above explanation seem to be wrong.
* ippiMalloc_ (int widthPixels, int
heightPixels, int* pStepBytes)
32-byte aligned memory allocation for images where every line of the image is padded with zeros. Memory can be freed only with the function ippiFree.