denoise
Class Convolver

java.lang.Object
  extended by denoise.Convolver

public class Convolver
extends java.lang.Object


Field Summary
protected static int MIRROR
           
protected static int PERIODIC
           
 
Constructor Summary
protected Convolver(int boundaryConditions)
          Constructor of the class Convolver.
 
Method Summary
protected  void convolveFIR(double[] signal, double[] kernel, int origin)
          Convolution with a Finite Impulse Response (FIR) filter.
protected  void convolveIIR(double[] signal, double[] poles)
          Convolve with with an Infinite Impluse Response filter (IIR)
protected  void convolveIIR2(double[] signal, double b1, double b2)
          Convolve a 1D signal with a Infinite Impluse Response 2nd order (IIR2) Note: Only with the mirror (on bounds) boundary conditions.
protected  int getBoundaryConditions()
          Get the boundary conditions.
protected  double getTolerance()
          Get the tolerance.
protected  void setBoundaryConditions(int boundaryConditions)
          Set the boundary conditions.
protected  void setTolerance(int tolerance)
          Set the tolerance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIRROR

protected static final int MIRROR
See Also:
Constant Field Values

PERIODIC

protected static final int PERIODIC
See Also:
Constant Field Values
Constructor Detail

Convolver

protected Convolver(int boundaryConditions)
Constructor of the class Convolver.

Parameters:
boundaryConditions - Boundary Conditions
Method Detail

setBoundaryConditions

protected void setBoundaryConditions(int boundaryConditions)
Set the boundary conditions.

Parameters:
boundaryConditions - Boundary Conditions

getBoundaryConditions

protected int getBoundaryConditions()
Get the boundary conditions.


setTolerance

protected void setTolerance(int tolerance)
Set the tolerance.

Parameters:
tolerance - Tolearance value

getTolerance

protected double getTolerance()
Get the tolerance.


convolveFIR

protected void convolveFIR(double[] signal,
                           double[] kernel,
                           int origin)
Convolution with a Finite Impulse Response (FIR) filter. Note: Only with the periodic boundary conditions.

Parameters:
signal - 1D input signal, 1D output signal at the end (in-place)
kernel - kernel of the filter
origin - origin

convolveIIR

protected void convolveIIR(double[] signal,
                           double[] poles)
Convolve with with an Infinite Impluse Response filter (IIR)

Parameters:
signal - 1D input signal, 1D output signal at the end (in-place)
poles - 1D array containing the poles of the filter

convolveIIR2

protected void convolveIIR2(double[] signal,
                            double b1,
                            double b2)
Convolve a 1D signal with a Infinite Impluse Response 2nd order (IIR2) Note: Only with the mirror (on bounds) boundary conditions. Purpose: Recursive implementation of a symmetric 2nd order filter with mirror symmetry boundary conditions : 1 1 H[z] = --------------- * --------------- (1-b1*z-b2*z^2) (1-b1/z-b2/z^2) implemented in the following form: a1+a2*z a1+a2/z H[z] = --------------- + --------------- - a1 (1-b1*z+b2*z^2) (1-b1/z+b2/z^2) where : a1 = -(b2 + 1.0) * (1 - b1 + b2) / ((b2 - 1.0) * (1 + b1 + b2)); a2 = - a1 * b2 * b1 / (b2 + 1.0);

Parameters:
signal - 1D input signal, 1D output signal at the end (in-place)
b1 - first pole of the filter
b2 - second pole of the filter