Skip to content
Rafat Hussain edited this page Jan 30, 2016 · 1 revision

Wavelet Tree Decomposition ( wtree ) and Functions

wtree Initialization

wtree_object wtree_init(wave,N,J);
// wave - Wavelet object created using wave_object
// N - Length of Signal/Time Series
// J - Decomposition Levels


wtree Execution

wtree(wt, inp); // Wavelet Tree Decomposition
// obj - wtree object
// inp – Input signal/ Time series of length N



wtree Object Parameters

wave_object wave; // wavelet object
int siglength;// Length of the original signal.
int outlength;// Length of the output DWT vector
int J; // Number of decomposition Levels
int MaxIter;// Maximum Iterations J <= MaxIter
char ext[10];// Type of Extension used - "per" or "sym". 
int *coeflength;// Size J+1 Vector containing lengths of Coefficients at each level. All coefficients at each level have the same length. The first value is the length of the signal (siglength). The last value is the length at the Jth level of decomposition.
double *output; // WTREE Output Vector of size outlength



wtree Functions

setWTREEExtension(wtree_object wtree, char *extension);// Options "per" and "sym"
int getWTREENodelength(wtree_object wt, int X);// Returns the length of the coefficients node at the level X of decomposition. 0 < X <= J. All coefficents at each level have the same length. 
void getWTREECoeffs(wtree_object wt, int X, int Y, double *coeffs, int N);// The function return coefficents coeffs at the node {X,Y} of length N [obtained from getWTREElength(wt,X)] at level X.  0 < X <= J.  0 < Y < 2**J
wtree_summary(wtree_object wt);// Print summary
wtree_free(wtree_object object);// Frees wt object


Full Wavelet Tree decomposition is a highly redundant transformation and retains coefficients at every decomposition node. Following functions are useful in extracting coefficients.

  1. wtree_summary : prints out how each node is stored in the output vector and how you can access it. This is a print to screen command and is not recommended to be used in applications where speed is the primary concern.

  2. getWTREENodelength & getWTREECoeffs : will give you a.) the length of the nodes at each level and b.) the node coefficients.

wt->output stores node coefficents beginning with Jth level from left to right. For a two level decomposition, as shown in the figure, the coefficients are stored as -

[{2,0} {2,1} {2,2} {2,3} {1,0} {1,1}]