waverec3
Multilevel 3-D discrete wavelet transform reconstruction
Description
reconstructs or extracts at level c
= waverec3(wdec
,type
,n
)n
the multilevel components
specified by type
. If type
begins with
'c'
or 'C'
, waverec3
extracts the specified components. Otherwise, waverec3
reconstructs the components.
x = waverec3(wdec,'a',0)
and x =
waverec3(wdec,'ca',0)
are equivalent to x =
waverec3(wdec)
, where 'a'
specifies the lowpass
component. x
is the reconstruction of the coefficients in
wdec
at level 0.
c = waverec3(wdec,type)
is equivalent to c =
waverec3(wdec,type,wdec.level)
.
Examples
Perfect Reconstruction with 3-D Discrete Wavelet Transform
Construct a 3-D matrix, obtain the wavelet transform down to level 2 using the 'db2'
wavelet, and reconstruct the matrix to verify perfect reconstruction.
Create 3-D matrix.
M = magic(8); X = repmat(M,[1 1 8]);
Obtain the 3-D discrete wavelet transform of the matrix and reconstruct the input based on the 3-D approximation and detail coefficients.
wd = wavedec3(X,2,'db2');
XR = waverec3(wd);
Verify perfect reconstruction using the wavelet decomposition down to level 2.
err1 = max(abs(X(:)-XR(:)))
err1 = 8.6050e-11
Verify that the data matrix is the sum of the approximation and the details from levels 2 and 1. Reconstruct the sum of components different from the lowpass component and check that X
= A
+ D
.
A = waverec3(wd,'LLL'); D = waverec3(wd,'d'); err2 = max(abs(X(:)-A(:)-D(:)))
err2 = 8.6054e-11
Compare waverec3 and idwt3
Compare level-1 reconstructions based on the filtering operations 'LLH'
using idwt3
and waverec3
.
M = magic(8); X = repmat(M,[1 1 8]); wd = wavedec3(X,2,'db2','mode','per'); dwtOut = dwt3(X,'db2'); Xr = idwt3(dwtOut,'LLH'); Xrec = waverec3(wd,'LLH',1); norm(Xr(:)-Xrec(:))
ans = 2.2773e-14
Input Arguments
wdec
— Wavelet decomposition
structure
Wavelet decomposition, specified as a structure. The structure is the
output of wavedec3
and has the
following fields:
sizeINI
— Size
vector
Size of the 3-D array, specified as a 1-by-3 vector.
level
— Level of the decomposition
integer
Level of the decomposition, specified as an integer.
mode
— Name of the wavelet transform extension mode
character vector
Name of the wavelet transform extension mode, specified as a character vector.
filters
— Wavelet filters
structure
Wavelet filters used for the decomposition, specified as a structure with the following fields:
LoD
— lowpass decomposition filterHiD
— highpass decomposition filterLoR
— lowpass decomposition filterHiR
— highpass decomposition filter
dec
— Decomposition coefficients
cell array
Decomposition coefficients, specified 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
.
sizes
— Successive sizes
matrix
Successive sizes of the decomposition components, specified as
a wdec.level
+1-by-2 matrix.
type
— Type of reconstruction or extraction
character vector | string scalar
Type of reconstruction or extraction, specified as a character vector or
string scalar. For reconstruction, valid values of type
are:
A group of three characters
'xyz'
, one per direction, with'x'
,'y'
and'z'
selected in the set {'a'
,'d'
,'l'
,'h'
} or in the corresponding uppercase set {'A'
,'D'
,'L'
,'H'
}, where'A'
(or'L'
) is a lowpass filter and'D'
(or'H'
) is a highpass filter.The char
'd'
(or'h'
or'D'
or'H'
) gives the sum of all the components different from the lowpass component.The char
'a'
(or'l'
or'A'
or'L'
) gives the lowpass component (the approximation at leveln
).
To extract coefficients, the valid values for
type
are the same but prefixed by
'c'
or 'C'
.
n
— Decomposition level
wdec.level
(default) | integer
Decomposition level, specified as an integer.
Output Arguments
x
— Reconstruction
3-D array
Reconstruction, returned as a 3-D array of size
sz(1)
-by-sz(2)
-by-sz(3)
,
where sz = wpdec.sizeINI
.
c
— Extracted coefficients
3-D array
Extracted coefficients, returned as a 3-D array.
Version History
Introduced in R2010a
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)