Wavelet Toolbox |
Discrete wavelet transform extension mode
Syntax
Description
The dwtmode
command sets the signal or image extension mode for discrete wavelet and wavelet packet transforms. The extension modes represent different ways of handling the problem of border distortion in signal and image analysis. For more information, see the section "Dealing with Border Distortion" in Chapter 6, "Advanced Concepts", of the User's Guide.
dwtmode
or dwtmode('status')
display the current mode.
ST = dwtmode
or ST = dwtmode('status')
display and returns in ST the current mode.
ST = dwtmode('status','nodisp')
returns in ST the current mode and no text (status or warning) is displayed in the MATLAB command window.
dwtmode('mode
') sets the DWT extension mode according to the value of 'mode
':
For more information on symmetric extension modes see "References".
The DWT associated with these five modes is slightly redundant. But, the IDWT ensures a perfect reconstruction for any of the five previous modes whatever is the extension mode used for DWT.
dwtmode('per
') sets the DWT mode to periodization.
This mode produces the smallest length wavelet decomposition. But, the extension mode used for IDWT must be the same to ensure a perfect reconstruction.
Using this mode, dwt
and dwt2
produce the same results as the obsolete functions dwtper
and dwtper2
, respectively.
All functions and GUI tools involving the DWT (1-D & 2-D) or Wavelet Packet transform (1-D & 2-D) use the specified DWT extension mode.
dwtmode updates a global variable allowing the use of these six signal extensions. The extension mode should only be changed using this function. Avoid changing the global variable directly.
The default mode is loaded from the file DWTMODE.DEF (in the current path) if it exists. If not, the file DWTMODE.CFG (in the toolbox/wavelet/wavelet
directory) is used.
dwtmode('save
',MODE) saves MODE as the new default mode in the file DWTMODE.DEF (in the current directory). If a file with the same name already exists in the current directory, it is deleted before saving.
dwtmode('save
') is equivalent to dwtmode('save
',CURRENTMODE).
In these last two cases, the new default mode saved in the file DWTMODE.DEF will be active as default mode in the next MATLAB session.
Examples
% If the DWT extension mode global variable does not % exist, default is Symmetrization. clear global dwtmode ****************************************** ** DWT Extension Mode: Symmetrization ** ****************************************** % Display current DWT signal extension mode. dwtmode ****************************************** ** DWT Extension Mode: Symmetrization ** ****************************************** % Change to Periodization extension mode. dwtmode('per') !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! WARNING: Change DWT Extension Mode ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ***************************************** ** DWT Extension Mode: Periodization ** ***************************************** % Display current DWT signal extension mode. dwtmode ***************************************** ** DWT Extension Mode: Periodization ** *****************************************
Note
You should change the extension mode only by using dwtmode . Avoid changing the global variable directly.
|
See Also
idwt
, idwt2
, dwt
, dwt2
, wextend
References
Strang, G.; T. Nguyen (1996), Wavelets and filter banks, Wellesley- Cambridge Press.
dwt2 | dyaddown |
© 1994-2005 The MathWorks, Inc.