Discrete wavelet transform extension mode
dwtmode( sets the signal or
image extension mode for both discrete wavelet and wavelet packet transforms to
mode)mode. All functions and Wavelet Analyzer app tools
involving either the discrete wavelet transform (1-D and 2-D) or wavelet packet
transform (1-D and 2-D), use the specified DWT extension mode.
The extension modes provide options for dealing with the problem of border distortion in signal or image analysis. For more information, see Border Effects.
Note
Functions involving the discrete wavelet transform may not use the
current extension mode for gpuArray input. Such cases
are documented on the function reference page.
dwtmode or dwtmode('status') display
the current mode. If DWTMODE.DEF exists in the current path,
the default mode is loaded from DWTMODE.DEF at the start of
the MATLAB® session. Otherwise, the file DWTMODE.CFG is
used.
or
st = dwtmode display and
return the current mode in st = dwtmode('status')st.
returns the current mode st = dwtmode('status','nodisp')st and no status or warning text
is displayed in the MATLAB command window.
dwtmode('save', saves
mode)mode as the new default mode to the file
DWTMODE.DEF in the current folder. If
DWTMODE.DEF already exists in the current folder, the
file is overwritten. The new default mode will be active as the default mode in
the next MATLAB session.
Note
To execute in parallel any functionality that depends on the extension
mode, either save the extension mode using
dwtmode('save',mode) before running your
parfor loop, or call
dwtmode(mode) inside your
parfor loop.
Changing the extension mode in a MATLAB session does not have the desired effect if anything
dependent on that mode is called in parallel. In a parallel environment,
each worker has its own MATLAB execution engine, and each worker respects the
DWTMODE.CFG file, but not an override in the
current session. Therefore, to run in parallel, the extension mode must
either be saved to the current folder, or the extension mode must be set
for each worker.
Executing for-loop iterations in parallel requires
Parallel Computing Toolbox™. For more information, see parfor (Parallel Computing Toolbox).
dwtmode('save') is equivalent to
dwtmode('save',CURRENTMODE), where
CURRENTMODE represents the current extension mode.
For most wavelet applications, either a periodic extension or symmetric extension works fine.
[1] Strang, G., and T. Nguyen. Wavelets and Filter Banks. Wellesley, MA: Wellesley-Cambridge Press, 1996.