Wavelet Toolbox |
Saving Information to Disk
Using specific file formats, the graphical tools let you save synthesized signals or images, as well as one- or two-dimensional wavelet packet decomposition structures. This feature provides flexibility and allows you to combine command line and graphical interface operations.
Saving Synthesized Signals
You can process a signal in the Wavelet Packet 1-D tool, and then save the processed signal to a MAT-file.
For example, load the example analysis:
FileExample Analysisdb1 - depth: 2 - ent: shannon --> sumsin
and perform a compression or de-noising operation on the original signal. When you close the Wavelet Packet 1-D De-noising or Wavelet Packet 1-D Compression window, update the synthesized signal by clicking Yes in the dialog box.
Then, from the Wavelet Packet 1-D tool, select the FileSaveSynthesized Signal menu option.
A dialog box appears allowing you to select a directory and filename for the MAT-file. For this example, choose the name synthsig
.
To load the signal into your workspace, simply type
load synthsig whos
Name |
Size |
Bytes |
Class |
synthsig |
1x1000 |
8000 |
double array |
valTHR |
1x1 |
8 |
double array |
wname |
1x3 |
6 |
char array |
The synthesized signal is given by synthsig
. In addition, the parameters of the de-noising or compression process are given by the wavelet name (wname
) and the global threshold (valTHR)
.
Saving Synthesized Images
You can process an image in the Wavelet Packet 2-D tool, and then save the processed image to a MAT-file (with extension mat
or other).
For example, load the example analysis:
FileExample Analysisdb1 - depth: 1 - ent: shannon --> woman
and perform a compression on the original image. When you close the Wavelet Packet 2-D Compression window, update the synthesized image by clicking Yes in the dialog box that appears.
Then, from the Wavelet 2-D tool, select the FileSaveSynthesized Image menu option.
A dialog box appears allowing you to select a directory and filename for the MAT-file. For this example, choose the name wpsymage
.
To load the image into your workspace, simply type
load wpsymage whos
Name |
Size |
Bytes |
Class |
X |
256x256 |
524288 |
double array |
map |
255x3 |
6120 |
double array |
valTHR |
1x1 |
8 |
double array |
wname |
1x3 |
6 |
char array |
The synthesized image is given by X
. The variable map
contains the associated colormap. In addition, the parameters of the de-noising or compression process are given by the wavelet name (wname
) and the global threshold (valTHR
).
Saving One-Dimensional Decomposition Structures
The Wavelet Packet 1-D tool lets you save an entire wavelet packet decomposition tree and related data to your disk. The toolbox creates a MAT-file in the current directory with a name you choose, followed by the extension wp1
(wavelet packet 1-D).
Open the Wavelet Packet 1-D tool and load the example analysis:
FileExample Analysisdb1 - depth: 2 - ent: shannon --> sumsin
To save the data from this analysis, use the menu option FileSave Decomposition.
A dialog box appears that lets you specify a directory and file name for storing the decomposition data. Type the name wpdecex1d
.
After saving the decomposition data to the file wpdecex1d.wp1
, load the variables into your workspace.
Name |
Size |
Bytes |
Class |
data_name |
1x6 |
12 |
char array |
tree_struct |
1x1 |
11176 |
wptree object |
valTHR |
0x0 |
0 |
double array |
The variable tree_struct
contains the wavelet packet tree structure. The variable data_name
contains the data name and valTHR
contains the global threshold, which is currently empty since the synthesized signal does not exist.
Saving Two-Dimensional Decomposition Structures
The file format, variables, and conventions are exactly the same as in the one-dimensional case except for the extension, which is wp2
(wavelet packet 2-D). The variables saved are the same as with the one-dimensional case, with the addition of the colormap matrix map
:
Name |
Size |
Bytes |
Class |
data_name |
1x5 |
10 |
char array |
map |
255x3 |
6120 |
double array |
tree_struct |
1x1 |
527400 |
wptree object |
valTHR |
1x1 |
8 |
double array |
Save options are also available when performing de-noising or compression inside the Wavelet Packet 1-D and Wavelet Packet 2-D tools.
In the Wavelet Packet De-Noising windows, you can save the de-noised signal or image and the decomposition. The same holds true for the Wavelet Packet Compression windows.
This way, you can save directly many different trials from inside the De-Noising and Compression windows without going back to the main Wavelet Packet windows during a fine-tuning process.
Note
When saving a synthesized signal (1-D), a synthesized image (2-D) or a decomposition to a MAT-file, the extension of this file is free. The mat extension is not necessary.
|
Importing and Exporting from Graphical Tools | Loading Information into the Graphical Tools |
© 1994-2005 The MathWorks, Inc.