public abstract class AnWTFilter extends Object implements WaveletFilter
All analysis wavelet filters should follow the following conventions:
 The first sample to filter is the lowpass one. As a consequence, if the input signal is of oddlength then the lowpass output signal is one sample longer than the highpass output one. Therefore, if the length of input signal is N, the lowpass output signal is of length N/2 if N is even and N/2+1/2 if N is odd, while the highpass output signal is of length N/2 if N is even and N/21/2 if N is odd.
 The normalization is 1 for the DC gain and 2 for the Nyquist gain (Type I normalization), for both reversible and nonreversible filters.
If the length of input signal is N, the lowpass output signal is of length N/2 if N is even and N/2+1/2 if N is odd, while the highpass output sample is of length N/2 if N is even and N/21/2 if N is odd.
The analyze method may seem very complicated, but is designed to minimize the amount of data copying and redundant calculations when used for blockbased or linebased wavelet transform implementations, while being applicable to fullframe transforms as well.
All filters should implement the equals() method of the Object class. The call x.equals(y) should test if the 'x' and 'y' filters are the same or not, in what concerns the bit stream header syntax (two filters are the same if the same filter code should be output to the bit stream).
AnWTFilterInt
,
AnWTFilterFloat
Modifier and Type  Field and Description 

static char 
OPT_PREFIX
The prefix for wavelet filter options: 'F'

private static String[][] 
pinfo
The list of parameters that is accepted for wavelet filters.

WT_FILTER_FLOAT_CONVOL, WT_FILTER_FLOAT_LIFT, WT_FILTER_INT_LIFT
Constructor and Description 

AnWTFilter() 
Modifier and Type  Method and Description 

abstract void 
analyze_hpf(Object inSig,
int inOff,
int inLen,
int inStep,
Object lowSig,
int lowOff,
int lowStep,
Object highSig,
int highOff,
int highStep)
Filters the input signal by this analysis filter, decomposing
it in a lowpass and a highpass signal.

abstract void 
analyze_lpf(Object inSig,
int inOff,
int inLen,
int inStep,
Object lowSig,
int lowOff,
int lowStep,
Object highSig,
int highOff,
int highStep)
Filters the input signal by this analysis filter, decomposing
it in a lowpass and a highpass signal.

abstract int 
getFilterType()
Returns the type of filter used according to the FilterTypes
interface.

abstract float[] 
getHPSynthesisFilter()
Returns the timereversed highpass synthesis waveform of the
filter, which is the highpass filter.

float[] 
getHPSynWaveForm(float[] in,
float[] out)
Returns the equivalent highpass synthesis waveform of a
cascade of filters, given the syhthesis waveform of the
previous stage.

abstract float[] 
getLPSynthesisFilter()
Returns the timereversed lowpass synthesis waveform of the
filter, which is the lowpass filter.

float[] 
getLPSynWaveForm(float[] in,
float[] out)
Returns the equivalent lowpass synthesis waveform of a cascade
of filters, given the syhthesis waveform of the previous
stage.

static String[][] 
getParameterInfo()
Returns the parameters that are used in this class and
implementing classes.

private static float[] 
upsampleAndConvolve(float[] in,
float[] wf,
float[] out)
Returns the signal resulting of upsampling (by 2) the input
signal 'in' and then convolving it with the timereversed
signal 'wf'.

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnHighNegSupport, getAnHighPosSupport, getAnLowNegSupport, getAnLowPosSupport, getDataType, getImplType, getSynHighNegSupport, getSynHighPosSupport, getSynLowNegSupport, getSynLowPosSupport, isReversible, isSameAsFullWT
public static final char OPT_PREFIX
private static final String[][] pinfo
public abstract void analyze_lpf(Object inSig, int inOff, int inLen, int inStep, Object lowSig, int lowOff, int lowStep, Object highSig, int highOff, int highStep)
The input signal resides in the inSig array. The index of the first sample to filter (i.e. that will generate the first lowpass output sample) is given by inOff. The number of samples to filter is given by inLen. This array must be of the same type as the one for which the particular implementation works with (which is returned by the getDataType() method).
The input signal can be interleaved with other signals in the same inSig array, and this is determined by the inStep argument. This means that the first sample of the input signal is inSig[inOff], the second is inSig[inOff+inStep], the third is inSig[inOff+2*inStep], and so on. Therefore if inStep is 1 there is no interleaving. This feature allows to filter columns of a 2D signal, when it is stored in a line by line order in inSig, without having to copy the data, in this case the inStep argument should be the line width.
This method also allows to apply the analysis wavelet filter by parts in the input signal using an overlap and thus producing the same coefficients at the output. The tailOvrlp argument specifies how many samples in the input signal, before the first one to be filtered, can be used for overlap. Then, the filter instead of extending the input signal will use those samples to calculate the first output samples. The argument tailOvrlp can be 0 for no overlap, or some value that provides partial or full overlap. There should be enough samples in the input signal, before the first sample to be filtered, to support the overlap. The headOvrlp provides the same functionality but at the end of the input signal. The inStep argument also applies to samples used for overlap. This overlap feature can be used for linebased wavelet transforms (in which case it will only be used when filtering the columns) or for overlapping blockbased wavelet transforms (in which case it will be used when filtering lines and columns).
The lowpass output signal is placed in the lowSig array. The lowOff and lowStep arguments are analogous to the inOff and inStep ones, but they apply to the lowSig array. The lowSig array must be long enough to hold the lowpass output signal.
The highpass output signal is placed in the highSig array. The highOff and highStep arguments are analogous to the inOff and inStep ones, but they apply to the highSig array. The highSig array must be long enough to hold the highpass output signal.
inSig
 This is the array that contains the input
signal. It must be of the correct type (e.g., it must be int[]
if getDataType() returns TYPE_INT).inOff
 This is the index in inSig of the first sample to
filter.inLen
 This is the number of samples in the input signal
to filter.inStep
 This is the step, or interleave factor, of the
input signal samples in the inSig array. See above.lowSig
 This is the array where the lowpass output
signal is placed. It must be of the same type as inSig and it
should be long enough to contain the output signal.lowOff
 This is the index in lowSig of the element where
to put the first lowpass output sample.lowStep
 This is the step, or interleave factor, of the
lowpass output samples in the lowSig array. See above.highSig
 This is the array where the highpass output
signal is placed. It must be of the same type as inSig and it
should be long enough to contain the output signal.highOff
 This is the index in highSig of the element where
to put the first highpass output sample.highStep
 This is the step, or interleave factor, of the
highpass output samples in the highSig array. See above.WaveletFilter.getDataType()
public abstract void analyze_hpf(Object inSig, int inOff, int inLen, int inStep, Object lowSig, int lowOff, int lowStep, Object highSig, int highOff, int highStep)
The input signal resides in the inSig array. The index of the first sample to filter (i.e. that will generate the first highpass output sample) is given by inOff. The number of samples to filter is given by inLen. This array must be of the same type as the one for which the particular implementation works with (which is returned by the getDataType() method).
The input signal can be interleaved with other signals in the same inSig array, and this is determined by the inStep argument. This means that the first sample of the input signal is inSig[inOff], the second is inSig[inOff+inStep], the third is inSig[inOff+2*inStep], and so on. Therefore if inStep is 1 there is no interleaving. This feature allows to filter columns of a 2D signal, when it is stored in a line by line order in inSig, without having to copy the data, in this case the inStep argument should be the line width.
The lowpass output signal is placed in the lowSig array. The lowOff and lowStep arguments are analogous to the inOff and inStep ones, but they apply to the lowSig array. The lowSig array must be long enough to hold the lowpass output signal.
The highpass output signal is placed in the highSig array. The highOff and highStep arguments are analogous to the inOff and inStep ones, but they apply to the highSig array. The highSig array must be long enough to hold the highpass output signal.
inSig
 This is the array that contains the input
signal. It must be of the correct type (e.g., it must be int[]
if getDataType() returns TYPE_INT).inOff
 This is the index in inSig of the first sample to
filter.inLen
 This is the number of samples in the input signal
to filter.inStep
 This is the step, or interleave factor, of the
input signal samples in the inSig array. See above.lowSig
 This is the array where the lowpass output
signal is placed. It must be of the same type as inSig and it
should be long enough to contain the output signal.lowOff
 This is the index in lowSig of the element where
to put the first lowpass output sample.lowStep
 This is the step, or interleave factor, of the
lowpass output samples in the lowSig array. See above.highSig
 This is the array where the highpass output
signal is placed. It must be of the same type as inSig and it
should be long enough to contain the output signal.highOff
 This is the index in highSig of the element where
to put the first highpass output sample.highStep
 This is the step, or interleave factor, of the
highpass output samples in the highSig array. See above.WaveletFilter.getDataType()
public abstract float[] getLPSynthesisFilter()
The returned array may not be modified (i.e. a reference to the internal array may be returned by the implementation of this method).
public abstract float[] getHPSynthesisFilter()
The returned array may not be modified (i.e. a reference to the internal array may be returned by the implementation of this method).
public float[] getLPSynWaveForm(float[] in, float[] out)
The length of the lowpass synthesis filter is getSynLowNegSupport()+getSynLowPosSupport().
in
 The synthesis waveform of the previous stage.out
 If nonnull this array is used to store the
resulting signal. It must be long enough, or an
IndexOutOfBoundsException is thrown.WaveletFilter.getSynLowNegSupport()
,
WaveletFilter.getSynLowPosSupport()
public float[] getHPSynWaveForm(float[] in, float[] out)
The length of the highpass synthesis filter is getSynHighNegSupport()+getSynHighPosSupport().
in
 The synthesis waveform of the previous stage.out
 If nonnull this array is used to store the
resulting signal. It must be long enough, or an
IndexOutOfBoundsException is thrown.WaveletFilter.getSynHighNegSupport()
,
WaveletFilter.getSynHighPosSupport()
private static float[] upsampleAndConvolve(float[] in, float[] wf, float[] out)
The 'wf' signal has to be already timereversed, therefore only a dotproduct is performed (instead of a convolution). This is equivalent to convolving with the nontimereversed 'wf' signal.
in
 The signal to upsample and filter. If null it is
considered to be a dirac.wf
 The timereversed impulse response used for
filtering.out
 If nonnull this array is used to store the
resulting signal, it must be of length in.length*2+wf.length2
at least. An IndexOutOfBoundsException is thrown if this is not
the case.public abstract int getFilterType()
FilterTypes
public static String[][] getParameterInfo()
Copyright © 2015 Open Microscopy Environment