DFTFwd_RToPack, DFTFwd_RToPerm, DFTFwd_RToCCS

Computes the forward discrete Fourier transform of a real signal.

Syntax

Case 1: Result in Pack format

IppStatus ippsDFTFwd_RToPack_32f(const Ipp32f* pSrc, Ipp32f* pDst, const IppsDFTSpec_R_32f* pDFTSpec, Ipp8u* pBuffer);

IppStatus ippsDFTFwd_RToPack_64f(const Ipp64f* pSrc, Ipp64f* pDst, const IppsDFTSpec_R_64f* pDFTSpec, Ipp8u* pBuffer);

IppStatus ippsDFTFwd_RToPack_16s_Sfs(const Ipp16s* pSrc, Ipp16s* pDst, const IppsDFTSpec_R_16s* pDFTSpec, int scaleFactor, Ipp8u* pBuffer);

Case 2: Result in Pack format with fixed length of DFT

IppStatus ippgDFTFwd_RToPack_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len, int flag);

IppStatus ippgDFTFwd_RToPack_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len, int flag);

IppStatus ippgDFTFwd_RToPack_<len>_32f(const Ipp32f* pSrc, Ipp32f* pDst, int flag);

IppStatus ippgDFTFwd_RToPack_<len>_64f(const Ipp64f* pSrc, Ipp64f* pDst, int flag);

supported value for <len>: integer in the range [2, 64].

Case 3: Result in Perm format

IppStatus ippsDFTFwd_RToPerm_32f(const Ipp32f* pSrc, Ipp32f* pDst, const IppsDFTSpec_R_32f* pDFTSpec, Ipp8u* pBuffer);

IppStatus ippsDFTFwd_RToPerm_64f(const Ipp64f* pSrc, Ipp64f* pDst, const IppsDFTSpec_R_64f* pDFTSpec, Ipp8u* pBuffer);

IppStatus ippsDFTFwd_RToPerm_16s_Sfs(const Ipp16s* pSrc, Ipp16s* pDst, const IppsDFTSpec_R_16s* pDFTSpec, int scaleFactor, Ipp8u* pBuffer);

Case 4: Result in Perm format with fixed length of DFT

IppStatus ippgDFTFwd_RToPerm_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len, int flag);

IppStatus ippgDFTFwd_RToPerm_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len, int flag);

IppStatus ippgDFTFwd_RToPerm_<len>_32f(const Ipp32f* pSrc, Ipp32f* pDst, int flag);

IppStatus ippgDFTFwd_RToPerm_<len>_64f(const Ipp64f* pSrc, Ipp64f* pDst, int flag);

supported value for <len>: integer in the range [2, 64].

Case 5: Result in CCS format

IppStatus ippsDFTFwd_RToCCS_32f(const Ipp32f* pSrc, Ipp32f* pDst, const IppsDFTSpec_R_32f* pDFTSpec, Ipp8u* pBuffer);

IppStatus ippsDFTFwd_RToCCS_64f(const Ipp64f* pSrc, Ipp64f* pDst, const IppsDFTSpec_R_64f* pDFTSpec, Ipp8u* pBuffer);

IppStatus ippsDFTFwd_RToCCS_16s_Sfs(const Ipp16s* pSrc, Ipp16s* pDst, const IppsDFTSpec_R_16s* pDFTSpec, int scaleFactor, Ipp8u* pBuffer);

Case 6: Result in CCS format with fixed length of DFT

IppStatus ippgDFTFwd_RToCCS_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len, int flag);

IppStatus ippgDFTFwd_RToCCS_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len, int flag);

IppStatus ippgDFTFwd_RToCCS_<len>_32f(const Ipp32f* pSrc, Ipp32f* pDst, int flag);

IppStatus ippgDFTFwd_RToCCS_<len>_64f(const Ipp64f* pSrc, Ipp64f* pDst, int flag);

supported value for <len>: integer in the range [2, 64].

Parameters

pDFTSpec

Pointer to the DFT specification structure.

pSrc

Pointer to the input array containing real values .

pDst

Pointer to the output array containing packed complex values.

pBuffer

Pointer to the work buffer, can be NULL.

scaleFactor

Scale factor, refer to Integer Scaling.

flag

Specifies the result normalization method. The values for the flag argument are described in the section Flag and Hint Arguments.

len

Length of the DFT transform in range [2, 64].

Description

The functions ippsDFTFwd and ippgDFTFwd are declared in the ipps.h and ippgen.h files respectively . These functions compute the forward DFT of a real signal. The result of the forward transform (that is in the frequency-domain) of real signals is represented in several possible packed formats: Pack, Perm, or CCS. The data can be packed due to the symmetry property of the DFT transform of a real signal. Tables show how the output results are arranged in the packed formats.

Case 1, Case3, Case 5. These functions compute the forward DFT according to the pDFTSpec specification parameters: the transform len, the normalization flag, and the specific code hint.

For integer data types the output result is scaled according to the scaleFactor value, thus the output signal range and precision are retained.

These functions can be used with the external work buffer pBuffer to avoid memory allocation within the functions. Once the work buffer is allocated, it can be used for all following calls to the functions computing DFT. 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.

Required buffer size must be computed by the corresponding function ippsDFTGetBufSize_R beforehand.

If the external buffer is not specified (pBuffer is set to NULL), then the function itself allocates the memory needed for operation.

Case 2, Case 4, Case 6. These functions compute the forward DFT of the fixed length. They do not need the DFT specification structure. The length of transform can be specified by the parameter len, or by choosing the function flavor designed for the specific length of transform and containing its value in the function name, for example, the function flavor ippgDFTFwd_RToCCS_33_64f performs the forward DFT with length 33. Intel IPP support functions for the forward DFT with the fixed length in the range [2, 64] .

Caution iconCaution

Data vectors for these functions must be aligned to an appropriate number of bytes that is determined by the SIMD width that is supported by the customer's platform - use ippMalloc function for such alignment.

To avoid listing all the similar prototypes of function flavors of this type, only templates are given here. In the template the length of DFT is denoted by the modifier <len> and can be varied in the range of integers [2, 64].

The normalization method of the result is specified by the parameter flag.

The forward DFT functionality can be described as follows:



where k is the index of elements in the frequency domain, n is the index of elements in the time domain, N is the input signal len, and A is a multiplier defined by flag. Also, x(n) is pSrc[n] and X(k) is pDst[k].

ippsDFTFwd_RToPack, ippgDFTFwd_RToPack. These functions compute the forward DFT and stores the result in Pack format.

ippsDFTFwd_RToPerm, ippgDFTFwd_RToPerm. These functions compute the forward DFT and stores the result in Perm format.

ippsDFTFwd_RToCCS, ippgDFTFwd_RToCCS. These functions compute the forward DFT and stores the result in CCS format.

Optimization Notice

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804

Example below shows how to initialize the specification and call ippsDFTFwd_RToCCS_32f.

Return Values

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 pDFTSpec is incorrect.

ippStsMemAllocErr

Indicates an error when no memory is allocated.

ippStsFftFlagErr

Indicates an error when the flag value is incorrect.

Using the ippsDFTFwd_RToCCS Function

IppStatus dft( void ) {
     Ipp32f x[7], X[8];
     int n;
     IppStatus status;
     IppsDFTSpec_R_32f* spec;
     status = ippsDFTInitAlloc_R_32f(&spec, 7, IPP_FFT_DIV_INV_BY_N, 
          ippAlgHintNone);
     for( n=0; n<7; ++n ) x[n] = (float) cos(IPP_2PI * n * 14 / 49);
     status = ippsDFTFwd_RToCCS_32f( x, X, spec, NULL );
     ippsMagnitude_32fc( (Ipp32fc*)X, x, 4 );
     ippsDFTFree_R_32f( spec );
     printf_32f("dft magn =", x, 4, status );
     return status;
}
Output:
    dft magn =  0.000000 0.000000 3.500000 0.000000
Matlab* analog:
    >> N=7;F=14/49;n=0:N-1;x=cos(2*pi*n*F);y=abs(fft(x));y(1:4)

	

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.