Multiresolution analysis based on MODWT
the reflection boundary condition in the construction of the MRA using any of the
arguments from previous syntaxes. If you specify
mra = modwtmra(___,'reflection')
modwtmra assumes that the column dimension of
w is even and equals twice the length of the original
You must enter the entire character vector
'reflection'. If you
added a wavelet named
'reflection' using the wavelet manager, you
must rename that wavelet prior to using this option.
may be placed in any position in the input argument list after
x. By default,
modwtmra uses periodic
extension at the boundary.
Perfect Reconstruction with the MODWTMRA
Obtain the MODWTMRA of a simple time-series signal and demonstrate perfect reconstruction.
Create a time-series signal
t = 1:10; x = sin(2*pi*200*t);
Obtain the MODWT and the MODWTMRA and sum the MODWTMRA rows.
m = modwt(x); mra = modwtmra(m); xrec = sum(mra);
Use the maximum of the absolute values to show that the difference between the original signal and the reconstruction is extremely small. The largest absolute value is on the order of , which demonstrates perfect reconstruction.
ans = 5.5738e-25
MRA Using Non-Default Wavelet
Construct an MRA of an ECG signal down to level four using the
db2 wavelet. The data are taken from Percival & Walden (2000), p.125 (data originally provided by William Constantine and Per Reinhall, University of Washington). The sampling frequency for the ECG signal is 180 hertz.
load wecg; lev = 4; wtecg = modwt(wecg,'db2',lev); mra = modwtmra(wtecg,'db2');
Plot the ECG waveform and the MRA.
t = (0:numel(wecg)-1)/180; subplot(6,1,1) plot(t,wecg) for kk = 2:lev+2 subplot(6,1,kk) plot(t,mra(kk-1,:)) end xlabel('Time (s)') set(gcf,'Position',[0 0 500 700])
MRA Using the Default Wavelet
Construct a multiresolution analysis for the Southern Oscillation Index data. The sampling period is one day. Plot the level eight details corresponding to a scale of days. The details at this scale capture oscillations on a scale of approximately one year.
load soi wtsoi = modwt(soi); mrasoi = modwtmra(wtsoi); plot(mrasoi(8,:)) title('Level 8 Details')
MRA Using Minimum Bandwidth Scaling and Wavelet Filters
Obtain the MRA for the Deutsch Mark - U.S. Dollar exchange rate data using the minimum bandwidth scaling and wavelet filters with four coefficients.
load DM_USD; Lo = [0.4801755, 0.8372545, 0.2269312, -0.1301477]; Hi = qmf(Lo); wdm = modwt(DM_USD,Lo,Hi); mra = modwtmra(wdm,Lo,Hi);
MRA Using Fejér-Korovkin Filters
Load the ECG data.
Obtain the MODWT of the signal using the filters associated with the 8-coefficient Fejér-Korovkin filters.
[~,~,Lo,Hi] = wfilters("fk8"); wtecg = modwt(wecg,Lo,Hi);
Obtain the MRA of the signal using the filters.
mra = modwtmra(wtecg,Lo,Hi);
Obtain a second MRA of the signal using the wavelet name. Confirm the multiresolution analyses are equal.
mra2 = modwtmra(wtecg,"fk8"); max(abs(mra(:)-mra2(:)))
ans = 0
MRA Using Reflection Boundary
Obtain the MRA for an ECG signal using
'reflection' boundary handling. The data are taken from Percival & Walden (2000), p.125 (data originally provided by William Constantine and Per Reinhall, University of Washington).
load wecg; wtecg = modwt(wecg,'reflection'); mra = modwtmra(wtecg,'reflection');
Show that the number of columns in the MRA is equal to the number of elements in the original signal.
ans = logical 1
MRA of Multisignal
Load the 23 channel EEG data
Espiga3 . The channels are arranged column-wise. The data is sampled at 200 Hz.
Obtain the MRA of the multisignal.
w = modwt(Espiga3); mra = modwtmra(w);
w — MODWT transform
MODWT transform of a signal or multisignal down to level
LEV, specified as a matrix or 3-D array,
w is an
LEV+1-by-N matrix for the MODWT of
an N-point signal, and an
array for the MODWT of an N-by-NC
multisignal. By default,
imodwt assumes that you
obtained the MODWT using the
'sym4' wavelet with periodic
Complex Number Support: Yes
wname — Synthesis wavelet
'sym4' (default) | character vector | string scalar
Synthesis wavelet, specified as a character vector or string scalar. The synthesis wavelet
must be the same wavelet used to obtain the MODWT with the
Lo,Hi — Filters
even-length real-valued vectors
Filters, specified as a pair of even-length real-valued vectors.
Lo is the scaling filter, and
is the wavelet filter.
be the same filters used in the analysis with
modwt. The filters must
satisfy the conditions for an orthogonal wavelet. The lengths of
Hi must be equal. See
wfilters for additional
information. You cannot specify both
wname and a filter
By default, the
returns two pairs of filters associated with an orthogonal or
biorthogonal wavelet you specify. To agree with the usual convention
in the implementation of
MODWT in numerical
packages, when you specify an orthogonal wavelet
function internally uses the second pair of filters returned by
is equivalent to
[~,~,Lo,Hi] = wfilters("db2"); mra =
This convention is different from the one followed by most Wavelet Toolbox™ discrete wavelet transform functions when decomposing a signal. Most functions internally use the first pair of filters.
mra — Multiresolution analysis
matrix | 3-D array
Multiresolution analysis, returned as a matrix or 3-D array.
mra is a
LEV+1-by-N matrix or
array where LEV is the level of the MODWT and
N is the length of the analyzed signal. The
kth row of
mra contains the details for the
kth level. The
(LEV+1)th row of
mra contains the
LEVth level smooth.
mra is the same size as the input
you specify reflection boundary handling, then
one half the size of the column dimension as the input
 Percival, Donald B., and Andrew T. Walden. Wavelet Methods for Time Series Analysis. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge ; New York: Cambridge University Press, 2000.
 Whitcher, Brandon, Peter Guttorp, and Donald B. Percival. “Wavelet Analysis of Covariance with Application to Atmospheric Time Series.” Journal of Geophysical Research: Atmospheres 105, no. D11 (June 16, 2000): 14941–62. https://doi.org/10.1029/2000JD900110.
 Mesa, Hector. “Adapted Wavelets for Pattern Detection.” In Progress in Pattern Recognition, Image Analysis and Applications, edited by Alberto Sanfeliu and Manuel Lazo Cortés, 3773:933–44. Berlin, Heidelberg: Springer Berlin Heidelberg, 2005. https://doi.org/10.1007/11578079_96.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
wnamemust be constant.
GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.
Usage notes and limitations:
wnamemust be constant.
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Introduced in R2015b