vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
Functions
impulse_response.cc File Reference

get the impulse response of a b-spline prefilter More...

#include <iostream>
#include <iomanip>
#include <assert.h>
#include <vspline/multithread.h>
#include <vspline/vspline.h>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

get the impulse response of a b-spline prefilter

filter a unit pulse with a b-spline prefilter of a given degree and display the central section of the result

compile with: clang++ -std=c++11 -o impulse_response -O3 -pthread impulse_response.cc

to get the central section with values beyond +/- 0.0042 of a degree 5 b-spline:

impulse_response 5 .0042

producing this output:

long double ir_5[] = { -0.0084918610197410 , +0.0197222540252632 , -0.0458040841925519 , +0.1063780046433000 , -0.2470419274022756 , +0.5733258709616592 , -1.3217294729875093 , +2.8421709220216247 , -1.3217294729875098 , +0.5733258709616593 , -0.2470419274022757 , +0.1063780046433000 , -0.0458040841925519 , +0.0197222540252632 , -0.0084918610197410 , } ;

which, when used as a convolution kernel, will have the same effect on a signal as applying the recursive filter itself, but with lessened precision due to windowing.

Definition in file impulse_response.cc.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 75 of file impulse_response.cc.