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

In-place FFT questions

ipp
Beginner
523 Views
I want to replace a slow in-place FFT with something from the IPP libraries. My application is processing audio, generally with 4K float samples per frame/ 4K FFT bins. Questions arising are:

1. Ippsman.pdf indicates that ippsFFTFwd_CToC_32f_I() looks like a suitable replacement but does not document the function arguments very well (at all even). pSrcDstRe and pSrcDstIm I can guess but I'm foxed by the final Ipp8u* argument called pBuffer. Looking at the IPP MFC sample this appears to be set to 0/NULL. Is this the case?

2. I'm unsure how to get the data interleaved in the right way. The current FFT takes a buffer with audio samples arranged like this:

float buffer[framesize];
buffer[0] = audioSample0;
buffer[1] = 0.0f;
buffer[2] = audioSample1;
buffer[3] = 0.0f;
buffer[framesize-2] = finalAudioSample;
buffer[framesize-1] = 0.0f;

post FFT the buffer contains interleaved real/imaginary components. How can I specify this format when setting up the FFT plan?

3. By the way, are there any more dedicated C/C++/C# code samples? The stuff included with the IPP evaluation seems a bit thin.

Many thanks

Jerry


0 Kudos
1 Reply
Vladimir_Dudnik
Employee
523 Views

Hello,

there are some comments from our expert

1.There is special functions 

/* /////////////////////////////////////////////////////////////////////////////

// FFT Buffer Size

///////////////////////////////////////////////////////////////////////////// */

/* /////////////////////////////////////////////////////////////////////////////

// Name: ippsFFTGetBufSize_C, ippsFFTGetBufSize_R

// Purpose: get size of the FFT work buffer (on bytes)

// Arguments:

// pFFTSpec - pointer to the FFT structure

// pBufferSize - Pointer to the FFT work buffer size value

// Return:

// ippStsNoErr no errors

// ippStsNullPtrErr pFFTSpec == NULL or pBufferSize == NULL

// ippStsContextMatchErr bad context identifier

*/

That provides information about required buffer size

for correct FFT processing. It can be than allocated

and pointer provided for FFT function.

If a user doesnt want to take control on all memory

buffers he may provide NULL pointer

for FFT function in such case memory will be allocated

inside FFT.

2. You can use real FFT instead of cplx: 

/* /////////////////////////////////////////////////////////////////////////////

// FFT Real Packed Transforms

///////////////////////////////////////////////////////////////////////////// */

/* /////////////////////////////////////////////////////////////////////////////

// Name: ippsFFTFwd_RToPerm, ippsFFTFwd_RToPack, ippsFFTFwd_RToCCS

// ippsFFTInv_PermToR, ippsFFTInv_PackToR, ippsFFTInv_CCSToR

// Purpose: compute forward and inverse FFT of real signal

// using Perm, Pack or Ccs packed format

// Arguments:

// pFFTSpec - pointer to FFT context

// pSrc - pointer to source signal

// pDst - pointer to destination signal

// pSrcDst - pointer to signal

// pBuffer - pointer to work buffer

// scaleFactor

// - scale factor for output result

// Return:

// ippStsNoErr no errors

// ippStsNullPtrErr pFFTSpec == NULL or

// pSrc == NULL or pDst == NULL

// ippStsContextMatchErr bad context identifier

// ippStsMemAllocErr memory allocation error

*/

Regards,
Vladimir

0 Kudos
Reply