pywt icon indicating copy to clipboard operation
pywt copied to clipboard

feature request: synchrosqueezed wavelet transform

Open rgommers opened this issue 9 years ago • 11 comments

Original feature request by @gabsee at https://github.com/scipy/scipy/issues/6888:

Is anyone savvy enough to add the new Wavelet Synchrosqueezed Transform (wsst) (including inverse iwsst) to SciPy?

WSST has recently been implemented in MATLAB (R2016a): https://au.mathworks.com/help/wavelet/ref/wsst.html

The method is based on these two papers:

  1. I. Daubechies, I., J. Lu, and H. T. Wu. "Synchrosqueezed Wavelet Transforms: an Empricial Mode Decomposition-like Tool", Applied and Computational Harmonic Analysis. Vol. 30(2), pp. 243–261.
  2. Thakur, G., E. Brevdo, N. S. Fučkar, and H. T. Wu. "The Synchrosqueezing algorithm for time-varying spectral analysis: robustness properties and new paleoclimate applications." Signal Processing. Vol. 93, pp. 1079–1094.

The second one contains the algorithm and is available from arxiv.

I have used this method a few times for research projects and it is fantastic! However, I am new to Python, so am unable to implement this (just yet). Availability of wsst/iwsst in SciPy would convince me to give up Matlab for good.

Many thanks for considering :)

rgommers avatar Dec 26 '16 21:12 rgommers

Seems interesting. There's Matlab code at https://github.com/ebrevdo/synchrosqueezing, but that's not usable right now. I've requested the author to add a license: https://github.com/ebrevdo/synchrosqueezing/issues/2

rgommers avatar Dec 26 '16 21:12 rgommers

Looks interesting, but not something I have experience with.

There is an R port of that Matlab toolbox that is under an incompatible LGPL-2 license (https://cran.r-project.org/web/packages/SynchWave/index.html). Let's see wait and see what the author of that Matlab toolbox says regarding it's license.

grlee77 avatar Dec 29 '16 16:12 grlee77

Thanks for considering this! I wish I could do this but my Python experience is too young ...

Here's an example of the difference between CWT and WSST for a bit of data figure-2_01 From: http://www.hydrol-earth-syst-sci.net/20/4439/2016/

WSST is a pretty neat method, devised by the "mother" of wavelet transforms ...

gcrau avatar Dec 30 '16 00:12 gcrau

Hi!

Any update about this issue? Is there any implementation of wsst in Python in this library or somewhere else?

SebMilardo avatar Apr 09 '19 21:04 SebMilardo

It appears that the https://github.com/ebrevdo/synchrosqueezing repo was placed under 2-clause BSD license about a week ago.

prutschman avatar Sep 04 '19 21:09 prutschman

This is great news! I was planning to port such library in Python (or at least part of it). Now that there is a license I think it should be possible to start this project and to share it on GitHub. What do you think?

SebMilardo avatar Sep 04 '19 21:09 SebMilardo

This is great news! I was planning to port such library in Python (or at least part of it). Now that there is a license I think it should be possible to start this project and to share it on GitHub. What do you think?

I think there would be a lot of interest and it would be a good fit within PyWavelets. Rather than try porting the full toolbox at once, I would start with just the forward synchrosqueezed transform, ideally built based on the existing pywt.cwt implementation for the CWT.

grlee77 avatar Sep 05 '19 18:09 grlee77

Am also interested; any progress since?

OverLordGoldDragon avatar Jan 18 '20 15:01 OverLordGoldDragon

@SebMilardo Have you worked on an implementation so far? I'm considering it, maybe we could collaborate.

OverLordGoldDragon avatar Jan 19 '20 09:01 OverLordGoldDragon

@rgommers @SebMilardo @gcrau @grlee77 I've began porting it, need reviewers - thread here.

OverLordGoldDragon avatar Jan 29 '20 05:01 OverLordGoldDragon

Happy to test the outcome using my dataset

gcrau avatar Jan 29 '20 11:01 gcrau

This is now available as https://github.com/OverLordGoldDragon/ssqueezepy, which looks really good.

@OverLordGoldDragon's comment at https://github.com/PyWavelets/pywt/issues/543#issuecomment-722651267 indicates it will stay a separate package. If there is interest in the future to merge the packages, that is still feasible. But @OverLordGoldDragon's reasoning about PR review and maintenance bandwidth on PyWavelets being (s)low still applies, so let me close this feature request now.

Thanks all!

rgommers avatar Mar 12 '24 19:03 rgommers