Rate This Document
Findability
Accuracy
Completeness
Readability

WinBartlett

Multiplies a specified vector by a Bartlett windowing function. The formula is as follows:

The function interface declaration is as follows:

  • Common data operations:

    HmppResult HMPPS_WinBartlett_16s(const int16_t *src, int16_t *dst, int32_t len);

    HmppResult HMPPS_WinBartlett_32f(const float* src, float* dst, int32_t len);

    HmppResult HMPPS_WinBartlett_64f(const double* src, double* dst, int32_t len);

    HmppResult HMPPS_WinBartlett_16sc(const Hmpp16sc* src, Hmpp16sc* dst, int32_t len);

    HmppResult HMPPS_WinBartlett_32fc(const Hmpp32fc* src, Hmpp32fc* dst, int32_t len);

    HmppResult HMPPS_WinBartlett_64fc(const Hmpp64fc* src, Hmpp64fc* dst, int32_t len);

  • In-place operations on data:

    HmppResult HMPPS_WinBartlett_16s_I(int16_t* srcDst, int32_t len);

    HmppResult HMPPS_WinBartlett_32f_I(float* srcDst, int32_t len);

    HmppResult HMPPS_WinBartlett_64f_I(double* srcDst, int32_t len);

    HmppResult HMPPS_WinBartlett_16sc_I(Hmpp16sc* srcDst, int32_t len);

    HmppResult HMPPS_WinBartlett_32fc_I(Hmpp32fc* srcDst, int32_t len);

    HmppResult HMPPS_WinBartlett_64fc_I(Hmpp64fc* srcDst, int32_t len);

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

src

Pointer to the source vector sequence

The value cannot be NULL.

Input

srcDst

Pointer to the source and destination vectors for in-place operations

The value cannot be NULL.

Input/Output

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 3.

Example

#define BUFFER_SIZE_T 10

int WinBartlettExample()
{
    int32_t i;
    int16_t dst[BUFFER_SIZE_T] = {0};
    int16_t src[BUFFER_SIZE_T] = {0, 25863, 20143, -32768, -4362, 10220, -22644, 13540, -29236, 187};
    HmppResult result = HMPPS_WinBartlett_16s(src, dst, BUFFER_SIZE_T);
    printf("result = %d \ndst =", result);
    for (i = 0; i < BUFFER_SIZE_T; i++) {
        printf(" %d  ", dst[i]);
    }
    return 0;
}

Output:

result = 0
dst = 0  5747  8952  -21845  -3877  9084  -15096  6018  -6497  0