Computes the forward or inverse fast Fourier transform (FFT) of a real signal.
Case 1: Not-in-place operation, result in Pack Format
IppStatus ippsFFTFwd_RToPack_32f(const Ipp32f* pSrc, Ipp32f* pDst, const IppsFFTSpec_R_32f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPack_64f(const Ipp64f* pSrc, Ipp64f* pDst, const IppsFFTSpec_R_64f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPack_16s_Sfs(const Ipp16s* pSrc, Ipp16s* pDst, const IppsFFTSpec_R_16s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPack_32s_Sfs(const Ipp32s* pSrc, Ipp32s* pDst, const IppsFFTSpec_R_32s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
Case 2: In-place operation, result in Pack Format
IppStatus ippsFFTFwd_RToPack_32f_I(Ipp32f* pSrcDst, const IppsFFTSpec_R_32f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPack_64f_I(Ipp64f* pSrcDst, const IppsFFTSpec_R_64f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPack_16s_ISfs(Ipp16s* pSrcDst, const IppsFFTSpec_R_16s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPack_32s_ISfs(Ipp32s* pSrcDst, const IppsFFTSpec_R_32s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
Case 3: Not-in-place operation, result in Perm Format
IppStatus ippsFFTFwd_RToPerm_32f(const Ipp32f* pSrc, Ipp32f* pDst, const IppsFFTSpec_R_32f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPerm_64f(const Ipp64f* pSrc, Ipp64f* pDst, const IppsFFTSpec_R_64f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPerm_16s_Sfs(const Ipp16s* pSrc, Ipp16s* pDst, const IppsFFTSpec_R_16s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPerm_32s_Sfs(const Ipp32s* pSrc, Ipp32s* pDst, const IppsFFTSpec_R_32s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
Case 4: In-place operation, result in Perm Format
IppStatus ippsFFTFwd_RToPerm_32f_I(Ipp32f* pSrcDst, const IppsFFTSpec_R_32f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPerm_64f_I(Ipp64f* pSrcDst const IppsFFTSpec_R_64f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPerm_16s_ISfs(Ipp16s* pSrcDst, const IppsFFTSpec_R_16s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToPerm_32s_ISfs(Ipp32s* pSrcDst, const IppsFFTSpec_R_32s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
Case 5: Not-in-place operation, result in CCS Format
IppStatus ippsFFTFwd_RToCCS_32f(const Ipp32f* pSrc, Ipp32f* pDst, const IppsFFTSpec_R_32f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToCCS_64f(const Ipp64f* pSrc, Ipp64f* pDst, const IppsFFTSpec_R_64f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToCCS_16s_Sfs(const Ipp16s* pSrc, Ipp16s* pDst, const IppsFFTSpec_R_16s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToCCS_32s_Sfs(const Ipp32s* pSrc, Ipp32s* pDst, const IppsFFTSpec_R_32s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToCCS_16s32s_Sfs(const Ipp16s* pSrc, Ipp32s* pDst, const IppsFFTSpec_R_16s32s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
Case 6: In-place operation, result in CCS Format
IppStatus ippsFFTFwd_RToCCS_32f_I(Ipp32f* pSrcDst, const IppsFFTSpec_R_32f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToCCS_64f_I(Ipp64f* pSrcDst, const IppsFFTSpec_R_64f* pFFTSpec, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToCCS_16s_ISfs(Ipp16s* pSrcDst, const IppsFFTSpec_R_16s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
IppStatus ippsFFTFwd_RToCCS_32s_ISfs(Ipp32s* pSrcDst, const IppsFFTSpec_R_32s* pFFTSpec, int scaleFactor, Ipp8u* pBuffer);
pFFTSpec |
Pointer to the FFT specification structure. |
pSrc |
Pointer to the input array. |
pDs |
Pointer to the output array containing packed complex values. |
pSrcDst |
Pointer to the input and output arrays for the in-place operation. |
pBuffer |
Pointer to the external work buffer, can be NULL. |
scaleFactor |
Scale factor, refer to Integer Scaling. |
The functions ippsFFTFwd_RToPerm, ippsFFTFwd_RToPack, and ippsFFTFwd_RToCCS are declared in the ipps.h file. They compute the forward FFT of a real signal and store the result in Pack, Perm, or CCS packed formats respectively. The transform is performed in accordance with the pFFTSpec specification parameters: the transform order, the normalization flag, and the specific code hint. Before calling these functions the FFT specification structure must be initialized by the corresponding flavors of either ippsFFTInitAlloc_R or ippsFFTInitc_R. The length of the FFT must be a power of 2.
For integer data types the output result is scaled according to the scaleFactor value, thus the output signal range and precision are retained.
The function may be used with the external work buffer pBufferto avoid memory allocation within the functions. Once the work buffer is allocated, it can be used for all following calls to the functions computing FFT. As internal allocation of memory is too expensive operation and depends on operating system and/or runtime libraries used - the use of an external buffer improves performance significantly, especially for the small size transforms.
The size of the external buffer must be previously computed by the function ippsFFTGetBufSize_R or ippsFFTGetSize_R.
If the external buffer is not specified (pBuffer is set to NULL), then the function itself allocates the memory needed for operation.
ippsFFTFwd_RToPack. This function computes the forward FFT and stores the result in Pack format.
ippsFFTFwd_RToPerm. This function computes the forward FFT and stores the result in Perm format.
ippsFFTFwd_RToCCS. This function computes the forward FFT and stores the result in CCS format.
Tables show how the output results are arranged in the packed formats. The code example below shows how to initialize the specification structure and call the function ippsFFTFwd_RToCCS_32f.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when one of the specified pointers with exception of pBuffer is NULL. |
ippStsContextMatchErr |
Indicates an error when the specification identifier pFFTSpec is incorrect. |
ippStsMemAllocErr |
Indicates an error when no memory is allocated. |
IppStatus fft( void ) {
Ipp32f x[8], X[10];
int n;
IppStatus status;
IppsFFTSpec_R_32f* spec;
status = ippsFFTInitAlloc_R_32f(&spec, 3, IPP_FFT_DIV_INV_BY_N, ippAlgHintNone );
for(n=0; n<8; ++n) x[n] = (float)cos(IPP_2PI *n *16/64);
status = ippsFFTFwd_RToCCS_32f( x, X, spec, NULL );
ippsMagnitude_32fc( (Ipp32fc*)X, x, 4 );
ippsFFTFree_R_32f( spec );
printf_32f("fft magn =", x, 4, status );
return status;
}
Output: fft magn = 0.000000 0.000000 4.000000 0.000000
Matlab* Analog: >> n=0:7; x=sin(2*pi*n*16/64); X=abs(fft(x)); X(1:4)
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.