www.gusucode.com > wavelet 源码程序 matlab案例代码 > wavelet/PerfectReconstructionWithTheMODWTMRAExample.m

    %% Perfect Reconstruction with the MODWTMRA
% Obtain the MODWTMRA of a simple time-series signal and demonstrate
% perfect reconstruction.
%%
% Create a time-series signal

% Copyright 2015 The MathWorks, Inc.

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.
max(abs(x-xrec))