Wavelet Toolbox |
Example 3: 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
M-file and at a two-dimensional example in the ex2_wvt
M-file located in the toolbox/wavelet/wavedemo
directory. 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).
Example 2: Building a Right Wavelet Tree Object (RWVTREE) | Example 4: Building a Wavelet Tree Object (EDWTTREE) |
© 1994-2005 The MathWorks, Inc.