org.jscience.mathematics.wavelet
Class MatchingPursuit

java.lang.Object
  extended by org.jscience.mathematics.wavelet.BasisFunctionLibrary
      extended by org.jscience.mathematics.wavelet.MatchingPursuit
All Implemented Interfaces:
java.lang.Cloneable

public class MatchingPursuit
extends BasisFunctionLibrary
implements java.lang.Cloneable

A Wavelet (and more) matching pursuit class Uses adaptative Morse coding for better performance. The MatchingPursuit is used to obtain a Time-Frequency representation (TF) through a fast algorithm.


Field Summary
 
Fields inherited from class org.jscience.mathematics.wavelet.BasisFunctionLibrary
DFunction, Fdual, Fprimary
 
Constructor Summary
MatchingPursuit(DiscreteFunction f)
          Constructor
 
Method Summary
 void add(MultiscaleFunction fprimary, MultiscaleFunction fdual)
          DOCUMENT ME!
 java.lang.Object clone()
          DOCUMENT ME!
 void diagnostic(double tol)
          Check the validity of the current matching algorithm.
 double[][] forcedMatch(int pos)
          Force the system to select the given element as the best match.
 double[] getCoefs()
          Recover the matching coefficients.
 int[] getRecord()
          all matches are recorded so one can trace them back
 double[] getRecordedNorms()
          Trace back how much of the norm was taken out at each match.
 double[][] match()
          Does the matching 1 time and return the TF representation.
 double[][] match(int j)
          Does the matching j times and return the TF representation.
 double[][] matchAll(double tol)
          Repeatly match until it remains less than tol 100 percent of the original L2 norm; no matter what, at least one match will be done.
 void setData(DiscreteFunction f)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.mathematics.wavelet.BasisFunctionLibrary
add, add, add, add, checkBiorthogonality, cloneArrayDiscreteFunction, getData, getDual, getMorseThreshold, getPrimary, getResidue, getResidues, getSize, getWeigth, getWeigths, includeFourier, includeMasslessFourier, norm, norm, setMorseThreshold
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchingPursuit

public MatchingPursuit(DiscreteFunction f)
Constructor

Parameters:
f - DOCUMENT ME!
Method Detail

add

public void add(MultiscaleFunction fprimary,
                MultiscaleFunction fdual)
DOCUMENT ME!

Overrides:
add in class BasisFunctionLibrary
Parameters:
fprimary - DOCUMENT ME!
fdual - DOCUMENT ME!

clone

public java.lang.Object clone()
DOCUMENT ME!

Overrides:
clone in class BasisFunctionLibrary
Returns:
DOCUMENT ME!

getRecord

public int[] getRecord()
all matches are recorded so one can trace them back

Returns:
DOCUMENT ME!

getRecordedNorms

public double[] getRecordedNorms()
Trace back how much of the norm was taken out at each match.

Returns:
DOCUMENT ME!

getCoefs

public double[] getCoefs()
Recover the matching coefficients.

Returns:
DOCUMENT ME!

setData

public void setData(DiscreteFunction f)
DOCUMENT ME!

Overrides:
setData in class BasisFunctionLibrary
Parameters:
f - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

diagnostic

public void diagnostic(double tol)
                throws MaximumIterationsExceededException
Check the validity of the current matching algorithm. Will return an exception if the diagnostic fails. This makes sense: the software should stop if the algorithm isn't safely within the given tolerance.

Parameters:
tol - DOCUMENT ME!
Throws:
MaximumIterationsExceededException - if it can't match one of the elements of the dictionnary
java.lang.IllegalArgumentException - if the matching fails

match

public double[][] match()
Does the matching 1 time and return the TF representation. The TF representation may contain negative values and so, taking the absolute value of the result will often be useful.

Returns:
DOCUMENT ME!

matchAll

public double[][] matchAll(double tol)
                    throws MaximumIterationsExceededException
Repeatly match until it remains less than tol 100 percent of the original L2 norm; no matter what, at least one match will be done. It will return the TF representaiton. The TF representation may contain negative values and so, taking the absolute value of the result will often be useful.

Parameters:
tol - percentile of energy
Returns:
DOCUMENT ME!
Throws:
MaximumIterationsExceededException - if the number of required match exceeds 5 times the size of the dictionnary (it should be a more than confortable margin unless the problem is ill-posed, change the dictionnary if it doesn't work)
java.lang.IllegalArgumentException - if tol is not within the interval [0,1]

forcedMatch

public double[][] forcedMatch(int pos)
Force the system to select the given element as the best match. It will return the TF representaiton. The TF representation may contain negative values and so, taking the absolute value of the result will often be useful.

Parameters:
pos - DOCUMENT ME!
Returns:
DOCUMENT ME!

match

public double[][] match(int j)
Does the matching j times and return the TF representation. The TF representation may contain negative values and so, taking the absolute value of the result will often be useful.

Parameters:
j - of iterations
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - if j is not positive