Main Content


Multiresolution analysis based on MODWT



mra = modwtmra(w) returns the multiresolution analysis (MRA) of the maximal overlap discrete wavelet transform (MODWT) matrix, w. The MODWT matrix, w, is the output of the modwt function. By default, modwtmra assumes that you obtained w using the 'sym4' wavelet with periodic boundary handling.


mra = modwtmra(w,wname) constructs the MRA using the wavelet corresponding to wname. The wname wavelet must be the same wavelet used to obtain the MODWT.


mra = modwtmra(w,Lo,Hi) constructs the MRA using the scaling filter Lo and wavelet filter Hi. The Lo and Hi filters must be the same filters used to obtain the MODWT.


mra = modwtmra(___,'reflection') uses the reflection boundary condition in the construction of the MRA using any of the arguments from previous syntaxes. If you specify 'reflection', modwtmra assumes that the column dimension of w is even and equals twice the length of the original signal.

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. 'reflection' may be placed in any position in the input argument list after x. By default, modwtmra uses periodic extension at the boundary.


collapse all

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 10-25, which demonstrates perfect reconstruction.

ans = 5.5738e-25

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;
for kk = 2:lev+2
xlabel('Time (s)')
set(gcf,'Position',[0 0 500 700])

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 28 days. The details at this scale capture oscillations on a scale of approximately one year.

load soi
wtsoi = modwt(soi);
mrasoi = modwtmra(wtsoi);
title('Level 8 Details')

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);

Load the ECG data.

load wecg

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");
ans = 0

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

Load the 23 channel EEG data Espiga3 [3]. The channels are arranged column-wise. The data is sampled at 200 Hz.

load Espiga3

Obtain the MRA of the multisignal.

w = modwt(Espiga3);
mra = modwtmra(w);

Input Arguments

collapse all

MODWT transform of a signal or multisignal down to level LEV, specified as a matrix or 3-D array, respectively. w is an LEV+1-by-N matrix for the MODWT of an N-point signal, and an LEV+1-by-N-by-NC 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 boundary handling.

Data Types: single | double
Complex Number Support: Yes

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 modwt function.

Filters, specified as a pair of even-length real-valued vectors. Lo is the scaling filter, and Hi is the wavelet filter. Lo and Hi must be the same filters used in the analysis with modwt. The filters must satisfy the conditions for an orthogonal wavelet. The lengths of Lo and Hi must be equal. See wfilters for additional information. You cannot specify both wname and a filter pair Lo,Hi.


By default, the wfilters function 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 wname, the modwtmra function internally uses the second pair of filters returned by wfilters. For example,

mra = modwtmra(wt,"db2");

is equivalent to

[~,~,Lo,Hi] = wfilters("db2"); mra = modwtmra(wt,Lo,Hi);

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.

Data Types: single | double

Output Arguments

collapse all

Multiresolution analysis, returned as a matrix or 3-D array. mra is a LEV+1-by-N matrix or LEV+1-by-N-by-NC 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.

By default, mra is the same size as the input w. If you specify reflection boundary handling, then mra has one half the size of the column dimension as the input w.


[1] 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.

[2] 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.

[3] 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.

Extended Capabilities

Version History

Introduced in R2015b