| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Wavelet Toolbox |
| Contents | Index |
Dealing with Border Distortion
Classically, the DWT is defined for sequences with length of some power of 2, and different ways of extending samples of other sizes are needed. Methods for extending the signal include zero-padding, smooth padding, periodic extension, and boundary value replication (symmetrization).
The basic algorithm for the DWT is not limited to dyadic length and is based on a simple scheme: convolution and downsampling. As usual, when a convolution is performed on finite-length signals, border distortions arise.
Signal Extensions: Zero-Padding, Symmetrization,
and Smooth Padding
To deal with border distortions, the border should be treated differently from the other parts of the signal.
Various methods are available to deal with this problem, referred to as "wavelets on the interval" (see [CohDJV93] in References). These interesting constructions are effective in theory but are not entirely satisfactory from a practical viewpoint.
Often it is preferable to use simple schemes based on signal extension on the boundaries. This involves the computation of a few extra coefficients at each stage of the decomposition process to get a perfect reconstruction. It should be noted that extension is needed at each stage of the decomposition process.
Details on the rationale of these schemes are in Chapter 8 of the book Wavelets and Filter Banks, by Strang and Nguyen (see [StrN96] in References).
The available signal extension modes are as follows (see dwtmode):
It is the default mode of the wavelet transform in the toolbox.
Symmetrization has the disadvantage of artificially creating discontinuities of the first derivative at the border, but this method works well in general for images.
The disadvantage of periodic padding is that discontinuities are artificially created at the border.
The DWT associated with these five modes is slightly redundant. But IDWT ensures a perfect reconstruction for any of the five previous modes whatever the extension mode used for DWT.
This last mode produces the smallest length wavelet decomposition. But the extension mode used for IDWT must be the same to ensure a perfect reconstruction.
Before looking at an illustrative example, let us compare some properties of the theoretical Discrete Wavelet Transform versus the actual DWT.
The theoretical DWT is applied to signals that are defined on an infinite length time interval (Z). For an orthogonal wavelet, this transform has the following desirable properties:
Since the DWT is applied to signals that are defined on a finite-length time interval, extension is needed for the decomposition, and truncation is necessary for reconstruction.
To ensure the crucial property 3 (perfect reconstruction) for arbitrary choices of
the properties 1 and 2 can be lost. These properties hold true for an extended signal of length usually larger than the length of the original signal. So only the perfect reconstruction property is always preserved. Nevertheless if the DWT is performed using the periodic extension mode ('per') and if the length of the signal is divisible by 2J, where J is the maximum level decomposition, the properties 1, 2, and 3 remain true.
It is interesting to notice that if arbitrary extension is used, and decomposition performed using the convolution-downsampling scheme, perfect reconstruction is recovered using idwt or idwt2. This point is illustrated below.
% Set initial signal and get filters. x = sin(0.3*[1:451]); w = 'db9'; [Lo_D,Hi_D,Lo_R,Hi_R] = wfilters(w); % In fact using a slightly redundant scheme, any signal % extension strategy works well. % For example use random padding.lx = length(x); lf = length(Lo_D); randn('seed',654); ex = [randn(1,lf) x randn(1,lf)]; axis([1 lx+2*lf -2 3]) subplot(211), plot(lf+1:lf+lx,x), title('Original signal') axis([1 lx+2*lf -2 3]) subplot(212), plot(ex), title('Extended signal') axis([1 lx+2*lf -2 3]) % Decomposition. la = floor((lx+lf-1)/2); ar = wkeep(dyaddown(conv(ex,Lo_D)),la); dr = wkeep(dyaddown(conv(ex,Hi_D)),la); % Reconstruction. xr = idwt(ar,dr,w,lx); % Check perfect reconstruction. err0 = max(abs(x-xr)) err0 = 3.0464e-11
Now let us illustrate the differences between the first three methods both for 1-D and 2-D signals.
Using the GUI we will examine the effects of zero-padding.
9
with db2 at level 5 > Two nearby discontinuities.
9
with db2 at level 5 --> Two nearby discontinuities.
Let us now consider an image example.
Now we set the extension mode to zero-padding and perform a decomposition of the image to level 3 using the sym4 wavelet. Then we reconstruct the approximation of level 3.
Now we set the extension mode to symmetric extension and perform a decomposition of the image again to level 3 using the sym4 wavelet. Then we reconstruct the approximation of level 3.
Now set the extension mode to smooth padding and perform a decomposition of the image again to level 3 using the sym4 wavelet. Then reconstruct the approximation of level 3.
| Provide feedback about this page |
![]() | Fast Wavelet Transform (FWT) Algorithm | Discrete Stationary Wavelet Transform (SWT) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |