Overview
Calculates the unscaled area under a fourth order polynomial using the rectangular method. The result is the sum of y-values. To get the area, multiply by the rectangle/bin width.
Expressed as a formula, this function calculates
Dispatcher Prototype
void volk_32f_x3_sum_of_poly_32f(float* target, float* src0, float* center_point_array,
float* cutoff, unsigned int num_points)
Inputs
- src0: x values
- center_point_array: polynomial coefficients in order {c1, c2, c3, c4, c0}
- cutoff: the minimum x value to use (will clamp to cutoff if input < cutoff)
- num_points: The number of values in both input vectors.
Outputs
- complexVector: The sum of y values generated by polynomial.
Example The following estimates by using the Taylor expansion centered around ,
int npoints = 4096;
float* input = (
float*)
volk_malloc(
sizeof(
float) * npoints,
coefficients[0] = 4.48168907033806f;
coefficients[1] = coefficients[0] * 0.5f;
coefficients[2] = coefficients[0] * 1.0f/6.0f;
coefficients[3] = coefficients[0] * 1.0f/24.0f;
coefficients[4] = coefficients[0];
*cutoff = -2.0;
*result = 0.0f;
float dx = (float)M_PI/ (float)npoints;
for(unsigned int ii=0; ii < npoints; ++ii){
input[ii] = dx * (float)ii - 1.5f;
}
volk_32f_x3_sum_of_poly_32f(result, input, coefficients, cutoff, npoints);
std::cout << "result is " << *result * (input[1]-input[0]) << std::endl;
size_t volk_get_alignment(void)
Get the machine alignment in bytes.
Definition: volk.tmpl.c:90
__VOLK_DECL_BEGIN VOLK_API void * volk_malloc(size_t size, size_t alignment)
Allocate size bytes of data aligned to alignment.
Definition: volk_malloc.c:38
VOLK_API void volk_free(void *aptr)
Free's memory allocated by volk_malloc.
Definition: volk_malloc.c:80