Phase

Computes the phase angles of elements of a complex vector.

Syntax

IppStatus ippsPhase_64fc(const Ipp64fc* pSrc, Ipp64f* pDst, int len);

IppStatus ippsPhase_32fc(const Ipp32fc* pSrc, Ipp32f* pDst, int len);

IppStatus ippsPhase_16sc32f(const Ipp16sc* pSrc, Ipp32f* pDst, int len);

IppStatus ippsPhase_16sc_Sfs(const Ipp16sc* pSrc, Ipp16s* pDst, int len, int scaleFactor);

IppStatus ippsPhase_32sc_Sfs(const Ipp32sc* pSrc, Ipp32s* pDst, int len, int scaleFactor);

IppStatus ippsPhase_64f(const Ipp64f* pSrcRe, const Ipp64f* pSrcIm, Ipp64f* pDst, int len);

IppStatus ippsPhase_32f(const Ipp32f* pSrcRe, const Ipp32f* pSrcIm, Ipp32f* pDst, int len);

IppStatus ippsPhase_16s32f(const Ipp16s* pSrcRe, const Ipp16s* pSrcIm, Ipp32f* pDst, int len);

IppStatus ippsPhase_16s_Sfs(const Ipp16s* pSrcRe, const Ipp16s* pSrcIm, Ipp16s* pDst, int len, int scaleFactor);

Parameters

pSrc

Pointer to the source vector.

pSrcRe

Pointer to the source vector which stores the real components.

pSrcIm

Pointer to the source vector which stores the imaginary components.

pDst

Pointer to the vector which stores the phase (angle) components of the elements in radians. Phase values are in the range (-π, π].

len

Number of elements in the vector

scaleFactor

Scale factor, refer to Integer Scaling .

Description

The function ippsPhase is declared in the ipps.h file. This function returns the phase angles of elements of the complex input vector pSrc, or the complex input vector whose real and imaginary components are specified in the vectors pSrcRe and pSrcIm, respectively, and stores the result in the vector pDst. Phase values are returned in radians and are in the range (-π, π] .

The example below shows how to call the function ippsPhase_32f.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when at least one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to 0.

Using the ippsPhase Function

void func_phase()
{
    Ipp32f re[4]= {0.0, 1.0, 0.0, 1.0};
    Ipp32f im[4]= {0.0, 0.0, 1.0, 1.0};
    Ipp32f pDst[4];

		
    ippsPhase_32f(re,im,pDst, 4);
}
Result
pDst -> {0.0, 0.0, 1.6 0.8)

	

Submit feedback on this help topic

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