vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
|
using a b-spline with integer coefficients More...
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
using a b-spline with integer coefficients
vspline can use integral data types as b-spline coefficients, but doing so naively will produce imprecise results. This example demonstrates how to do it right. What needs to be done is using 'boosted', or amplified, coefficients, so that the range of possible coefficients is 'spread out' to the range of the integral coefficient type. After evaluation, the 'raw' result value has to be attenuated back to the range of original values.
You can pass the 'boost' factor on the command line to see how different values influence precision of the results. You'll also notice that, when passing too high 'boost' values, the results will turn wrong due to the int coefficients overflowing.
Prefiltering will create a signal with higher peak values, so the maximal boost factor has to be chosen to take this into account, see 'max_boost' below.
Definition in file int_spline.cc.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 95 of file int_spline.cc.