Discrete wavelet transform extension mode


st = dwtmode
st = dwtmode('status')
st = dwtmode('status','nodisp')



dwtmode(mode) sets the signal or image extension mode for both discrete wavelet and wavelet packet transforms to 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.

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.

st = dwtmode or st = dwtmode('status') display and return the current mode in st.

st = dwtmode('status','nodisp') returns the current mode st and no status or warning text is displayed in the MATLAB command window.

dwtmode('save',mode) saves 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 default mode in the next MATLAB session.

dwtmode('save') is equivalent to dwtmode('save',CURRENTMODE), where CURRENTMODE represents the current extension mode.


collapse all

Clear the DWT extension mode global variable, and display the current DWT signal extension mode. If the DWT extension mode global variable does not exist, the default is half-point symmetrization.

clear global
**  DWT Extension Mode: Symmetrization (half-point)  **

Change the extension mode to periodized extension.

!  WARNING: Change DWT Extension Mode  !
**  DWT Extension Mode: Periodization  **

Display the current DWT signal extension mode.

**  DWT Extension Mode: Periodization  **

Input Arguments

collapse all

DWT extension mode used to extend the input, specified as one of the following values.


DWT Extension Mode


Zero extension


Smooth extension of order 0

'spd' (or 'sp1')

Smooth extension of order 1

'sym' or 'symh'

Symmetric extension (half point): boundary value symmetric replication


Symmetric extension (whole point): boundary value symmetric replication

'asym' or 'asymh'

Antisymmetric extension (half point): boundary value antisymmetric replication


Antisymmetric extension (whole point): boundary value antisymmetric replication


Periodized extension (1)


Periodized extension (2)

If the signal length is odd, wextend adds to the right an extra sample that is equal to the last value, and performs the extension using the 'ppd' mode. Otherwise, 'per' reduces to 'ppd'. This rule also applies to images.

The DWT associated with the symmetric, smooth, zero, and periodic extension modes are slightly redundant. But the inverse DWT ensures a perfect reconstruction for the extensions mentioned.


dwtmode updates a global variable. Only use dwtmode to change the extension mode. Avoid changing the global variable directly.

Output Arguments

collapse all

DWT extension mode, returned as a character array.


  • 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.

See Also



Introduced before R2006a