wavedec3
Multilevel 3-D discrete wavelet transform
Syntax
Description
Examples
Find the 3-D DWT of a volume. Construct an 8-by-8-by-8 array of integers 1 to 64.
M = magic(8); X = repmat(M,[1 1 8]);
Obtain the 3-D discrete wavelet transform at level 1 using the Haar wavelet and the default extension mode.
wdec = wavedec3(X,1,"db1")wdec = struct with fields:
    sizeINI: [8 8 8]
      level: 1
    filters: [1×1 struct]
       mode: 'sym'
        dec: {8×1 cell}
      sizes: [2×3 double]
Compare the output of wavedec3 and dwt3 to illustrate the ordering of the 3-D wavelet coefficients described in the dec field description. 
X = reshape(1:512,8,8,8); dwtOut = dwt3(X,"db1","mode","per"); wdec = wavedec3(X,1,"db1","mode","per"); max(abs((wdec.dec{4}(:)-dwtOut.dec{2,2,1}(:))))
ans = 0
max(abs((wdec.dec{5}(:)-dwtOut.dec{1,1,2}(:))))ans = 0
Specify the decomposition and reconstruction filters as a cell array. Construct an 8-by-8-by-8 array of integers 1 to 64.
M = magic(8); X = repmat(M,[1 1 8]);
Obtain the 3-D discrete wavelet transform down to level 2 using the Daubechies extremal phase wavelet with two vanishing moments. Input the decomposition and reconstruction filters as a cell array. Use the periodic extension mode.
[LoD,HiD,LoR,HiR] = wfilters("db2"); wdec = wavedec3(X,2,{LoD,HiD,LoR,HiR},"mode","per");
Obtain the 3-D decomposition using the wavelet name. Confirm the filters fields of both decompositions are identical.
wdecName = wavedec3(X,2,"db2","mode","per"); wdec.filters
ans = struct with fields:
    LoD: {[-0.1294 0.2241 0.8365 0.4830]  [-0.1294 0.2241 0.8365 0.4830]  [-0.1294 0.2241 0.8365 0.4830]}
    HiD: {[-0.4830 0.8365 -0.2241 -0.1294]  [-0.4830 0.8365 -0.2241 -0.1294]  [-0.4830 0.8365 -0.2241 -0.1294]}
    LoR: {[0.4830 0.8365 0.2241 -0.1294]  [0.4830 0.8365 0.2241 -0.1294]  [0.4830 0.8365 0.2241 -0.1294]}
    HiR: {[-0.1294 -0.2241 0.8365 -0.4830]  [-0.1294 -0.2241 0.8365 -0.4830]  [-0.1294 -0.2241 0.8365 -0.4830]}
wdecName.filters
ans = struct with fields:
    LoD: {[-0.1294 0.2241 0.8365 0.4830]  [-0.1294 0.2241 0.8365 0.4830]  [-0.1294 0.2241 0.8365 0.4830]}
    HiD: {[-0.4830 0.8365 -0.2241 -0.1294]  [-0.4830 0.8365 -0.2241 -0.1294]  [-0.4830 0.8365 -0.2241 -0.1294]}
    LoR: {[0.4830 0.8365 0.2241 -0.1294]  [0.4830 0.8365 0.2241 -0.1294]  [0.4830 0.8365 0.2241 -0.1294]}
    HiR: {[-0.1294 -0.2241 0.8365 -0.4830]  [-0.1294 -0.2241 0.8365 -0.4830]  [-0.1294 -0.2241 0.8365 -0.4830]}
Input Arguments
Input data, specified as a 3-D array.
Data Types: double
Decomposition level, specified as a positive integer.
                            wavedec3 does not enforce a maximum level
                        restriction. See wmaxlev.
Data Types: double
Analyzing wavelet, specified as a character vector or string scalar.
Note
wavedec3 supports only Type 1 (orthogonal) or
                                Type 2 (biorthogonal) wavelets. See wfilters for a
                                list of orthogonal and biorthogonal wavelets.
Extension mode used when performing the wavelet decomposition, specified as:
| extmode | DWT Extension Mode | 
|---|---|
| "zpd" | Zero padding | 
| "sp0" | Smooth extension of order 0 | 
| "spd"(or "sp1") | Smooth extension of order 1 | 
| "sym"or"symh" | Symmetric extension (half point): boundary value symmetric replication | 
| "symw" | Symmetric extension (whole point): boundary value symmetric replication | 
| "asym"or"asymh" | Antisymmetric extension (half point): boundary value antisymmetric replication | 
| "asymw" | Antisymmetric extension (whole point): boundary value antisymmetric replication | 
| "ppd","per" | Periodized extension If the signal length is odd and
                             | 
The global variable managed by dwtmode specifies the default extension
            mode.
Wavelet decomposition filters associated with an orthogonal or
                        biorthogonal wavelet, specified as even-length real-valued vectors.
                            LoD is the lowpass decomposition filter, and
                            HiD is the highpass decomposition filter. See
                            wfilters for
                        details.
Wavelet reconstruction filters associated with an orthogonal or
                        biorthogonal wavelet, specified as even-length real-valued vectors.
                            LoR is the lowpass reconstruction filter, and
                            HiR is the highpass reconstruction filter. See
                            wfilters for
                        details.
Output Arguments
Wavelet output decomposition, returned as a structure with the following fields:
Input data size, returned as a 1-by-3 vector.
Level of the decomposition, returned as an integer.
Name of the wavelet transform extension mode, returned as a character vector.
Wavelet filters used for the decomposition, returned as a structure with the following fields:
- LoD— lowpass decomposition filter
- HiD— highpass decomposition filter
- LoR— lowpass decomposition filter
- HiR— highpass decomposition filter
Decomposition coefficients, returned as an
                                        N-by-1 cell array, where
                                        N equals 7 wdec.level+1.
dec{1} contains the lowpass component
                                    (approximation) at the level of the decomposition. The
                                    approximation is equivalent to the filtering operations
                                        "LLL".
dec{k+2},...,dec{k+8} with k =
                                        0,7,14,...,7*(wdec.level-1) contain the 3-D
                                    wavelet coefficients for the multiresolution starting with the
                                    coarsest level when k=0.
For example, if wdec.level=3,
                                        dec{2},...,dec{8} contain the wavelet
                                    coefficients for level 3 (k=0),
                                        dec{9},...,dec{15} contain the wavelet
                                    coefficients for level 2 (k=7), and
                                        dec{16},...,dec{22} contain the wavelet
                                    coefficients for level 1
                                    (k=7*(wdec.level-1)).
At each level, the wavelet coefficients in
                                        dec{k+2},...,dec{k+8} are in the
                                    following order:
                                        "HLL","LHL","HHL","LLH","HLH","LHH","HHH".
The sequence of letters gives the order in which the separable
                                    filtering operations are applied from left to right. For
                                    example, "LHH" means that the lowpass
                                    (scaling) filter with downsampling is applied to the rows of
                                        x, followed by the highpass (wavelet)
                                    filter with downsampling applied to the columns of
                                        x. Finally, the highpass filter with
                                    downsampling is applied to the 3rd dimension of
                                        x.
Successive sizes of the decomposition components, returned as
                                    an n+1-by-2 matrix.
Version History
Introduced in R2010a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)