waverec3
R2026bMultilevel 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
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 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
Wavelet decomposition, specified as a structure. The structure is the
output of wavedec3 and has the
following fields:
Size of the 3-D array, specified as a 1-by-3 vector.
Level of the decomposition, specified as an integer.
Name of the wavelet transform extension mode, specified as a character vector.
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
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.
Successive sizes of the decomposition components, specified as
a wdec.level+1-by-2 matrix.
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'.
Decomposition level, specified as an integer.
Output Arguments
Reconstruction, returned as a 3-D array of size
sz(1)-by-sz(2)-by-sz(3),
where sz = wpdec.sizeINI.
Extracted coefficients, returned as a 3-D array.
Extended Capabilities
The waverec3
function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Version History
Introduced in R2010aYou can use waverec3 in thread-based
environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- 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)