pytorch_wavelets icon indicating copy to clipboard operation
pytorch_wavelets copied to clipboard

How to implement DTCWT to 1-D signals?

Open QuasiLegendre opened this issue 2 years ago • 10 comments

Thanks for such a convenient framework! Is there anyway or method to implement DTCWT to 1-D signals? Also, does DTCWT has advantage over DWT in signal processing?

QuasiLegendre avatar Dec 10 '21 16:12 QuasiLegendre

Hi @QuasiLegendre, it's not currently available in this repo but it wouldn't be too hard to add if it would be of use. As for the advantages of the DTCWT over the DWT - yes there are indeed! I'll refer you to the journal paper here: https://eeweb.engineering.nyu.edu/iselesni/pubs/CWT_Tutorial.pdf, in particular note the 4 problems mentioned in the introduction.

However, the DTCWT does add some complexity too, so it's hard to say if it's worth the extra effort. What's the use case you're thinking of?

fbcotter avatar Dec 15 '21 10:12 fbcotter

Thanks for your advice! My use case is to find a optimized wavelet filtering/smoothing method for my particular 1-D real signal for signal anomaly detection in the next step(LSTM/GRU or 1-D CNN).
image The signal is shown above, the red-labeled part is abnormal signal, while the blue part is referred as normal signal. The x axis means time, and y axis is voltage.

QuasiLegendre avatar Dec 16 '21 08:12 QuasiLegendre

If you want to get good localisation of the signal then yes perhaps the DTCWT will be a good one to use. I can make a 1D version of it for you but it may take a couple of days. In the meantime, I'd suggest first trying with the DWT to see how well it works though.

fbcotter avatar Dec 20 '21 10:12 fbcotter

I will take your advice and try DWT in several days. Thank you the recommendation and help!

QuasiLegendre avatar Dec 21 '21 07:12 QuasiLegendre

@fbcotter any plans to release 1.3 with 1D DWT?

lostmsu avatar Apr 18 '22 21:04 lostmsu

Do you mean a 1D DTCWT? There already should be a 1D DWT in there. I see I haven't made docs for it though, so maybe you just didn't see it.

from pytorch_wavelets import DWT1DForward, DWT1DInverse

fbcotter avatar Apr 20 '22 16:04 fbcotter

@lostmsu no, I mean PyPi only has 1.2, so to get 1.3 one currently needs to install from source.

lostmsu avatar Apr 20 '22 16:04 lostmsu

Oh I see. Sure, I can do that

fbcotter avatar Apr 20 '22 19:04 fbcotter

Hey, did you ever get around to implementing the 1D DTCWT?

naba89 avatar Mar 21 '23 03:03 naba89

Hello, I would like to ask if you have implemented DTCWT to 1-D signals? Thank you so much.

Tokenmw avatar Sep 09 '23 15:09 Tokenmw