bpmnr/nr_sinc.c

Go to the documentation of this file.
00001 
00006 #include "bpm_nr.h"
00007 
00008 double sinc( double x ) {
00009   if ( fabs(x) < 1.e-11 ) return 1.0;
00010   return sin(PI*x)/(PI*x);
00011 }
00012 
00013 double lanczos( double x, int a ) {
00014   if ( x ==  0.0 ) return 1.0;
00015   if ( x <= (double) -a || x >= (double) a ) return 0.0;
00016   return sinc(x) * sinc( x / (double) a );
00017 }

Generated on Thu Jan 10 10:18:04 2008 for libbpm by  doxygen 1.5.1