Documentation Center

  • Trial Software
  • Product Updates

Advanced Use of Objects

The following sections explain how to extend the toolbox with new objects through four examples.

Building a Wavelet Tree Object (WTREE)

This example creates a new class of objects: WTREE.

Starting from the class DTREE and overloading the methods split and merge, we define a wavelet tree class.

To plot a WTREE, the DTREE plot method is used.

You can have a look at a one-dimensional example in the ex1_wt file and at a two-dimensional example in the ex2_wt file located in the toolbox/wavelet/wavedemo folder. These examples can be used directly, but they are also useful to learn how to build new object-oriented programming functions.

The definition of the new class is described below.

Class WTREE (parent class: DTREE)

Fields

dtree

Parent object

dwtMode

DWT extension mode

wavInfo

Structure (wavelet information)

wavInfo Structure information

wavName

Wavelet Name

Lo_D

Low Decomposition filter

Hi_D

High Decomposition filter

Lo_R

Low Reconstruction filter

Hi_R

High Reconstruction filter

Methods

wtree

Constructor for the class WTREE.

merge

Merge (recompose) the data of a node.

split

Split (decompose) the data of a terminal node.

Building a Right Wavelet Tree Object (RWVTREE)

This example creates a new class of objects: RWVTREE.

We define a right wavelet tree class starting from the class WTREE and overloading the methods split, merge, and plot (inherited from DTREE).

The plot method shows how to add Node Labels.

You can have a look at a one-dimensional example in the ex1_rwvt file and at a two-dimensional example in the ex2_rwvt file located in the toolbox/wavelet/wavedemo folder. These programs can be used directly, but they are also useful to learn how to build new object-oriented programming functions.

The definition of the new class is described below.

Class RWVTREE (parent class: WTREE)

Fields

dummy

Not used

wtree

Parent object

Methods

rwvtree

Constructor for the class RWVTREE.

merge

Merge (recompose) the data of a node.

plot

Plot RWVTREE object.

split

Split (decompose) the data of a terminal node.

Running This Example

The following figure is obtained using the example ex1_rwvt and clicking the node 14.

The approximations are labeled in yellow and the details are labeled in red. The last nodes cannot be split.

Building a Wavelet Tree Object (WVTREE)

This example creates a new class of objects: WVTREE.

We define a wavelet tree class starting from the class WTREE and overloading the methods get, plot, and recons (all inherited from DTREE).

The split and merge methods of the class WTREE are used.

The plot method shows how to add Node Labels and Node Actions.

You can have a look at a one-dimensional example in the ex1_wvt file and at a two-dimensional example in the ex2_wvt file located in the toolbox/wavelet/wavedemo folder. These programs can be used directly, but they are also useful to learn how to build new object-oriented programming functions.

The definition of the new class is described below.

Class WVTREE (parent class: WTREE)

Fields

dummy

Not used

wtree

Parent object

Methods

wvtree

Constructor for the class WVTREE.

get

Get WVTREE object field contents.

plot

Plot WVTREE object.

recons

Reconstruct node coefficients.

Running This Example

The following figure is obtained using the example ex2_wvt and clicking the node 2.

The approximations are labeled in yellow and the details are labeled in red. The last nodes cannot be split. The title of the figure contains the DWT extension mode used ('sym' in the present example).

Building a Wavelet Tree Object (EDWTTREE)

This example creates a new class of objects: EDWTTREE.

We define an ε-DWT tree class starting from the class DTREE and overloading the methods merge, plot, recons, and split.

For more information on the ε-DWT, see the section -Decimated DWT.

The plot method shows how to add Node Labels, Node Actions, and Tree Actions.

You can have a look at the example in the ex1_edwt file located in the toolbox/wavelet/wavedemo folder. This program can be used directly, but it is also useful to learn how to build new object-oriented programming functions.

The definition of the new class is described below.

Class EDWTTREE (parent class: DTREE)

Fields

dtree

Parent object

dwtMode

DWT extension mode

wavInfo

Structure (wavelet information)

Fields Description

wavInfo

wavName

Wavelet Name

Lo_D

Low Decomposition filter

Hi_D

High Decomposition filter

Lo_R

Low Reconstruction filter

Hi_R

High Reconstruction filter

Methods

edwttree

Constructor for the class EDWTTREE.

merge

Merge (recompose) the data of a node.

plot

Plot EDWTTREE object.

recons

Reconstruct node coefficients.

split

Split (decompose) the data of a terminal node.

Running This Example

The following figure is obtained using the example ex1_edwt, selecting the De-noise option in the Tree Action menu and clicking the node 0.

The approximations are labeled in yellow and the details are labeled in red. The last nodes cannot be split.

The title of the figure contains the DWT extension mode used ('sym' in the present example) and the name of the de-noising method.

Was this topic helpful?