ilwt
Description
returns the 1-D inverse wavelet transform based on the approximation coefficients,
xr
= ilwt(ca
,cd
)ca
, and cell array of detail coefficients, cd
.
By default, ilwt
assumes you used the lifting scheme associated with
the db1
wavelet to obtain ca
and
cd
. If you do not modify the coefficients, xr
is
a perfect reconstruction of the signal.
Examples
Inverse LWT of Integer-Valued Signal
Create a lifting scheme associated with the db3
wavelet. Specify an integer-valued signal whose length is a power of 2.
lsc = liftingScheme('Wavelet','db3'); n = 8; sig = 1:2^n;
Use the lifting scheme to obtain the integer-valued LWT of the signal down to the maximum decomposition level.
[ca,cd] = lwt(sig,'LiftingScheme',lsc,'Int2Int',true);
Confirm the detail coefficients cd
are a cell array whose length is equal to the exponent of 2.
length(cd)
ans = 8
Obtain the inverse LWT up to level 0. Confirm perfect reconstruction.
xrec0 = ilwt(ca,cd,'LiftingScheme',lsc,'Int2Int',true,'Level',0); max(abs(xrec0(:)-sig(:)))
ans = 0
Obtain the inverse LWT up to level 1.
xrec1 = ilwt(ca,cd,'LiftingScheme',lsc,'Int2Int',true,'Level',1);
Obtain the level 1 decomposition of the signal. Confirm the approximation coefficients are equal to xrec1
.
[ca,cd] = lwt(sig,'LiftingScheme',lsc,'Int2Int',true,'Level',1); max(abs(ca(:)-xrec1(:)))
ans = 0
Inverse LWT of Multichannel Signal
Load the 23 channel EEG data Espiga3
. The channels are arranged column-wise.
load Espiga3
size(Espiga3)
ans = 1×2
995 23
Obtain the LWT of the multichannel signal using the db4
wavelet down to the default maximum decomposition level.
wv = 'db4'; [ca,cd] = lwt(Espiga3,'Wavelet',wv);
Reconstruct the multichannel signal.
xrec = ilwt(ca,cd,'Wavelet',wv);
Because the original signal has an odd number of samples in each channel, confirm the reconstruction has one more row than the original signal.
size(xrec)
ans = 1×2
996 23
Confirm the last row in the reconstruction is equal to the previous row.
max(abs(xrec(end-1,:)-xrec(end,:)))
ans = 5.6843e-14
Delete the last row from the reconstruction. Confirm the result is equal to the original signal.
xrec(end,:) = []; max(abs(Espiga3(:)-xrec(:)))
ans = 4.5475e-13
Input Arguments
ca
— Approximation coefficients
scalar | vector | matrix
Approximation (lowpass) coefficients at the coarsest level, specified as a scalar,
vector, or matrix. The coefficients are the output of lwt
.
If ca
and the elements of cd
are matrices,
xr
is a matrix where each column is the inverse wavelet transform
of the corresponding columns in ca
and
cd
.
Data Types: single
| double
Complex Number Support: Yes
cd
— Detail coefficients
cell array
Detail coefficients, specified as an L-by-1 cell array, where
L is the level of the transform. The elements of
cd
are in order of decreasing resolution. The coefficients are
the output of lwt
.
If ca
and the elements of cd
are matrices,
xr
is a matrix where each column is the inverse wavelet transform
of the corresponding columns in ca
and
cd
.
Data Types: single
| double
Complex Number Support: Yes
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: xr = ilwt(ca,cd,'LiftingScheme',lsc,'Level',1)
uses the
lsc
lifting scheme to perform an inverse wavelet transform up to level
1.
Wavelet
— Wavelet
'db1'
(default) | character vector | string scalar
Orthogonal or biorthogonal wavelet to use in the inverse LWT, specified as a
character vector or string scalar. See the Wavelet
property of liftingScheme
for the list of supported wavelets. For
perfect reconstruction, the specified wavelet must be the same wavelet that was used
to obtain the coefficients ca
and cd
.
You cannot specify 'Wavelet'
and
'LiftingScheme'
name-value arguments at the same time.
Example: xr = ilwt(ca,cd,'Wavelet','bior3.5')
uses the
bior3.5
biorthogonal wavelet.
Data Types: char
| string
LiftingScheme
— Lifting scheme
liftingScheme
object
Lifting scheme to use in the inverse LWT, specified as a liftingScheme
object. For perfect reconstruction, the specified lifting
scheme must be the same lifting scheme that was used to obtain the coefficients
ca
and cd
.
You cannot specify 'Wavelet'
and
'LiftingScheme'
name-value arguments at the same time.
Example: xr = ilwt(ca,cd,'LiftingScheme',lScheme)
uses the
lScheme
lifting scheme.
Level
— Reconstruction level
0
(default) | positive integer
Reconstruction level, specified as a nonnegative integer less than or equal to
length(cd)
-1. If unspecified, the reconstruction level defaults
to 0 and xr
is a perfect reconstruction of the signal.
Example: xr = ilwt(ca,cd,'Level',1)
reconstructs the signal up
to level 1.
Data Types: double
Extension
— Extension mode
'periodic'
(default) | 'zeropad'
| 'symmetric'
Extension mode to use in the inverse LWT, specified as a
'periodic'
(default), 'zeropad'
, or
'symmetric'
. The value of 'Extension'
specifies how to extend the signal at the boundaries.
Example: xr = ilwt(ca,cd,'Extension','symmetric')
specifies the
symmetric extension mode.
Int2Int
— Integer-valued data handling
false
or 0
(default) | true
or 1
Integer-valued data handling, specified as a numeric or logical
1
(true
) or 0
(false
).
1
(true
) — Preserve integer-valued data0
(false
) — Do not preserve integer-valued data
Specify the 'Int2Int'
name-value argument only if all elements
of the input are integers.
Example: xr = ilwt(ca,cd,'Int2Int',true)
preserves
integer-valued data.
Output Arguments
xr
— Inverse wavelet transform
vector | matrix
Inverse wavelet transform of ca
and cd
,
returned as a vector or matrix. If ca
is a scalar or vector, and
the elements of cd
are vectors, xr
is a
vector. If ca
and the elements of cd
are
matrices, xr
is a matrix where each column is the inverse wavelet
transform of the corresponding columns in ca
and
cd
.
Data Types: single
| double
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2021aR2021a: ilwt
input syntax has changed
The ilwt
input syntax has changed. Use name-value arguments instead.
Functionality | Result | Use Instead | Compatibility Considerations |
---|---|---|---|
X = ilwt(CA,CD,W) | Errors | X = ilwt(CA,CD,'Wavelet',W) | You can also set the LiftingScheme name-value argument
to obtain the inverse LWT. |
X = ilwt(CA,CD,W,LEVEL) | Errors | X = ilwt(CA,CD,'Wavelet',W,'Level',LEVEL) | You can also set the ExtensionMode and
Int2Int name-value arguments. |
X = ilwt(AD_In_Place,W) | Errors | NA | In-place transforms are no longer supported. |
See Also
liftingScheme
| haart
| lwt
| ihaart
| lwtcoef
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.
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)