| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Wavelet Toolbox |
| Contents | Index |
Multilevel 2-D wavelet decomposition
wavedec2 is a two-dimensional wavelet analysis function.
[C,S] = wavedec2(X,N,'wname') returns the wavelet decomposition of the matrix X at level N, using the wavelet named in string 'wname' (see wfilters for more information).
Outputs are the decomposition vector C and the corresponding bookkeeping matrix S.
N must be a strictly positive integer (see wmaxlev for more information).
Instead of giving the wavelet name, you can give the filters.
For [C,S] = wavedec2(X,N,Lo_D,Hi_D), Lo_D is the decomposition low-pass filter and Hi_D is the decomposition high-pass filter.
where A, H, V, D, are row vectors such that
When X represents an indexed image, X, as well as the output arrays cA,cH,cV, and cD are m-by-n matrices. When X represents a truecolor image, it is an m-by-n-by-3 array, where each m-by-n matrix represents a red, green, or blue color plane concatenated along the third dimension. The size of vector C and the size of matrix S depend on the type of analyzed image.
For a truecolor image, the decomposition vector C and the corresponding bookkeeping matrix S can be represented as follows.

For more information on image formats, see the image and imfinfo reference pages.
% The current extension mode is zero-padding (see dwtmode). % Load original image. load woman; % X contains the loaded image. % Perform decomposition at level 2 % of X using db1. [c,s] = wavedec2(X,2,'db1'); % Decomposition structure organization. sizex = size(X) sizex = 256 256 sizec = size(c) sizec = 1 65536 val_s = s val_s = 64 64 64 64 128 128 256 256
For images, an algorithm similar to the one-dimensional case is possible for two-dimensional wavelets and scaling functions obtained from one-dimensional ones by tensor product.
This kind of two-dimensional DWT leads to a decomposition of approximation coefficients at level j in four components: the approximation at level j+1, and the details in three orientations (horizontal, vertical, and diagonal).
The following chart describes the basic decomposition step for images:

So, for J=2, the two-dimensional wavelet tree has the form
Daubechies, I. (1992), Ten lectures on wavelets, CBMS-NSF conference series in applied mathematics. SIAM Ed.
Mallat, S. (1989), "A theory for multiresolution signal decomposition: the wavelet representation," IEEE Pattern Anal. and Machine Intell., vol. 11, no. 7, pp. 674-693.
Meyer, Y. (1990), Ondelettes et opérateurs, Tome 1, Hermann Ed. (English translation: Wavelets and operators, Cambridge Univ. Press. 1993.)
| Provide feedback about this page |
![]() | wavedec | wavedemo | ![]() |

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 |