Wavelet Toolbox Previous page   Next Page
dwtmode

Discrete wavelet transform extension mode

Syntax

ST = dwtmode

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

'mode'
DWT Extension Mode
'sym' or 'symh'
Symmetric-padding (half-point): boundary value symmetric replication - default mode
'symw'
Symmetric-padding (whole-point): boundary value symmetric replication
'asym' or 'asymh'
Antisymmetric-padding (half-point): boundary value antisymmetric replication
'asymw'
Antisymmetric-padding (whole-point): boundary value antisymmetric replication
'zpd'
Zero-padding
'spd' or 'sp1'
Smooth-padding of order 1 (first derivative interpolation at the edges)
'sp0'
Smooth-padding of order 0 (constant extension at the edges)
'ppd'
Periodic-padding (periodic extension at the edges)

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

See Also

idwt, idwt2, dwt, dwt2, wextend

References

Strang, G.; T. Nguyen (1996), Wavelets and filter banks, Wellesley- Cambridge Press.


Previous page  dwt2 dyaddown Next page

© 1994-2005 The MathWorks, Inc.