Wavelet Toolbox |
Loading Information into the Graphical Tools
You can load signals, images, or one- and two-dimensional wavelet packet decompositions into the graphical interface tools. The information you load may have been previously exported from the graphical interface, and then manipulated in the workspace, or it may have been information you generated initially from the command line.
In either case, you must observe the strict file formats and data structures used by the graphical tools, or else errors will result when you try to load information.
Loading Signals
To load a signal you've constructed in your MATLAB workspace into the Wavelet Packet 1-D tool, save the signal in a MAT-file (with extension mat
or other).
For instance, suppose you've designed a signal called warma
and want to analyze it in the Wavelet Packet 1-D tool.
The workspace variable warma
must be a vector.
To load this signal into the Wavelet Packet 1-D tool, use the menu option FileLoad Signal.
A dialog box appears that lets you select the appropriate MAT-file to be loaded.
Note The first one-dimensional variable encountered in the file is considered the signal. Variables are inspected in alphabetical order. |
Loading Images
This toolbox supports only indexed images. An indexed image is a matrix containing only integers from 1 to n
, where n
is the number of colors in the image.
This image may optionally be accompanied by a n
-by-3 matrix called map
. This is the colormap associated with the image. When MATLAB displays such an image, it uses the values of the matrix to look up the desired color in this colormap. If the colormap is not given, the Wavelet Packet 2-D graphical tool uses a monotonic colormap with max(max(X))-min(min(X))+1
colors.
To load an image you've constructed in your MATLAB workspace into the Wavelet Packet 2-D tool, save the image (and optionally, the variable map
) in a MAT-file (with extension mat
or other).
For instance, suppose you've created an image called brain
and want to analyze it in the Wavelet Packet 2-D tool. Type
To load this image into the Wavelet Packet 2-D tool, use the menu option FileLoad Image.
A dialog box appears that lets you select the appropriate MAT-file to be loaded.
Note
The first two-dimensional variable encountered in the file (except the variable map , which is reserved for the colormap) is considered the image. Variables are inspected in alphabetical order.
|
n
. The computations will be correct since they act directly on the matrix, but the display of the image will be strange. The values less than 1 will be evaluated as 1, the values greater than n
will be evaluated as n
, and a real value within the interval [1,n]
will be evaluated as the closest integer.
Note that the coefficients, approximations, and details produced by wavelet packets decomposition are not indexed image matrices. To display these images in a suitable way, the Wavelet Packet 2-D tool follows these rules:
map
. The same holds for the result of the reconstruction of selected nodes.
map
applied to a rescaled version of the matrices.
Loading Wavelet Packet Decomposition Structures
You can load one- and two-dimensional wavelet packet decompositions into the graphical tools providing you have previously saved the decomposition data in a MAT-file of the appropriate format.
While it is possible to edit data originally created using the graphical tools and then exported, you must be careful about doing so. Wavelet packet data structures are complex, and the graphical tools do not do any consistency checking. This can lead to errors if you try to load improperly formatted data.
One-dimensional data file contains the following variables:
These variables must be saved in a MAT-file (with extension wp1
or other).
Two-dimensional data file contains the following variables:
These variables must be saved in a MAT-file (with extension wp2
or other).
To load the properly formatted data, use the menu option FileLoad Decomposition Structure from the appropriate tool, and then select the desired MAT-file from the dialog box that appears.
The Wavelet Packet 1-D or 2-D graphical tool then automatically updates its display to show the new analysis.
Note
When loading a signal (1-D), an image (2-D), or a decomposition (1-D or 2-D) from a MAT-file, the extension of this file is free. The mat extension is not necessary.
|
Saving Information to Disk | Advanced Concepts |
© 1994-2005 The MathWorks, Inc.