Rate This Document
Findability
Accuracy
Completeness
Readability

VectorJaehne

Generates a special vector that can be used to test signals to examine the effects of applying different signal processing functions.

The function interface declaration is as follows:

  • Operations on integers:

    HmppResult HMPPS_VectorJaehne_8u(uint8_t *dst, int32_t len, uint8_t magn);

    HmppResult HMPPS_VectorJaehne_16u(uint16_t *dst, int32_t len, uint16_t magn);

    HmppResult HMPPS_VectorJaehne_16s(int16_t *dst, int32_t len, int16_t magn);

    HmppResult HMPPS_VectorJaehne_32s(int32_t *dst, int32_t len, int32_t magn);

  • Operations on floating-point numbers:

    HmppResult HMPPS_VectorJaehne_32f(float *dst, int32_t len, float magn);

    HmppResult HMPPS_VectorJaehne_64f(double *dst, int32_t len, double magn);

Parameters

Parameter

Description

Value Range

Input/Output

dst

Pointer to the destination vector

The value cannot be NULL.

Output

len

Vector length

(0, INT_MAX]

Input

magn

Magnitude

Depending on the data type

Input

Return Value

  • Success: HMPP_STS_NO_ERR
  • Failure: An error code is returned.

Error Codes

Error Code

Description

HMPP_STS_NULL_PTR_ERR

The value of dst is NULL.

HMPP_STS_SIZE_ERR

The value of len is less than or equal to 0.

HMPP_STS_PARAMETER_ERR

The magnitude is less than 0.

Example

#define BUFFER_SIZE_T 10

int main()
{
    int16_t dst[BUFFER_SIZE_T];
    int32_t i;
    int16_t magn = 25;

    HmppResult result = HMPPS_Vectorjaehne_8u(dst, BUFFER_SIZE_T, magn);
    printf("result = %d \ndst =", result);
    for (i = 0; i < BUFFER_SIZE_T; i++) {
        printf(" %d    ", dst[i]);
    }

    return 0;
}

Output:

result = 0
dst = 25     29     40     50     40     7     10     50     10     29