Documentation

imodwt

Inverse maximal overlap discrete wavelet transform

Syntax

xrec = imodwt(w)
xrec = imodwt(w,wname)
xrec = imodwt(w,Lo,Hi)
xrec = imodwt(___,lev)
xrec = imodwt(___,'reflection')

Description

example

xrec= imodwt(w)returns inxreca reconstructed version of the signal. The reconstructed signal is based onw, the maximal overlap discrete wavelet transform (MODWT) coefficients and on the level of reconstruction, which defaults to zero.

example

xrec= imodwt(w,wname)reconstructs the signal usingwname, the orthogonal wavelet.wnamemust be the same wavelet used to analyze the signal input tomodwt. The reconstruction is up to level 0, which is a perfect reconstruction of the original signal.

example

xrec= imodwt(w,Lo,Hi)reconstructs the signal using the orthogonal scaling filterLoand the wavelet filterHi. TheLoandHifilters must be the same filters used to analyze the signal input tomodwt. The reconstruction is up to level 0, which is a perfect reconstruction of the original signal.

example

xrec= imodwt(___,lev)reconstructs the signal up to levellev.xrecis a projection onto the scaling space at levellev.

example

xrec= imodwt(___,'reflection')uses the reflection boundary condition in the reconstruction. If you specify'reflection',imodwtassumes that the length of the original signal length is one half the number of columns in the input coefficient matrix. By default,imodwtassumes periodic signal extension at the boundary.

Examples

collapse all

Obtain the MODWT of an ECG signal and demonstrate perfect reconstruction.

Load the ECG signal data and obtain the MODWT.

loadwecg;

Obtain the MODWT and the Inverse MODWT.

w = modwt(wecg); xrec = imodwt(w);

Use the L-infinity norm to show that the difference between the original signal and the reconstruction is extremely small. The largest absolute difference between the original signal and the reconstruction is on the order of, which demonstrates perfect reconstruction.

norm(abs(xrec'-wecg),Inf)
ans = 2.3250e-12

Obtain the MODWT of Deutsche Mark-U.S. Dollar exchange rate data and demonstrate perfect reconstruction.

Load the Deutsche Mark-U.S. Dollar exchange rate data.

loadDM_USD;

Obtain the MODWT and the Inverse MODWT using the'db2'wavelet.

wdm = modwt(DM_USD,'db2'); xrec = imodwt(wdm,'db2');

Use the L-infinity norm to show that the difference between the original signal and the reconstruction is extremely small. The largest absolute difference between the original signal and the reconstruction is on the order of, which demonstrates perfect reconstruction.

norm(abs(xrec'-DM_USD),Inf)
ans = 1.6370e-13

Obtain the MODWT of an ECG signal using the Fejer-Korovkin filters.

Load the ECG data.

loadwecg;

Create the 8-coefficient Fejer-Korovkin filters.

[Lo,Hi] = wfilters('fk8');

Obtain the MODWT and Inverse MODWT.

wtecg = modwt(wecg,Lo,Hi); xrec = imodwt(wtecg,Lo,Hi);

Plot the original data and the reconstruction.

subplot(2,1,1) plot(wecg) title('ECG Signal'); subplot(2,1,2) plot(xrec) title('Reconstruction')

Obtain the MODWT of an ECG signal down to the maximum level and obtain the projection of the ECG signal onto the scaling space at level 3.

Load the ECG data.

loadwecg;

Obtain the MODWT.

wtecg = modwt(wecg);

Obtain the projection of the ECG signal onto, the scaling space at level three by using theimodwtfunction.

v3proj = imodwt(wtecg,3);

Plot the original signal and the projection.

subplot(2,1,1) plot(wecg) title('Original Signal') subplot(2,1,2) plot(v3proj) title('Projection onto V3')

Note that the spikes characteristic of the R waves in the ECG are missing in theapproximation. You can see the missing details by examining the wavelet coefficients at level three.

Plot the level-three wavelet coefficients.

figure plot(wtecg(3,:)) title('Level-Three Wavelet Coefficients')

使用反射获取逆MODWT边界handling for Southern Oscillation Index data. The sampling period is one day.imodwtwith the'reflection'option assumes that the input matrix, which is themodwtoutput, is twice the length of the original signal length.imodwtreflection boundary handling reduces the number of wavelet and scaling coefficients at each scale by half.

loadsoi; wsoi = modwt(soi,4,'reflection'); xrecsoi = imodwt(wsoi,'reflection');

Use the L-infinity norm to show that the difference between the original signal and the reconstruction is extremely small. The largest absolute difference between the original signal and the reconstruction is on the order of, which demonstrates perfect reconstruction.

norm(abs(xrecsoi'-soi),Inf)
ans = 1.6444e-11

Input Arguments

collapse all

MODWT transform, specified as a matrix of sizeL+1-by-N.wis the output ofmodwt, which is the MODWT of anN-point input signal down to levelL. By default,imodwtassumes that you obtained the MODWT using the'sym4'wavelet with periodic boundary handling.

Data Types:double

Synthesis wavelet, specified as a character vector. The synthesis wavelet must be the same wavelet used in the analysis withmodwt.

Scaling filter, specified as an even-length real-valued vector. You can specifyLoonly if you do not specifywname.Lomust be the same scaling filter used in the analysis withmodwt.

小波滤波器, specified as an even-length real-valued vector. You can specifyHionly if you do not specifywname.Himust be the same wavelet filter used in the analysis withmodwt.

Reconstruction level, specified as a nonnegative integer between 0 andsize(w,1)-2. The level must be less than the level used to obtainwfrommodwt. Iflevis 0 and you do not modify the coefficients,imodwtproduces a perfect reconstruction of the signal.

Output Arguments

collapse all

Reconstructed version of the original signal based on the MODWT and the level of reconstruction, returned as a row vector.

References

[1] Percival, D. B., and A. T. Walden. Wavelet Methods for Time Series Analysis. Cambridge, UK: Cambridge University Press, 2000.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also

|

Introduced in R2015b

Was this topic helpful?