plugins.big.bigsnakeutils.process.process1D
Class BSplineBasis

java.lang.Object
  extended by plugins.big.bigsnakeutils.process.process1D.BSplineBasis

public class BSplineBasis
extends java.lang.Object

Implements several basis B-spline basis functions.

Version:
February 7, 2015
Author:
Ricard Delgado-Gonzalo (ricard.delgado@gmail.com), Daniel Schmitter (daniel.schmitter@epfl.ch), Anais Badoual (anais.badoual@gmail.com)

Nested Class Summary
static class BSplineBasis.BSplineBasisType
          Type of B-spline basis functions.
 
Field Summary
static int ASPLINESUPPORT
          Length of the support of the A-spline.
static int CUBICBSPLINESUPPORT
          Length of the support of the cubic B-spline.
static int ESPLINE3SUPPORT
          Length of the support of the exponential B-spline basis function with three roots.
static int ESPLINE4SUPPORT
          Length of the support of the exponential B-spline basis function with four roots.
static int LINEARBSPLINESUPPORT
          Length of the support of the linear B-spline.
static int MSPLINESUPPORT
          Length of the support of the M-spline.
static int QUADRATICBSPLINESUPPORT
          Length of the support of the quadratic B-spline.
 
Constructor Summary
BSplineBasis()
           
 
Method Summary
static double ASpline(double t, double alpha)
          Causal A-Spline.
static double ASplinePrime(double t, double alpha)
          Derivative of causal A-Spline.
static double autocorrelationESpline(int l, double alpha)
          Sampled autocorrelation of the exponential B-spline of order three.
static double autocorrelationESpline3(int l, int M)
          Sampled autocorrelation of the exponential B-spline of order three.
static double[] computeBSplineFilter(int N)
          This function compute the B-Spline Filter B(z).
static double[] computeESplineDerivativeMask(int N, double alphaSub, int M)
          This function compute the derivative mask of a ESpline3
static double[] computeMultinomialCoef(int[] index, int m, int N, double[] h)
          This function compute the multinomial coefficient corresponding of the combination of the ki done by the function multinomial().
static double computePolynomialDerivative(double index, int N)
          This function compute the derivative mask of a B-Spline
static double[] computePolynomialDerivativeMask(int N)
          This function compute the derivative mask of a B-Spline
static double ConstantBSpline(double t)
          Causal constant B-spline.
static double convolutedGreenFunctionESpline(double l, double alpha1, double alpha2, double M1, double M2)
          The Green function corresponding to the convolution of two exponential splines with parameters alpha1 and alpha2 which have been scaled M1 and M2 times respectively.
static double correlationESpline(int l, double alpha)
          Sampled correlation of the exponential B-spline of order three with a filter.
static double correlationMSplineMSplinePrime(int p, int M)
          Sampled correlation of the MSpline with MSplinePrime, i.e.
static double correlationOfTwoESpline(double l, double alpha1, double alpha2, double M1, double M2)
          Correlation function of two exponential B-splines of order three with parameters alpha1 and alpha2 which have been scaled M1 and M2 times respectively.
static double cot(double arg)
          Cotangent.
static double csc(double arg)
          Cosecant.
static double CubicBSpline(double t)
          Causal cubic B-spline.
static double ESpline3_Prime(double t, double alpha)
          Derivative of the causal exponential B-Spline with parameters (0,-j alpha, j alpha).
static double ESpline3_PrimeBis(double t, double alpha, int M)
          Derivative of the causal exponential B-Spline with parameters (0,-j alpha, j alpha) for a alpha which is non constant.
static double ESpline3_PrimePrime(double t, double alpha)
          Second derivative of the causal exponential B-Spline with parameters (0,-j alpha, j alpha).
static double ESpline3(double t, double alpha)
          Causal exponential B-Spline with parameters (0,-j alpha, j alpha).
static double ESpline3Bis(double t, double alpha, int M)
          Causal exponential B-Spline with parameters (0,-j alpha, j alpha) for a alpha which is non constant.
static double ESpline4(double t, double alpha)
          Causal exponential B-Spline with parameters (0, 0,-j alpha, j alpha).
static int factorial(int n)
          This function compute the factorial function
static double Keys_Prime(double t)
          First Derivative of Keys
static double Keys_PrimePrime(double t)
          Second derivative of Keys
static double Keys(double t)
          Causal Keys interpolator.
static double LinearBSpline_Prime(double t)
          Derivative of the linear B-spline.
static double LinearBSpline(double t)
          Causal linear B-spline.
static double[] MaskESpline(int m, int N, double alphaSub)
          Refinement mask of Espline3 for a m scaling parameters: m = dilation factor, N= order of the basis function
static double[] MaskPolynomialSpline(int m, int N)
          Refinement mask of causal B-spline (Quadratic and cubic) for a m scaling parameters: m = dilation factor, N= order of the basis function
static double MSpline_Prime(double t, double alpha)
          Derivative of the causal M-Spline
static double MSpline_PrimePrime(double t, double alpha)
          Second derivative of the causal M-Spline
static double MSpline(double t, double alpha)
          Causal M-Spline.
static int multinomial(int coefMax, int size, int[] index, int it, int m, int N, double[] h)
          This is a recursive function to compute the multinomial coefficient of (x0+x1+...+xm-1)^N The goal of this function is to find every {k0,...,km-1} as k0+...+km-1=N (cf multinomial theorem on Wikipedia for more understanding the formula) parameters : index= array of the ki, size= number f coefficient ki, coefMax= the maximum value that a ki can take, it= the iteration of the recursive function, m= dilation factor, N=order of the spline, h=mask
static double Order5BSpline(double t)
          Causal B-spline of order 5.
static double Order6BSpline(double t)
          Causal B-spline of order 6.
static double Order7BSpline(double t)
          Causal B-spline of order 7.
static double QuadraticSpline(double t)
          Causal quadratic B-spline.
static double sec(double arg)
          Secant.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINEARBSPLINESUPPORT

public static int LINEARBSPLINESUPPORT
Length of the support of the linear B-spline.


QUADRATICBSPLINESUPPORT

public static int QUADRATICBSPLINESUPPORT
Length of the support of the quadratic B-spline.


CUBICBSPLINESUPPORT

public static int CUBICBSPLINESUPPORT
Length of the support of the cubic B-spline.


ESPLINE3SUPPORT

public static int ESPLINE3SUPPORT
Length of the support of the exponential B-spline basis function with three roots.


ESPLINE4SUPPORT

public static int ESPLINE4SUPPORT
Length of the support of the exponential B-spline basis function with four roots.


MSPLINESUPPORT

public static int MSPLINESUPPORT
Length of the support of the M-spline.


ASPLINESUPPORT

public static int ASPLINESUPPORT
Length of the support of the A-spline.

Constructor Detail

BSplineBasis

public BSplineBasis()
Method Detail

ConstantBSpline

public static double ConstantBSpline(double t)
Causal constant B-spline.


LinearBSpline

public static double LinearBSpline(double t)
Causal linear B-spline.


QuadraticSpline

public static double QuadraticSpline(double t)
Causal quadratic B-spline.


MaskPolynomialSpline

public static double[] MaskPolynomialSpline(int m,
                                            int N)
Refinement mask of causal B-spline (Quadratic and cubic) for a m scaling parameters: m = dilation factor, N= order of the basis function


MaskESpline

public static double[] MaskESpline(int m,
                                   int N,
                                   double alphaSub)
Refinement mask of Espline3 for a m scaling parameters: m = dilation factor, N= order of the basis function


CubicBSpline

public static double CubicBSpline(double t)
Causal cubic B-spline.


Order5BSpline

public static double Order5BSpline(double t)
Causal B-spline of order 5.


Order6BSpline

public static double Order6BSpline(double t)
Causal B-spline of order 6.


Order7BSpline

public static double Order7BSpline(double t)
Causal B-spline of order 7.


ESpline3

public static double ESpline3(double t,
                              double alpha)
Causal exponential B-Spline with parameters (0,-j alpha, j alpha).


ESpline3Bis

public static double ESpline3Bis(double t,
                                 double alpha,
                                 int M)
Causal exponential B-Spline with parameters (0,-j alpha, j alpha) for a alpha which is non constant.


ESpline4

public static double ESpline4(double t,
                              double alpha)
Causal exponential B-Spline with parameters (0, 0,-j alpha, j alpha).


Keys

public static double Keys(double t)
Causal Keys interpolator.


MSpline

public static double MSpline(double t,
                             double alpha)
Causal M-Spline.


ASpline

public static double ASpline(double t,
                             double alpha)
Causal A-Spline.


ASplinePrime

public static double ASplinePrime(double t,
                                  double alpha)
Derivative of causal A-Spline.


MSpline_Prime

public static double MSpline_Prime(double t,
                                   double alpha)
Derivative of the causal M-Spline


MSpline_PrimePrime

public static double MSpline_PrimePrime(double t,
                                        double alpha)
Second derivative of the causal M-Spline


Keys_Prime

public static double Keys_Prime(double t)
First Derivative of Keys


Keys_PrimePrime

public static double Keys_PrimePrime(double t)
Second derivative of Keys


csc

public static double csc(double arg)
Cosecant.


sec

public static double sec(double arg)
Secant.


cot

public static double cot(double arg)
Cotangent.


LinearBSpline_Prime

public static double LinearBSpline_Prime(double t)
Derivative of the linear B-spline.


ESpline3_Prime

public static double ESpline3_Prime(double t,
                                    double alpha)
Derivative of the causal exponential B-Spline with parameters (0,-j alpha, j alpha).


ESpline3_PrimeBis

public static double ESpline3_PrimeBis(double t,
                                       double alpha,
                                       int M)
Derivative of the causal exponential B-Spline with parameters (0,-j alpha, j alpha) for a alpha which is non constant.


ESpline3_PrimePrime

public static double ESpline3_PrimePrime(double t,
                                         double alpha)
Second derivative of the causal exponential B-Spline with parameters (0,-j alpha, j alpha).


correlationESpline

public static double correlationESpline(int l,
                                        double alpha)
Sampled correlation of the exponential B-spline of order three with a filter.


correlationMSplineMSplinePrime

public static double correlationMSplineMSplinePrime(int p,
                                                    int M)
Sampled correlation of the MSpline with MSplinePrime, i.e. to compute equation 4.21 in Ricard's thesis. p= k-l are the shifting parameters of the basis and its derivative, M is the number of control points


convolutedGreenFunctionESpline

public static double convolutedGreenFunctionESpline(double l,
                                                    double alpha1,
                                                    double alpha2,
                                                    double M1,
                                                    double M2)
The Green function corresponding to the convolution of two exponential splines with parameters alpha1 and alpha2 which have been scaled M1 and M2 times respectively.


correlationOfTwoESpline

public static double correlationOfTwoESpline(double l,
                                             double alpha1,
                                             double alpha2,
                                             double M1,
                                             double M2)
Correlation function of two exponential B-splines of order three with parameters alpha1 and alpha2 which have been scaled M1 and M2 times respectively. \phi_{\alpha_1}(M1*t) \ast \phi_{\alpha_2}(M2*t)


autocorrelationESpline

public static double autocorrelationESpline(int l,
                                            double alpha)
Sampled autocorrelation of the exponential B-spline of order three.


autocorrelationESpline3

public static double autocorrelationESpline3(int l,
                                             int M)
Sampled autocorrelation of the exponential B-spline of order three. Parameters are the number of control points M and the index of the circulant matrix l


factorial

public static int factorial(int n)
This function compute the factorial function


multinomial

public static int multinomial(int coefMax,
                              int size,
                              int[] index,
                              int it,
                              int m,
                              int N,
                              double[] h)
This is a recursive function to compute the multinomial coefficient of (x0+x1+...+xm-1)^N The goal of this function is to find every {k0,...,km-1} as k0+...+km-1=N (cf multinomial theorem on Wikipedia for more understanding the formula) parameters : index= array of the ki, size= number f coefficient ki, coefMax= the maximum value that a ki can take, it= the iteration of the recursive function, m= dilation factor, N=order of the spline, h=mask


computeMultinomialCoef

public static double[] computeMultinomialCoef(int[] index,
                                              int m,
                                              int N,
                                              double[] h)
This function compute the multinomial coefficient corresponding of the combination of the ki done by the function multinomial().


computeBSplineFilter

public static double[] computeBSplineFilter(int N)
This function compute the B-Spline Filter B(z).


computePolynomialDerivativeMask

public static double[] computePolynomialDerivativeMask(int N)
This function compute the derivative mask of a B-Spline


computeESplineDerivativeMask

public static double[] computeESplineDerivativeMask(int N,
                                                    double alphaSub,
                                                    int M)
This function compute the derivative mask of a ESpline3


computePolynomialDerivative

public static double computePolynomialDerivative(double index,
                                                 int N)
This function compute the derivative mask of a B-Spline