OverLordGoldDragon / ssqueezepy

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

Other transforms / reassignment methods #74

Closed OverLordGoldDragon closed 1 year ago

OverLordGoldDragon commented 2 years ago

As promised (in a StackExchange thread) ... some examples for you to use for testing (and comparison) and as examples and to add to your test suite or examples archive. Just grab the sounds from the videos.

15 second segment of a drum solo at 1/4 speed https://www.youtube.com/watch?v=6orozX1GD1w

(House music with preacher talking) https://www.youtube.com/watch?v=nd2J4xTrSHQ

(The drum at full and 1/4 speed, a segment of the 2001 theme and the House segment with preacher at full and 1/4 speed) https://www.youtube.com/watch?v=itUSUau6DJM

((The Vampire Song) https://www.youtube.com/watch?v=OugT7uGGtNg

You may want to consider expanding your software to include a fuller range of transforms (or to use for comparison). The time-scale transform, which the videos show an early implementation of (in the process of being upgraded), is described in more detail in the description page of the Vampire Song. Its main property is that it is invariant with respect to arbitrary frequency reassignment (e.g. even a random scrambling of frequencies): an arbitrarily-reassigned scalogram will yield, upon inversion, the same result as the original scalogram - both reproducing the original signal.

Originally posted by @RockBrentwood in https://github.com/OverLordGoldDragon/ssqueezepy/issues/9#issuecomment-1186387394

OverLordGoldDragon commented 2 years ago

Thanks for the submission @RockBrentwood

The invariance you're describing is universal to time-frequency transforms with unity stride and filterbanks real-valued in frequency, via the one-integral inverse, within frequency-dependent rescaling and Hilbert transform. It'd indeed very neat. The "time-scale transform" is implemented here as CWT, and the CWT itself supports a log-linear discretization akin to the Non-Stationary Gabor Transform (NSGT).

On comparing reassignment methods, testing on "real data" isn't the most informative. Key properties are best tested directly with synthetic signals - component separation, AM and FM modulation rates, etc. TestSignals is fairly comprehensive, but not exhaustive. If you compare SSQ against WVD, you'll find one suffers from quadratic interference. SSQ's predecessor, "squeezing", isn't invertible, and doesn't faithfully capture AM modulations. SSQ also supports higher-order extensions, and nonuniform sampling. Hence I'd be careful on labeling something to be "same as SSQ".

OverLordGoldDragon commented 2 years ago

Correction, the invariance only holds for direct additive reassignment - squeezing sums absolute values, and another variant sums a thresholded unity (Lebesgue measure), both losing inversion and invariance.