Rate This Document
Findability
Accuracy
Completeness
Readability

Goertz

Computes the discrete Fourier transform for a given frequency for a single signal.

The function interface declaration is as follows:

Operations on floating point numbers:

HmppResult HMPPS_Goertz_32f(const float *src, int32_t len, Hmpp32fc *res, float freq)

HmppResult HMPPS_Goertz_64f(const double *src, int32_t len, Hmpp64fc *res, double freq);

HmppResult HMPPS_Goertz_32fc(const Hmpp32fc *src, int32_t len, Hmpp32fc *res, float freq);

HmppResult HMPPS_Goertz_64fc(const Hmpp64fc *src, int32_t len, Hmpp64fc *res, double freq);

Parameters

Parameter

Description

Value Range

Input/Output

src

Pointer to the source vector

The value cannot be NULL.

Input

len

Length of the source vector

(0,INT_MAX]

Input

res

Pointer to the output value

The value cannot be NULL.

Output

freq

Fourier transform frequency

[0.0, 1.0)

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 src or res is NULL.

HMPP_STS_SIZE_ERR

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

HMPP_STS_REL_FREQ_ERR

The value of freq is not in the range of [0.0, 1.0)

Example

void Goertz_Example(void)
{
    float src[7] = {1, 2, 3, 4, 5, 6, 7};
    Hmpp32fc res;
    int32_t i;

    HmppResult result = HMPPS_Goertz_32f(src, 7, &res, 1.0 / 7);
    printf("re = %f, im = %f\n", res.re, res.im);
}

Output:

re = -3.499998, im = 7.267825