public abstract class LiftingSchemeBaseWavelet
extends java.lang.Object
class LiftingSchemeBaseWavelet: base class for simple Lifting Scheme wavelets using split, predict, update or update, predict, merge steps.
Simple lifting scheme wavelets consist of three steps, a split/merge step, predict step and an update step:
The split step divides the elements in an array so that the even elements are in the first half and the odd elements are in the second half.
The merge step is the inverse of the split step. It takes two regions of an array, an odd region and an even region and merges them into a new region where an even element alternates with an odd element.
The predict step calculates the difference between an odd element and its predicted value based on the even elements. The difference between the predicted value and the actual value replaces the odd element.
The predict step operates on the odd elements. The update step operates on the even element, replacing them with a difference between the predict value and the actual odd element. The update step replaces each even element with an average. The result of the update step becomes the input to the next recursive step in the wavelet calculation.
The split and merge methods are shared by all Lifting Scheme wavelet algorithms. This base class provides the transform and inverse transform methods (forwardTrans and inverseTrans). The predict and update methods are abstract and are defined for a particular Lifting Scheme wavelet sub-class.
References:
You may use this source code without limitation and without fee as long as you include:
This software was written and is copyrighted by Ian Kaplan, Bear Products International, www.bearcave.com, 2001.
This software is provided "as is", without any warrenty or claim as to its usefulness. Anyone who uses this source code uses it at their own risk. Nor is any support provided by Ian Kaplan and Bear Products International.
Please send any bug fixes or suggested source changes to:
iank@bearcave.com
Constructor and Description |
---|
LiftingSchemeBaseWavelet() |
Modifier and Type | Method and Description |
---|---|
void |
forwardTrans(float[] vec)
Simple wavelet Lifting Scheme forward transform
|
void |
inverseTrans(float[] vec)
Default two step Lifting Scheme inverse wavelet transform
|
public void forwardTrans(float[] vec)
Simple wavelet Lifting Scheme forward transform
forwardTrans is passed an array of doubles. The array size must be a power of two. Lifting Scheme wavelet transforms are calculated in-place and the result is returned in the argument array.
The result of forwardTrans is a set of wavelet coefficients ordered by increasing frequency and an approximate average of the input data set in vec[0]. The coefficient bands follow this element in powers of two (e.g., 1, 2, 4, 8...).
vec
- the vectorpublic void inverseTrans(float[] vec)
Default two step Lifting Scheme inverse wavelet transform
inverseTrans is passed the result of an ordered wavelet transform, consisting of an average and a set of wavelet coefficients. The inverse transform is calculated in-place and the result is returned in the argument array.
vec
- the vector