PowerSpectr

Computes the power spectrum of a complex vector.

Syntax

Intel IPP style:

IppStatus ippsqPowerSpectr_32fc(const Ipp32fc* pSrc, Ipp32f* pDst, Ipp32u len);

IppStatus ippsqPowerSpectrQ15Q13_16sc_Rm(const Ipp16sc* pSrc, Ipp16s* pDst, Ipp32u len);

IppStatus ippsqPowerSpectrQ31Q29_32sc_Rm(const Ipp32sc* pSrc, Ipp32s* pDst, Ipp32u len);

DSP style:

void ippsq_cmplx_mag_squared_f32(const float32_t* pSrc, float32_t* pDst, uint32_t len);

void ippsq_cmplx_mag_squared_q15(const q15_t* pSrc, q15_t* pDst, uint32_t len);

void ippsq_cmplx_mag_squared_q31(const q31_t* pSrc, q31_t* pDst, uint32_t len);

Include Files

ippsq.h

dsp.h

Parameters

pSrc

Pointer to the source vector.

pDst

Pointer to the destination vector.

len

Number of elements in the vector.

Description

This function computes the power spectrum of the complex source vector pSrc and stores the result in pDst. The power spectrum elements are squares of the magnitudes of the complex source vector elements:

pDst[n]=(pSrc[n].re)2+(pSrc[n].im)2

Function flavors with the Rm suffix round down the result.

Scaling, Truncation, Saturation

Function Description

ippsqPowerSpectrQ15Q13_16sc_Rm

ippsq_cmplx_mag_squared_q15

The pSrc values are represented in Q15 complex format. The result of magnitude calculation of each complex number is represented in Q2.30. After that, the function shifts right the resulting values by 17 bits. Finally, the pDst values are represented in Q3.13 format.

ippsqPowerSpectrQ31Q29_32sc_Rm

ippsq_cmplx_mag_squared_q31

The pSrc values are represented in Q31 complex format. The result of magnitude calculation of each complex number is represented in Q2.62. After that, the function shifts right the resulting values by 33 bits. Finally, the pDst values are represented in Q3.29 format.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.
For more complete information about compiler optimizations, see our Optimization Notice.