Why do the values of the length of DWT2 coefficients for different modes (as specified in the help) differ from the actual formula?

3 views (last 30 days)
The length of the coefficient obtained from DWT2 is sx/2 for the dwtmode value 'sym' and it is (sx+If-1)/2 for the rest of the modes. In the help for this function, instead of 'sym' it is specified for the mode 'per', though in the Wavelet Toolbox, the formula for length of the coefficient is correctly implemeted. The actual formula is given in the book: Wavelets and Filter Banks by Gilbert Strang/Truong Nguyen, chapter 8.2.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This enhancement has been incorporated in Release 2008b (R2008b). For previous product releases, read below for any possible workarounds:
This is an error in the documentation. In the help page for the function DWT2, the following is stated:
Let sx = size(X) and lf = the length of filters; then size(cA) = size(cH) = size(cV) = size(cD) = sa
where sa = ceil(sx/2), if the DWT extension mode is set to periodization. For the other extension modes, sa = floor((sx+lf-1)/2).
It should actully read as:
Let sx = size(X) and lf = the length of filters; then size(cA) = size(cH) = size(cV) = size(cD) = sa
where sa = ceil(sx/2), if the DWT extension mode is set to symmetric padding . For the other extension modes, sa = floor((sx+lf-1)/2).
Note: The difference is, in the DWT Extension mode should be specified as a "symmetric padding".

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!