Magnitude

Complex vector magnitude

Supported Technologies

MT, SSE2, Family10h

Synopsis

FwStatus   fwsMagnitude_32f ( const Fw32f * pSrcReconst Fw32f * pSrcImFw32f * pDstint len );
FwStatus   fwsMagnitude_64f ( const Fw64f * pSrcReconst Fw64f * pSrcImFw64f * pDstint len );
FwStatus   fwsMagnitude_32fc ( const Fw32fc * pSrcFw32f * pDstint len );
FwStatus   fwsMagnitude_64fc ( const Fw64fc * pSrcFw64f * pDstint len );
FwStatus   fwsMagnitude_16s32f ( const Fw16s * pSrcReconst Fw16s * pSrcImFw32f * pDstint len );
FwStatus   fwsMagnitude_16sc32f ( const Fw16sc * pSrcFw32f * pDstint len );
FwStatus   fwsMagnitude_16s_Sfs ( const Fw16s * pSrcReconst Fw16s * pSrcImFw16s * pDstint lenint scaleFactor );
FwStatus   fwsMagnitude_16sc_Sfs ( const Fw16sc * pSrcFw16s * pDstint lenint scaleFactor );
FwStatus   fwsMagnitude_32sc_Sfs ( const Fw32sc * pSrcFw32s * pDstint lenint 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.