Wavelet Toolbox    

Discrete wavelet transform extension mode


ST = dwtmode


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':

DWT Extension Mode
Symmetric-padding (boundary value symmetric replication - default mode)
'spd' or 'sp1'
Smooth-padding of order 1 (first derivative interpolation at the edges)
Smooth-padding of order 0 (constant extension at the edges)
Periodic-padding (periodic extension at the edges)

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.


See Also
idwt, idwt2, dwt, dwt2, wextend

  dwt2 dyaddown