Different wavelet decomposition output matlab and simulink
Show older comments
Hi,
I have built a code that used wavelet decomposition ('wavedec') with 3 levels and sym3 mother wavelet. When I tried to build a model in simulink using the DWT block with symlets, assymetric, and 3 levels selected, the outputs of the transformations are different.
Please help me figure out why this is or how can I make it the same.
Thank you.
4 Comments
Prashant Arora
on 18 Oct 2017
Hi Douglas,
Can you describe in more details how the transformations are different? If you can send me some code or data to reproduce, I will be happy to investigate this further.
Prashant
Douglas Pinto
on 19 Oct 2017
Prashant Arora
on 19 Oct 2017
Hi Douglas,
Thanks for your response. I have not seen such issue in general. One of the things which I have seen happening is Simulink interpolating between time steps because MATLAB defined times are "slightly" different than Simulink ones. For example:
Consider a Simulink model with Fixed-step 0.2 secs and duration 10 secs and a signal is defined in MATLAB with time as follows:
t = (0:0.2:10)'
This is different than Simulink generated time steps in terms of precision. Simulink defines the time steps as following:
tStart = 0;
tFinal = 10;
stepSize = 0.2;
numSamples = (tFinal-tStart)/stepSize;
t = stepSize*[0:numSamples]';
If I plot the difference between these two generated time steps, you will notice some difference.

Due to this, sometimes there are issues because Simulink will interpolate data when it won't hit the time step exactly.
If you can send me some sample data, I will be happy to investigate the reasons you were seeing a difference.
Douglas Pinto
on 24 Oct 2017
Answers (0)
Categories
Find more on Discrete Multiresolution Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!