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

FFT 3D

mickeyhah
Beginner
430 Views

Hallo,

I want to ask about how we perform FFT3D. Actually I already did it, but the result is different from what I expected.

Here is my code

ippiFFTInitAlloc_C_32fc(&spec2D, 4, 3, IPP_FFT_DIV_INV_BY_N, ippAlgHintNone);

for (k=0; k

//dst: 2-dimensional array

status2D = ippiFFTFwd_CToC_32fc_C1R((Ipp32fc*)input+NX/2*NY*k, 16*sizeof(Ipp32fc), dst2D, 16*sizeof(Ipp32fc), spec2D, NULL);

//spread the 2D array to 1D array.

for (i=0; i

dst_tmp[k*NX/2*NY+i]=dst2D;

}

ippiFFTFree_C_32fc(spec2D);

status1D=ippsFFTInitAlloc_C_32fc(&spec1D, 9, IPP_FFT_DIV_INV_BY_N, ippAlgHintNone);

status1D = ippsFFTFwd_CToC_32fc(dst_tmp, output, spec1D, pBuffer1D);

ippsFFTFree_C_32fc(spec1D);

Aremy code and my method for calculating FFT3D correct?

Thank you for your help

Regards

Anh Ngo

0 Kudos
3 Replies
Vladimir_Dudnik
Employee
430 Views

Hello,

there is comment from our expert:

FFT3D for NX * NY * NZ can be splitted into two phases,

1. NZ calculation of FFT2D for size NX * NY

2. NX * NY calculation of FFT1D for NZ size

so recomendation is to use something like this

NX = 1<

NY = 1<

NZ = 1<

ippiFFTInitAlloc_C_32fc(&spec2D, orderX, orderY, IPP_FFT_DIV_INV_BY_N, ippAlgHintNone);

for (k=0; k

status2D = ippiFFTFwd_CToC_32fc_C1R((Ipp32fc*)input+NX*NY*k, 16*sizeof(Ipp32fc), (Ipp32fc*)output+NX*NY*k, 16*sizeof(Ipp32fc), spec2D, NULL);

}

ippiFFTFree_C_32fc(spec2D);

status1D = ippsFFTInitAlloc_C_32fc(&spec1D, orderZ, IPP_FFT_DIV_INV_BY_N, ippAlgHintNone);

for (i=0; i

for (j=0; j

for (k=0; k

tmp=output[i+NX*j+NX*NY*k]

}

status1D = ippsFFTFwd_CToC_32fc(tmp, tmp, spec1D, pBuffer1D);

for (k=0; k

output[i+NX*j+NX*NY*k]= tmp;

}

}

}

ippsFFTFree_C_32fc(spec1D);

Regards,
Vladimir

0 Kudos
mickeyhah
Beginner
430 Views

Hallo,

Thank you for your quick response.

Now I want to do the FFT3D inverse, so I have to do in the same way but in the reverse order. That means

1. NX * NY calculation of FFT1D inversefor NZ size

2. NZ calculation of FFT2D inverse for size NX * NY

Is that correct?

Regards

Anh

0 Kudos
Vladimir_Dudnik
Employee
430 Views

Yes, that's correct. Note, that FFT3D is also available in Intel Math Kernel library

Regards,
Vladimir

0 Kudos
Reply