OverLordGoldDragon / ssqueezepy

Synchrosqueezing, wavelet transforms, and time-frequency analysis in Python
MIT License
599 stars 92 forks source link

Can the CWT be used on a discrete signal ? #73

Closed journeytosilius closed 2 years ago

journeytosilius commented 2 years ago

Hi, I wanted to ask if the CWT can be used on a discrete time-sampled digital signal

This simulator samples incoming messages, realtime every 1ms. The result is an array of integers ( amount of messages per ms ) that ranges from 0 to N like this [0,12,4,26,32,2,5] and so on.

I wanted to know if I need to do something to the data first or I can just use it like this with the CWT

Thanks !

OverLordGoldDragon commented 2 years ago

Yes, the only constraint is that data is sampled uniformly. In fact, CWT on a digital computer can only handle discrete signals.

Though, it should be fed as float64 (or float32) instead of as integers. I recommend normalizing as x /= x.std().

journeytosilius commented 2 years ago

Answered this by testing it. Thank you a lot !