Magnitude

Complex vector magnitude

Supported Technologies

MT, SSE2, Family10h

Synopsis

FwStatus   fwsMagnitude_32f ( const Fw32f * pSrcRe, const Fw32f * pSrcIm, Fw32f * pDst, int len );
FwStatus   fwsMagnitude_64f ( const Fw64f * pSrcRe, const Fw64f * pSrcIm, Fw64f * pDst, int len );
FwStatus   fwsMagnitude_32fc ( const Fw32fc * pSrc, Fw32f * pDst, int len );
FwStatus   fwsMagnitude_64fc ( const Fw64fc * pSrc, Fw64f * pDst, int len );
FwStatus   fwsMagnitude_16s32f ( const Fw16s * pSrcRe, const Fw16s * pSrcIm, Fw32f * pDst, int len );
FwStatus   fwsMagnitude_16sc32f ( const Fw16sc * pSrc, Fw32f * pDst, int len );
FwStatus   fwsMagnitude_16s_Sfs ( const Fw16s * pSrcRe, const Fw16s * pSrcIm, Fw16s * pDst, int len, int scaleFactor );
FwStatus   fwsMagnitude_16sc_Sfs ( const Fw16sc * pSrc, Fw16s * pDst, int len, int scaleFactor );
FwStatus   fwsMagnitude_32sc_Sfs ( const Fw32sc * pSrc, Fw32s * pDst, int len, int scaleFactor );

Parameters

len   Specifies the number of elements in a buffer.
pDst   Pointer to a destination buffer.
pSrc   Pointer to a source buffer.
pSrcIm   Pointer to a source buffer that contains the imaginary component values of an input signal.
pSrcRe   Pointer to a source buffer that contains the real component values of an input signal.
scaleFactor   Specifies an integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).

Description

These functions step through elements of a complex vector, calculate the magnitude of each element, and write the result to a destination buffer.

The following evaluation formula is used.

 Magnitude = sqrt( (re * re) + (im * im) )

There are versions of the function that operate on one source buffer containing a complex vector and versions that operate on two source buffers containing real and imaginary component values.

There are single-vector 16-bit signed complex and single-vector 32-bit signed complex versions that perform integer scaling before writing the results.