edu.mines.jtk.dsp
Class MinimumPhaseFilter

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

public class MinimumPhaseFilter
extends java.lang.Object

A minimum-phase filter is a causal stable filter with a causal stable inverse. The filter and its inverse also have corresponding transposes which are like the filter and inverse applied in the reverse direction.

Minimum-phase filters are generalized to multi-dimensional arrays as in Claerbout, J., 1998, Multidimensional recursive filters via a helix: Geophysics, v. 63, n. 5, p. 1532-1541.

Filter constructors do not ensure that specified lags and coefficients correspond to minimum-phase filters. If not minimum-phase, then the causal inverse and inverse-transpose filters are unstable.

Minimum-phase filters may be obtained through Wilson-Burg factorization of specified auto-correlations.

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

Constructor Summary
MinimumPhaseFilter(int[] lag1)
          Constructs a unit-impulse filter for specified lag1.
MinimumPhaseFilter(int[] lag1, float[] a)
          Constructs a minimum-phase filter for specified lag1.
MinimumPhaseFilter(int[] lag1, int[] lag2)
          Constructs a unit-impulse filter for specified lag1 and lag2.
MinimumPhaseFilter(int[] lag1, int[] lag2, float[] a)
          Constructs a minimum-phase filter for specified lag1 and lag2.
MinimumPhaseFilter(int[] lag1, int[] lag2, float[][] a)
          Constructs indexed minimum-phase filters for specified lag1 and lag2.
MinimumPhaseFilter(int[] lag1, int[] lag2, int[] lag3)
          Constructs a unit-impulse filter for specified lag1, lag2, and lag3.
MinimumPhaseFilter(int[] lag1, int[] lag2, int[] lag3, float[] a)
          Constructs a minimum-phase filter for specified lag1, lag2, and lag3.
 
Method Summary
 void apply(float[][][] x, float[][][] y)
          Applies this filter.
 void apply(float[][] x, float[][] y)
          Applies this filter.
 void apply(float[] x, float[] y)
          Applies this filter.
 void apply(int[][] i, float[][] x, float[][] y)
          Applies this indexed filter.
 void applyInverse(float[][][] x, float[][][] y)
          Applies the inverse of this filter.
 void applyInverse(float[][] x, float[][] y)
          Applies the inverse of this filter.
 void applyInverse(float[] x, float[] y)
          Applies the inverse of this filter.
 void applyInverse(int[][] i, float[][] x, float[][] y)
          Applies the inverse of this indexed filter.
 void applyInverseTranspose(float[][][] x, float[][][] y)
          Applies the inverse transpose of this filter.
 void applyInverseTranspose(float[][] x, float[][] y)
          Applies the inverse transpose of this filter.
 void applyInverseTranspose(float[] x, float[] y)
          Applies the inverse transpose of this filter.
 void applyInverseTranspose(int[][] i, float[][] x, float[][] y)
          Applies the inverse transpose of this indexed filter.
 void applyTranspose(float[][][] x, float[][][] y)
          Applies the transpose of this filter.
 void applyTranspose(float[][] x, float[][] y)
          Applies the transpose of this filter.
 void applyTranspose(float[] x, float[] y)
          Applies the transpose of this filter.
 void applyTranspose(int[][] i, float[][] x, float[][] y)
          Applies the transpose of this indexed filter.
 void factorWilsonBurg(int maxiter, float epsilon, float[] r)
          Wilson-Burg factorization for the specified 1-D auto-correlation.
 void factorWilsonBurg(int maxiter, float epsilon, float[][] r)
          Wilson-Burg factorization for the specified 2-D auto-correlation.
 void factorWilsonBurg(int maxiter, float epsilon, float[][][] r)
          Wilson-Burg factorization for the specified 3-D auto-correlation.
 float[] getA()
          Gets a copy of the filter coefficients.
 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

MinimumPhaseFilter

public MinimumPhaseFilter(int[] lag1)
Constructs a unit-impulse 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.

MinimumPhaseFilter

public MinimumPhaseFilter(int[] lag1,
                          int[] lag2)
Constructs a unit-impulse 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.

MinimumPhaseFilter

public MinimumPhaseFilter(int[] lag1,
                          int[] lag2,
                          int[] lag3)
Constructs a unit-impulse 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.

MinimumPhaseFilter

public MinimumPhaseFilter(int[] lag1,
                          float[] a)
Constructs a minimum-phase 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.
a - array of filter coefficients for each lag.

MinimumPhaseFilter

public MinimumPhaseFilter(int[] lag1,
                          int[] lag2,
                          float[] a)
Constructs a minimum-phase 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.
a - array of filter coefficients for each lag.

MinimumPhaseFilter

public MinimumPhaseFilter(int[] lag1,
                          int[] lag2,
                          float[][] a)
Constructs indexed minimum-phase filters 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.
a - array of filter coefficients for each index and lag.

MinimumPhaseFilter

public MinimumPhaseFilter(int[] lag1,
                          int[] lag2,
                          int[] lag3,
                          float[] a)
Constructs a minimum-phase 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.
a - array of filter coefficients for each lag.
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.

getA

public float[] getA()
Gets a copy of the filter coefficients.

Returns:
array of filter coefficients; by copy, not by reference.

factorWilsonBurg

public void factorWilsonBurg(int maxiter,
                             float epsilon,
                             float[] r)
Wilson-Burg factorization for the specified 1-D auto-correlation. Modifies this filter using the iterative Wilson-Burg algorithm. If this algorithm converges, the impulse response of this filter cascaded with its transpose approximates the specified auto-correlation.

Parameters:
maxiter - maximum number of Wilson-Burg iterations.
epsilon - tolerance for convergence. Iterations have converged when the change in all filter coefficients is less than this factor times the square root of the zero-lag of the auto correlation.
r - the auto-correlation. This 1-D array must have odd length. The middle array element is the zero-lag of the auto-correlation, and other elements are symmetric about the middle element.
Throws:
java.lang.IllegalStateException - if Wilson-Burg iterations do not converge within the specified maximum number of iterations.

factorWilsonBurg

public void factorWilsonBurg(int maxiter,
                             float epsilon,
                             float[][] r)
Wilson-Burg factorization for the specified 2-D auto-correlation. Modifies this filter using the iterative Wilson-Burg algorithm. If this algorithm converges, the impulse response of this filter cascaded with its transpose approximates the specified auto-correlation.

Parameters:
maxiter - maximum number of Wilson-Burg iterations.
epsilon - tolerance for convergence. Iterations have converged when the change in all filter coefficients is less than this factor times the square root of the zero-lag of the auto correlation.
r - the auto-correlation. This 2-D array must have odd lengths. The middle array element is the zero-lag of the auto-correlation, and other elements are symmetric about the middle element.
Throws:
java.lang.IllegalStateException - if Wilson-Burg iterations do not converge within the specified maximum number of iterations.

factorWilsonBurg

public void factorWilsonBurg(int maxiter,
                             float epsilon,
                             float[][][] r)
Wilson-Burg factorization for the specified 3-D auto-correlation. Modifies this filter using the iterative Wilson-Burg algorithm. If this algorithm converges, the impulse response of this filter cascaded with its transpose approximates the specified auto-correlation.

Parameters:
maxiter - maximum number of Wilson-Burg iterations.
epsilon - tolerance for convergence. Iterations have converged when the change in all filter coefficients is less than this factor times the square root of the zero-lag of the auto correlation.
r - the auto-correlation. This 3-D array must have odd lengths. The middle array element is the zero-lag of the auto-correlation, and other elements are symmetric about the middle element.
Throws:
java.lang.IllegalStateException - if Wilson-Burg iterations do not converge within the specified maximum number of iterations.

apply

public void apply(float[] x,
                  float[] y)
Applies this filter.

Parameters:
x - input array.
y - output array.

apply

public void apply(float[][] x,
                  float[][] y)
Applies this filter.

Parameters:
x - input array.
y - output array.

apply

public void apply(float[][][] x,
                  float[][][] y)
Applies this filter.

Parameters:
x - input array.
y - output array.

apply

public void apply(int[][] i,
                  float[][] x,
                  float[][] y)
Applies this indexed filter.

Parameters:
i - index array.
x - input array.
y - output array.

applyTranspose

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

Parameters:
x - input array.
y - output array.

applyTranspose

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

Parameters:
x - input array.
y - output array.

applyTranspose

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

Parameters:
x - input array.
y - output array.

applyTranspose

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

Parameters:
i - index array.
x - input array.
y - output array.

applyInverse

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

Parameters:
x - input array.
y - output array.

applyInverse

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

Parameters:
x - input array.
y - output array.

applyInverse

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

Parameters:
x - input array.
y - output array.

applyInverse

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

Parameters:
i - index array.
x - input array.
y - output array.

applyInverseTranspose

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

Parameters:
x - input array.
y - output array.

applyInverseTranspose

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

Parameters:
x - input array.
y - output array.

applyInverseTranspose

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

Parameters:
x - input array.
y - output array.

applyInverseTranspose

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

Parameters:
i - index array.
x - input array.
y - output array.