edu.mines.jtk.dsp
Class LocalSmoothingFilter

java.lang.Object
  extended by edu.mines.jtk.dsp.LocalSmoothingFilter

public class LocalSmoothingFilter
extends java.lang.Object

Local smoothing of images with tensor filter coefficients. Smoothing is performed by solving a sparse symmetric positive-definite system of equations: (S'S+G'DG)y = S'Sx, where G is a matrix of gradient operators, S is a matrix of smoothing operators, D is a matrix of tensor filter coefficients, x is an input image, and y is an output image.

The smoothing operators S compensate for deficiencies in the gradient operators G. Finite-difference approximations in G break down for high wavenumbers near the Nyquist limit, and the smoothing operator S attenuates those high wavenumbers. Because S'S appears on both left and right sides of the filter equations, a local smoothing filter does nothing for tensor coefficients D = 0.

The sparse system of filter equations is solved iteratively, beginning with y = x. Iterations continue until either the error in the solution y is below a specified threshold or the number of iterations exceeds a specified limit.

For low wavenumbers the output of this filter approximates the solution to an anisotropic inhomogeneous diffusion equation, where the filter input x corresponds to the initial condition at time t = 0 and filter output y corresponds to the solution at some later time t.

Version:
2008.11.16
Author:
Dave Hale, Colorado School of Mines

Constructor Summary
LocalSmoothingFilter()
          Constructs a local smoothing filter with default parameters.
LocalSmoothingFilter(double small, int niter)
          Constructs a local smoothing filter with specified iteration parameters.
 
Method Summary
 void apply(float c, float[] x, float[] y)
          Applies this filter for specified constant scale factor.
 void apply(float c, float[] s, float[] x, float[] y)
          Applies this filter for specified scale factors.
 void apply(Tensors2 d, float[][] x, float[][] y)
          Applies this filter for specified tensor coefficients.
 void apply(Tensors2 d, float c, float[][] x, float[][] y)
          Applies this filter for specified tensor coefficients and scale factor.
 void apply(Tensors2 d, float c, float[][] s, float[][] x, float[][] y)
          Applies this filter for specified tensor coefficients and scale factors.
 void apply(Tensors3 d, float[][][] x, float[][][] y)
          Applies this filter for specified tensor coefficients.
 void apply(Tensors3 d, float c, float[][][] x, float[][][] y)
          Applies this filter for specified tensor coefficients and scale factor.
 void apply(Tensors3 d, float c, float[][][] s, float[][][] x, float[][][] y)
          Applies this filter for specified tensor coefficients and scale factors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalSmoothingFilter

public LocalSmoothingFilter()
Constructs a local smoothing filter with default parameters. The default parameter small is 0.01 and the default maximum number of iterations is 100.


LocalSmoothingFilter

public LocalSmoothingFilter(double small,
                            int niter)
Constructs a local smoothing filter with specified iteration parameters.

Parameters:
small - stop when norm of residuals is less than this factor times the norm of the input array.
niter - stop when number of iterations exceeds this limit.
Method Detail

apply

public void apply(float c,
                  float[] x,
                  float[] y)
Applies this filter for specified constant scale factor. Local smoothing for 1D arrays is a special case that requires no tensors. All tensors are implicitly scalar values equal to one, so that filtering is determined entirely by the specified constant scale factor.

Parameters:
c - constant scale factor.
x - input array.
y - output array.

apply

public void apply(float c,
                  float[] s,
                  float[] x,
                  float[] y)
Applies this filter for specified scale factors. Local smoothing for 1D arrays is a special case that requires no tensors. All tensors are implicitly scalar values equal to one, so that filtering is determined entirely by the specified scale factors.

Parameters:
c - constant scale factor.
s - array of scale factors.
x - input array.
y - output array.

apply

public void apply(Tensors2 d,
                  float[][] x,
                  float[][] y)
Applies this filter for specified tensor coefficients.

Parameters:
d - tensor coefficients.
x - input array.
y - output array.

apply

public void apply(Tensors2 d,
                  float c,
                  float[][] x,
                  float[][] y)
Applies this filter for specified tensor coefficients and scale factor.

Parameters:
d - tensor coefficients.
c - constant scale factor for tensor coefficients.
x - input array.
y - output array.

apply

public void apply(Tensors2 d,
                  float c,
                  float[][] s,
                  float[][] x,
                  float[][] y)
Applies this filter for specified tensor coefficients and scale factors.

Parameters:
d - tensor coefficients.
c - constant scale factor for tensor coefficients.
s - array of scale factors for tensor coefficients.
x - input array.
y - output array.

apply

public void apply(Tensors3 d,
                  float[][][] x,
                  float[][][] y)
Applies this filter for specified tensor coefficients.

Parameters:
d - tensor coefficients.
x - input array.
y - output array.

apply

public void apply(Tensors3 d,
                  float c,
                  float[][][] x,
                  float[][][] y)
Applies this filter for specified tensor coefficients and scale factor.

Parameters:
d - tensor coefficients.
c - constant scale factor for tensor coefficients.
x - input array.
y - output array.

apply

public void apply(Tensors3 d,
                  float c,
                  float[][][] s,
                  float[][][] x,
                  float[][][] y)
Applies this filter for specified tensor coefficients and scale factors.

Parameters:
d - tensor coefficients.
c - constant scale factor for tensor coefficients.
s - array of scale factors for tensor coefficients.
x - input array.
y - output array.