Wavelet Toolbox |
Example 2: drawtree and readtree
load noisbump x = noisbump; t = wpdec(x,3,'db2'); fig = drawtree(t); % The last command creates a GUI. % The same GUI can be obtained using the main menu and: % - clicking the Wavelet Packet 1-D button, % - loading the signal noisbump, % - choosing the level and the wavelet % - clicking the decomposition button. % You get the following figure. % From the GUI, you can modify the tree. % For example, change Node label from Depth_Position to Index, % change Node Action from Visualize to Split_Merge and % merge the node 2. % You get the following figure. % From the command line, you can get the new tree. newt = readtree(fig); % From the command line you can modify the new tree; % then plot it in the same figure. newt = wpjoin(newt,3); drawtree(newt,fig);
You can mix previous commands. The GUI associated with the plot
command is simpler and quicker, but more actions and information are available using the full GUI tools related to wavelet packets.
The methods associated with WPTREE objects let you do more complicated actions.
Namely, using read
and write
methods, you can change terminal node coefficients.
Let's illustrate this point with the following "funny" example.
Example 1: plot and wpviewcf | Example 3: A Funny One |
© 1994-2005 The MathWorks, Inc.