edu.mines.jtk.dsp
Class LocalCausalFilter

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

public class LocalCausalFilter
extends java.lang.Object

A multi-dimensional causal filter with locally variable coefficients. The output samples of a causal filter depend only on present and past input samples. In two dimensions, causal filters are also called non-symmetric half-plane (NSHP) filters, and this notion of causal can be extended to higher dimensions.

Local causal filters have coefficients that may vary from one output sample to the next. Such a filter is not shift invariant. Its application is not equivalent to convolution with its impulse response.

Though not shift-invariant, a local causal filter is a linear operator with a corresponding anti-causal transpose (adjoint) operator. A local causal filter may have a causal inverse, and its transpose may have an anti-causal inverse.

A local causal filter is a stable all-zero filter that may or may not be minimum-phase; that is, it may or may not have a causal stable inverse. That inverse is a recursive all-pole filter, as described by Claerbout, J., 1998, Multidimensional recursive filters via a helix: Geophysics, v. 63, n. 5, p. 1532-1541.

The filter and its transpose and inverse may all be applied in-place; that is, the input and output arrays may be the same array. However, the inverse-transpose filter cannot be applied in-place.

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

Nested Class Summary
static interface LocalCausalFilter.A1
          Interface for filter coefficients indexed in 1 dimension.
static interface LocalCausalFilter.A2
          Interface for filter coefficients indexed in 2 dimensions.
static interface LocalCausalFilter.A3
          Interface for filter coefficients indexed in 3 dimensions.
 
Constructor Summary
LocalCausalFilter(int[] lag1)
          Constructs a local causal filter for specified lag1.
LocalCausalFilter(int[] lag1, int[] lag2)
          Constructs a local causal filter for specified lag1 and lag2.
LocalCausalFilter(int[] lag1, int[] lag2, int[] lag3)
          Constructs a local causal filter for specified lag1, lag2, and lag3.
 
Method Summary
 void apply(LocalCausalFilter.A1 a1, float[] x, float[] y)
          Applies this filter.
 void apply(LocalCausalFilter.A2 a2, float[][] x, float[][] y)
          Applies this filter.
 void apply(LocalCausalFilter.A3 a3, float[][][] x, float[][][] y)
          Applies this filter.
 void applyInverse(LocalCausalFilter.A1 a1, float[] y, float[] x)
          Applies the inverse of this filter.
 void applyInverse(LocalCausalFilter.A2 a2, float[][] y, float[][] x)
          Applies the inverse of this filter.
 void applyInverse(LocalCausalFilter.A3 a3, float[][][] y, float[][][] x)
          Applies the inverse of this filter.
 void applyInverseTranspose(LocalCausalFilter.A1 a1, float[] y, float[] x)
          Applies the inverse transpose of this filter.
 void applyInverseTranspose(LocalCausalFilter.A2 a2, float[][] y, float[][] x)
          Applies the inverse transpose of this filter.
 void applyInverseTranspose(LocalCausalFilter.A3 a3, float[][][] y, float[][][] x)
          Applies the inverse transpose of this filter.
 void applyTranspose(LocalCausalFilter.A1 a1, float[] x, float[] y)
          Applies the transpose of this filter.
 void applyTranspose(LocalCausalFilter.A2 a2, float[][] x, float[][] y)
          Applies the transpose of this filter.
 void applyTranspose(LocalCausalFilter.A3 a3, float[][][] x, float[][][] y)
          Applies the transpose of this filter.
 int[] getLag1()
          Gets a copy of the lags in the 1st dimension.
 int[] getLag2()
          Gets a copy of the lags in the 2nd dimension.
 int[] getLag3()
          Gets a copy of the lags in the 3rd dimension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalCausalFilter

public LocalCausalFilter(int[] lag1)
Constructs a local causal filter for specified lag1. By default, all lag2 and lag3 are assumed to be zero.

For j=0 only, lag1[j] is zero. All lag1[j] must be non-negative.

Parameters:
lag1 - array of lags.

LocalCausalFilter

public LocalCausalFilter(int[] lag1,
                         int[] lag2)
Constructs a local causal filter for specified lag1 and lag2. By default, all lag3 are assumed to be zero.

For j=0 only, lag1[j] and lag2[j] are zero. All lag2[j] must be non-negative. If lag2[j] is zero, then lag1[j] must be non-negative.

Parameters:
lag1 - array of lags in 1st dimension.
lag2 - array of lags in 2nd dimension.

LocalCausalFilter

public LocalCausalFilter(int[] lag1,
                         int[] lag2,
                         int[] lag3)
Constructs a local causal filter for specified lag1, lag2, and lag3.

For j=0 only, lag1[j] and lag2[j] and lag3[j] are zero. All lag3[j] must be non-negative. If lag3[j] is zero, then lag2[j] must be non-negative. If lag3[j] and lag2[j] are zero, then lag1[j] must be non-negative.

Parameters:
lag1 - array of lags in 1st dimension.
lag2 - array of lags in 2nd dimension.
lag3 - array of lags in 3rd dimension.
Method Detail

getLag1

public int[] getLag1()
Gets a copy of the lags in the 1st dimension.

Returns:
array of lags; by copy, not by reference.

getLag2

public int[] getLag2()
Gets a copy of the lags in the 2nd dimension.

Returns:
array of lags; by copy, not by reference.

getLag3

public int[] getLag3()
Gets a copy of the lags in the 3rd dimension.

Returns:
array of lags; by copy, not by reference.

apply

public void apply(LocalCausalFilter.A1 a1,
                  float[] x,
                  float[] y)
Applies this filter. Uses lag1; ignores lag2 or lag3, if specified.

May be applied in-place; input and output arrays may be the same.

Parameters:
a1 - filter coefficients.
x - input array.
y - output array.

applyTranspose

public void applyTranspose(LocalCausalFilter.A1 a1,
                           float[] x,
                           float[] y)
Applies the transpose of this filter. Uses lag1; ignores lag2 or lag3, if specified.

May be applied in-place; input and output arrays may be the same.

Parameters:
a1 - filter coefficients.
x - input array.
y - output array.

applyInverse

public void applyInverse(LocalCausalFilter.A1 a1,
                         float[] y,
                         float[] x)
Applies the inverse of this filter. Uses lag1; ignores lag2 or lag3, if specified.

May be applied in-place; input and output arrays may be the same.

Parameters:
a1 - filter coefficients.
y - input array.
x - output array.

applyInverseTranspose

public void applyInverseTranspose(LocalCausalFilter.A1 a1,
                                  float[] y,
                                  float[] x)
Applies the inverse transpose of this filter. Uses lag1; ignores lag2 or lag3, if specified.

The inverse transpose cannot be applied in-place; input and output arrays cannot be the same array.

Parameters:
a1 - filter coefficients.
y - input array.
x - output array.

apply

public void apply(LocalCausalFilter.A2 a2,
                  float[][] x,
                  float[][] y)
Applies this filter. Uses lag1 and lag2; ignores lag3, if specified.

May be applied in-place; input and output arrays may be the same.

Parameters:
a2 - filter coefficients.
x - input array.
y - output array.

applyTranspose

public void applyTranspose(LocalCausalFilter.A2 a2,
                           float[][] x,
                           float[][] y)
Applies the transpose of this filter. Uses lag1 and lag2; ignores lag3, if specified.

May be applied in-place; input and output arrays may be the same.

Parameters:
a2 - filter coefficients.
x - input array.
y - output array.

applyInverse

public void applyInverse(LocalCausalFilter.A2 a2,
                         float[][] y,
                         float[][] x)
Applies the inverse of this filter. Uses lag1 and lag2; ignores lag3, if specified.

May be applied in-place; input and output arrays may be the same.

Parameters:
a2 - filter coefficients.
y - input array.
x - output array.

applyInverseTranspose

public void applyInverseTranspose(LocalCausalFilter.A2 a2,
                                  float[][] y,
                                  float[][] x)
Applies the inverse transpose of this filter. Uses lag1 and lag2; ignores lag3, if specified.

The inverse transpose cannot be applied in-place; input and output arrays cannot be the same array.

Parameters:
a2 - filter coefficients.
y - input array.
x - output array.

apply

public void apply(LocalCausalFilter.A3 a3,
                  float[][][] x,
                  float[][][] y)
Applies this filter. Uses lag1, lag2, and lag3.

May be applied in-place; input and output arrays may be the same.

Parameters:
a3 - filter coefficients.
x - input array.
y - output array.

applyTranspose

public void applyTranspose(LocalCausalFilter.A3 a3,
                           float[][][] x,
                           float[][][] y)
Applies the transpose of this filter. Uses lag1, lag2, and lag3.

May be applied in-place; input and output arrays may be the same.

Parameters:
a3 - filter coefficients.
x - input array.
y - output array.

applyInverse

public void applyInverse(LocalCausalFilter.A3 a3,
                         float[][][] y,
                         float[][][] x)
Applies the inverse of this filter. Uses lag1, lag2, and lag3.

May be applied in-place; input and output arrays may be the same.

Parameters:
a3 - filter coefficients.
y - output array.
x - input array.

applyInverseTranspose

public void applyInverseTranspose(LocalCausalFilter.A3 a3,
                                  float[][][] y,
                                  float[][][] x)
Applies the inverse transpose of this filter. Uses lag1, lag2, and lag3.

The inverse transpose cannot be applied in-place; input and output arrays cannot be the same array.

Parameters:
a3 - filter coefficients.
y - output array.
x - input array.