Skip to content

Complex Magnitude

Module: Complex Math Functions

More...

Functions

Name
void plp_cmplx_mag_f32s_xpulpv2(const float32_t * pSrc, float32_t * pRes, uint32_t numSamples)
complex magnitude for float32 on XPULPV2
void plp_cmplx_mag_i16s_rv32im(const int16_t * pSrc, int16_t * pRes, uint32_t numSamples)
complex magnitude for i16 on RV32IM
void plp_cmplx_mag_i16s_xpulpv2(const int16_t * pSrc, int16_t * pRes, uint32_t numSamples)
complex magnitude for i16 on XPULPV2
void plp_cmplx_mag_i32s_rv32im(const int32_t * pSrc, int32_t * pRes, uint32_t numSamples)
complex magnitude for i32 on RV32IM
void plp_cmplx_mag_i32s_xpulpv2(const int32_t * pSrc, int32_t * pRes, uint32_t numSamples)
complex magnitude for i32 on XPULPV2
void plp_cmplx_mag_i8s_rv32im(const int8_t * pSrc, int8_t * pRes, uint32_t numSamples)
complex magnitude for i8 on RV32IM
void plp_cmplx_mag_i8s_xpulpv2(const int8_t * pSrc, int8_t * pRes, uint32_t numSamples)
complex magnitude for i8 on XPULPV2
void plp_cmplx_mag_q16s_rv32im(const int16_t * pSrc, const uint32_t fracBits, int16_t * pRes, uint32_t numSamples)
complex magnitude for q16 on RV32IM
void plp_cmplx_mag_q16s_xpulpv2(const int16_t * pSrc, const uint32_t fracBits, int16_t * pRes, uint32_t numSamples)
complex magnitude for q16 on XPULPV2
void plp_cmplx_mag_q32s_rv32im(const int32_t * pSrc, const uint32_t fracBits, int32_t * pRes, uint32_t numSamples)
complex magnitude for q32 on RV32IM
void plp_cmplx_mag_q32s_xpulpv2(const int32_t * pSrc, const uint32_t fracBits, int32_t * pRes, uint32_t numSamples)
complex magnitude for q32 on XPULPV2
void plp_cmplx_mag_q8s_rv32im(const int8_t * pSrc, const uint32_t fracBits, int8_t * pRes, uint32_t numSamples)
complex magnitude for q8 on RV32IM
void plp_cmplx_mag_q8s_xpulpv2(const int8_t * pSrc, const uint32_t fracBits, int8_t * pRes, uint32_t numSamples)
complex magnitude for q8 on XPULPV2
void plp_cmplx_mag_f32(const float32_t * pSrc, float32_t * pRes, uint32_t numSamples)
Glue code for complex magnitude calculation in float32.
void plp_cmplx_mag_i16(const int16_t * pSrc, int16_t * pRes, uint32_t numSamples)
Glue code for complex magnitude calculation in 16-bit integer.
void plp_cmplx_mag_i32(const int32_t * pSrc, int32_t * pRes, uint32_t numSamples)
Glue code for complex magnitude calculation in 32-bit integer.
void plp_cmplx_mag_i8(const int8_t * pSrc, int8_t * pRes, uint32_t numSamples)
Glue code for complex magnitude calculation in 8-bit integer.
void plp_cmplx_mag_q16(const int16_t * pSrc, const uint32_t fracBits, int16_t * pRes, uint32_t numSamples)
Glue code for complex magnitude calculation in 16-bit quantized integer.
void plp_cmplx_mag_q32(const int32_t * pSrc, const uint32_t fracBits, int32_t * pRes, uint32_t numSamples)
Glue code for complex magnitude calculation for 32 bit fixpoint.
void plp_cmplx_mag_q8(const int8_t * pSrc, const uint32_t fracBits, int8_t * pRes, uint32_t numSamples)
Glue code for complex magnitude calculation for 8 bit fixpoint.

Detailed Description

Computes the magnitude of the elements of a complex data vector. The pSrc points to the source data and pDst points to the where the result should be written. numSamples specifies the number of complex samples in the input array and the data is stored in an interleaved fashion (real, imag, real, imag, ...). The input array has a total of 2*numSamples values; the output array has a total of numSamples values. The underlying algorithm is used: for (n = 0; n < numSamples; n++) { pDst[n] = sqrt(pSrc[(2n)+0]^2 + pSrc[(2n)+1]^2); } There are separate functions for floating point, integer, and fixed point 32- 16- 8-bit data types. Please ensure the appropriate range is used for integers and fixed point data types, as these are at risk for overflow if using too large numbers. Larger than normal errors are possible when using fixed point numbers and very small values.

Functions Documentation

function plp_cmplx_mag_f32s_xpulpv2

void plp_cmplx_mag_f32s_xpulpv2(
    const float32_t * pSrc,
    float32_t * pRes,
    uint32_t numSamples
)

complex magnitude for float32 on XPULPV2

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_i16s_rv32im

void plp_cmplx_mag_i16s_rv32im(
    const int16_t * pSrc,
    int16_t * pRes,
    uint32_t numSamples
)

complex magnitude for i16 on RV32IM

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_i16s_xpulpv2

void plp_cmplx_mag_i16s_xpulpv2(
    const int16_t * pSrc,
    int16_t * pRes,
    uint32_t numSamples
)

complex magnitude for i16 on XPULPV2

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_i32s_rv32im

void plp_cmplx_mag_i32s_rv32im(
    const int32_t * pSrc,
    int32_t * pRes,
    uint32_t numSamples
)

complex magnitude for i32 on RV32IM

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_i32s_xpulpv2

void plp_cmplx_mag_i32s_xpulpv2(
    const int32_t * pSrc,
    int32_t * pRes,
    uint32_t numSamples
)

complex magnitude for i32 on XPULPV2

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_i8s_rv32im

void plp_cmplx_mag_i8s_rv32im(
    const int8_t * pSrc,
    int8_t * pRes,
    uint32_t numSamples
)

complex magnitude for i8 on RV32IM

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_i8s_xpulpv2

void plp_cmplx_mag_i8s_xpulpv2(
    const int8_t * pSrc,
    int8_t * pRes,
    uint32_t numSamples
)

complex magnitude for i8 on XPULPV2

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_q16s_rv32im

void plp_cmplx_mag_q16s_rv32im(
    const int16_t * pSrc,
    const uint32_t fracBits,
    int16_t * pRes,
    uint32_t numSamples
)

complex magnitude for q16 on RV32IM

Parameters:

  • pSrc pointer to source
  • fracBits fractional bits -> Q(32-fracBits).fracBits
  • pRes pointer to result
  • numSamples The number of samples

function plp_cmplx_mag_q16s_xpulpv2

void plp_cmplx_mag_q16s_xpulpv2(
    const int16_t * pSrc,
    const uint32_t fracBits,
    int16_t * pRes,
    uint32_t numSamples
)

complex magnitude for q16 on XPULPV2

Parameters:

  • pSrc pointer to source
  • fracBits fractional bits -> Q(32-fracBits).fracBits
  • pRes pointer to result
  • numSamples The number of samples

function plp_cmplx_mag_q32s_rv32im

void plp_cmplx_mag_q32s_rv32im(
    const int32_t * pSrc,
    const uint32_t fracBits,
    int32_t * pRes,
    uint32_t numSamples
)

complex magnitude for q32 on RV32IM

Parameters:

  • pSrc pointer to source
  • fracBits fractional bits -> Q(32-fracBits).fracBits
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_q32s_xpulpv2

void plp_cmplx_mag_q32s_xpulpv2(
    const int32_t * pSrc,
    const uint32_t fracBits,
    int32_t * pRes,
    uint32_t numSamples
)

complex magnitude for q32 on XPULPV2

Parameters:

  • pSrc pointer to source
  • fracBits fractional bits -> Q(32-fracBits).fracBits
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_q8s_rv32im

void plp_cmplx_mag_q8s_rv32im(
    const int8_t * pSrc,
    const uint32_t fracBits,
    int8_t * pRes,
    uint32_t numSamples
)

complex magnitude for q8 on RV32IM

Parameters:

  • pSrc pointer to source
  • fracBits fractional bits -> Q(8-fracBits).fracBits
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_q8s_xpulpv2

void plp_cmplx_mag_q8s_xpulpv2(
    const int8_t * pSrc,
    const uint32_t fracBits,
    int8_t * pRes,
    uint32_t numSamples
)

complex magnitude for q8 on XPULPV2

Parameters:

  • pSrc pointer to source
  • fracBits fractional bits -> Q(8-fracBits).fracBits
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_f32

void plp_cmplx_mag_f32(
    const float32_t * pSrc,
    float32_t * pRes,
    uint32_t numSamples
)

Glue code for complex magnitude calculation in float32.

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_i16

void plp_cmplx_mag_i16(
    const int16_t * pSrc,
    int16_t * pRes,
    uint32_t numSamples
)

Glue code for complex magnitude calculation in 16-bit integer.

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_i32

void plp_cmplx_mag_i32(
    const int32_t * pSrc,
    int32_t * pRes,
    uint32_t numSamples
)

Glue code for complex magnitude calculation in 32-bit integer.

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_i8

void plp_cmplx_mag_i8(
    const int8_t * pSrc,
    int8_t * pRes,
    uint32_t numSamples
)

Glue code for complex magnitude calculation in 8-bit integer.

Parameters:

  • pSrc pointer to source
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_q16

void plp_cmplx_mag_q16(
    const int16_t * pSrc,
    const uint32_t fracBits,
    int16_t * pRes,
    uint32_t numSamples
)

Glue code for complex magnitude calculation in 16-bit quantized integer.

Parameters:

  • pSrc pointer to source
  • fracBits fractional bits -> Q(32-fracBits).fracBits
  • pRes pointer to result
  • numSamples The number of samples

function plp_cmplx_mag_q32

void plp_cmplx_mag_q32(
    const int32_t * pSrc,
    const uint32_t fracBits,
    int32_t * pRes,
    uint32_t numSamples
)

Glue code for complex magnitude calculation for 32 bit fixpoint.

Parameters:

  • pSrc pointer to source
  • fracBits fractional bits -> Q(32-fracBits).fracBits
  • pRes pointer to result
  • numSamples The number samples

function plp_cmplx_mag_q8

void plp_cmplx_mag_q8(
    const int8_t * pSrc,
    const uint32_t fracBits,
    int8_t * pRes,
    uint32_t numSamples
)

Glue code for complex magnitude calculation for 8 bit fixpoint.

Parameters:

  • pSrc pointer to source
  • fracBits fractional bits -> Q(8-fracBits).fracBits
  • pRes pointer to result
  • numSamples The number samples

Updated on 2023-03-01 at 16:16:32 +0000