Wavelet Toolbox |
Importing and Exporting Information from the Graphical Interface
The Wavelet 1-D graphical interface tool lets you import information from and export information to disk.
Saving Information to Disk
You can save synthesized signals, coefficients, and decompositions from the Wavelet 1-D tool to the disk, where the information can be manipulated and later reimported into the graphical tool.
Saving Synthesized Signals. You can process a signal in the Wavelet 1-D tool and then save the processed signal to a MAT-file (with extension mat
or other).
For example, load the example analysis: FileExample AnalysisBasic Signalswith db3 at level 5 --> Sum of sines, and perform a compression or de-noising operation on the original signal. When you close the De-noising or Compression window, update the synthesized signal by clicking Yes in the dialog box.
Then, from the Wavelet 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
When the synthesized signal is obtained using any thresholding method except a global one, the saved structure is
whos
Name |
Size |
Bytes |
Class |
synthsig |
1x1000 |
8000 |
double array |
thrParams |
1x5 |
580 |
cell array |
wname |
1x3 |
6 |
char array |
The synthesized signal is given by the variable synthsig
. In addition, the parameters of the de-noising or compression process are given by the wavelet name (wname
) and the level dependent thresholds contained in the thrParams
variable, which is a cell array of length 5 (same as the level of the decomposition).
For i
from 1 to 5, thrParams{i}
contains the lower and upper bounds of the thresholding interval and the threshold value (since interval dependent thresholds are allowed, see the section One-Dimensional Variance Adaptive Thresholding of Wavelet Coefficients).
When the synthesized signal is obtained using a global thresholding method, the saved structure is
Name |
Size |
Bytes |
Class |
synthsig |
1x1000 |
8000 |
double array |
valTHR |
1x1 |
8 |
double array |
wname |
1x3 |
6 |
char array |
where the variable valTHR
contains the global threshold:
Saving Discrete Wavelet Transform Coefficients. The Wavelet 1-D tool lets you save the coefficients of a discrete wavelet transform (DWT) to disk. The toolbox creates a MAT-file in the current directory with a name you choose.
To save the DWT coefficients from the present analysis, use the menu option FileSaveCoefficients.
A dialog box appears that lets you specify a directory and filename for storing the coefficients.
Consider the example analysis:
FileExample AnalysisBasic Signalswith db1 at level 5 --> Cantor curve.
After saving the wavelet coefficients to the file cantor.mat,
load the variables into your workspace:
load cantor whos
Name |
Size |
Bytes |
Class |
coefs |
1x2190 |
17520 |
double array |
longs |
1x7 |
56 |
double array |
thrParams |
0x0 |
0 |
double array |
wname |
1x3 |
6 |
char array |
Variable coefs
contains the discrete wavelet coefficients. More precisely, in the above example coefs
is a 1-by-2190 vector of concatenated coefficients, and longs
is a vector giving the lengths of each component of coefs.
Variable wname
contains the wavelet name and thrParams
is empty since the synthesized signal does not exist.
Saving Decompositions. The Wavelet 1-D tool lets you save the entire set of data from a discrete wavelet analysis to disk. The toolbox creates a MAT-file in the current directory with a name you choose, followed by the extension wa1
(wavelet analysis 1-D).
Open the Wavelet 1-D tool and load the example analysis:
FileExample AnalysisBasic Signalswith db3 at level 5 --> Sum of sines
To save the data from this analysis, use the menu option FileSaveDecomposition.
A dialog box appears that lets you specify a directory and filename for storing the decomposition data. Type the name wdecex1d
.
After saving the decomposition data to the file wdecex1d.wa1
, load the variables into your workspace:
loadwdecex1d.wa1 -mat
whos
Name |
Size |
Bytes |
Class |
coefs |
1x1023 |
8184 |
double array |
data_name |
1x6 |
12 |
char array |
longs |
1x7 |
56 |
double array |
thrParams |
0x0 |
0 |
double array |
wave_name |
1x3 |
6 |
char array |
Note
When saving a synthesized signal, a decomposition or coefficients to a MAT-file, the extension of this file is free. The mat extension is not necessary.
|
Loading Information into the Wavelet 1-D Tool
You can load signals, coefficients, or decompositions into the graphical interface. 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 Wavelet 1-D tool, 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 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 1-D tool.
The workspace variable warma must be a vector.
To load this signal into the Wavelet 1-D tool, use the menu option FileLoadSignal.
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 Discrete Wavelet Transform Coefficients. To load discrete wavelet transform coefficients into the Wavelet 1-D tool, you must first save the appropriate data in a MAT-file, which must contain at least the two variables coefs
and longs
.
Variable coefs
must be a vector of DWT coefficients (concatenated for the various levels), and variable longs
a vector specifying the length of each component of coefs
, as well as the length of the original signal.
After constructing or editing the appropriate data in your workspace, type
Use the FileLoadCoefficients menu option from the Wavelet 1-D tool to load the data into the graphical tool.
A dialog box appears, allowing you to choose the directory and file in which your data reside.
Loading Decompositions. To load discrete wavelet transform decomposition data into the Wavelet 1-D graphical interface, you must first save the appropriate data in a MAT-file (with extension wa1
or other).
The MAT-file contains the following variables.
After constructing or editing the appropriate data in your workspace, type
Use the FileLoadDecomposition menu option from the Wavelet 1-D tool to load the decomposition data into the graphical tool.
A dialog box appears, allowing you to choose the directory and file in which your data reside.
Note
When loading a signal, a decomposition or coefficients from a MAT-file, the extension of this file is free. The mat extension is not necessary.
|
One-Dimensional Analysis Using the Graphical Interface | Two-Dimensional Discrete Wavelet Analysis |
© 1994-2005 The MathWorks, Inc.