Vivid difference between the DWT coefficients and its reconstruction

203 views
Skip to first unread message

c.di...@gmail.com

unread,
Jun 16, 2020, 3:43:16 AM6/16/20
to PyWavelets
Doing a DWT of a signal yields the approximation and details coefficients up to a specified level. In contrast to the WPT, this decomposition is unique for a chosen Wavelet. 

  1. But what is the intuitive meaning when plotting those coefficients and comparing the display to the original signal? Is there some deeper connection there and is the comparison between original signal and coefficients even meaningful?
  2. What is the way to go with pywt to reconstruct the original signal based only on the details of a certain level or for example only on the approximation coefficients? I dont find an example in the docs.
I appreciate your help

Marc Saudreau

unread,
Jun 16, 2020, 3:58:47 AM6/16/20
to PyWavelets
A good way to start with pywt is to have a look at the pretty cool guide from A. Taspinar: http://ataspinar.com/2018/12/21/a-guide-for-using-the-wavelet-transform-in-machine-learning/
I've really learned a lot from this guide. Based on this guide and the doc available on pywt, I have made my own python functions that do what you want.
I have also made a small ppt to show how DWT works to my colleagues … but they are in French ;-). 
I'm not in my lab today but I can provide you some files tonight !

All the very best 

 Marc

c.di...@gmail.com

unread,
Jun 16, 2020, 4:58:33 AM6/16/20
to PyWavelets
that would be nice, thank you. I am quite familiar with Wavelet theory, but am wondering about the algorithmic realization in pywt when it comes to reconstruction of a signal from only a part of the details/approx coefficients

Gregory Lee

unread,
Jun 16, 2020, 11:42:16 AM6/16/20
to pywav...@googlegroups.com
The safest way is to set all coefficient arrays that are not of interest to zeros before performing the reconstruction. The pywt.waverec* functions do have some guidance on this in their docstrings (added in https://github.com/PyWavelets/pywt/pull/303), but if you have ideas about where and how to better to document it we welcome contributions!

See also some related past issues on the GitHub tracker:
Multilevel reconstruction with omitted coefficients: https://github.com/PyWavelets/pywt/issues/336
Reconstructing signal without lower frequencies: https://github.com/PyWavelets/pywt/issues/441
Can't remove cA and then reconstruct: https://github.com/PyWavelets/pywt/issues/302

The proposed functions in this open PR (https://github.com/PyWavelets/pywt/pull/527) have functions that reconstruct each component on its own.





 
I appreciate your help

--
You received this message because you are subscribed to the Google Groups "PyWavelets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pywavelets+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pywavelets/5966aa52-ed45-4155-b8a0-bf093d9d470fo%40googlegroups.com.

Marc Saudreau

unread,
Jun 16, 2020, 1:18:41 PM6/16/20
to PyWavelets

Here is the functions I have done to reconstruct a signal from a given detail/approx coeff. I'm not an expert neither in Python nor in Wavelet nor in Pywt so I guess my functions can be improved but I hope this helps !!

All the very best
 
Marc

MyFunctions_Pywt.py

c.di...@gmail.com

unread,
Jun 19, 2020, 12:32:48 PM6/19/20
to PyWavelets
thank you for your help!
Reply all
Reply to author
Forward
0 new messages