Documentation Center

  • Trial Software
  • Product Updates

dwtmode

Discrete wavelet transform extension mode

Syntax

ST = dwtmode
ST = dwtmode('status')
dwtmode('mode')

Description

dwtmode 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 Border Effects , in 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 folder) is used.

dwtmode('save',MODE) saves MODE as the new default mode in the file DWTMODE.DEF (in the current folder). If a file with the same name already exists in the current folder, 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.

References

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

See Also

| | | |

Was this topic helpful?