Open ARBolton96 opened 5 months ago
Thanks for the report, I confirmed the bug.
I've not attended to this feature beyond the original implementation, and it appears fully custom ssq_freqs
wasn't supported. Fixing this isn't trivial, I might get around to it in the future. It's also not overwhelming; I'll accept a PR for it.
In the meantime, one can do a workaround with minimal performance overhead:
101 -- `x` energy per Sx_full
45.9 -- `x` energy per Sx
45.9 -- `x` energy per Sx_full inside of `vi` freqs
How it works: we make the desired ssq_freqs
a subset of the full required format. Let the portion of interest be vi
, and the full input be v
:
min(vi) > min(ssq_freqs)
: Make v[1:1 + len(vi)] = vi
, and make the rest of indices their log continuation (or "log-piecewise"). That's because if min(vi)
is higher than the default min(ssq_freqs)
, it's assigned to v[0]
. min(vi) <= min(ssq_freqs)
: Make v[:len(vi)] = vi
, and do continuation the same way as in 1A.vi
.Note, we can only validate energy via inversion, per energy of transform vs energy of signal.
As an aside, I'm not a fan of ssq_freqs
docs saying Scale-frequency mapping is only approximate and wavelet-dependent
, the "only approximate" part. I guess I mimicked/copied that in early days; it's not "wrong" per se but can be misleading, an explanation here.
Note, original scales
can be any (can remove scales='log'
in my example).
Hope this problem can be fixed soon. Customizable ssq_freqs will greatly improve its user-friendliness and practicality
Hope this problem can be fixed soon. Customizable ssq_freqs will greatly improve its user-friendliness and practicality,.
Apart from the ssq_freqs , with a same signal sequence, when I try to change the input fs, only the output ssq_freqs is updated, while the ploted time frequency spectrum show no change.
Hello,
I have a known set of frequencies that I am most interested in evaluating the synchrosqueezed CWT of a signal for. Let's say this frequency vector
f_vect
is defined as:f_vect = 10**(np.arange(np.log10(fmin), np.log10(fmax), log_fstep))
I was hoping to provide this f_vect as the
ssq_freqs
optional input to thessq_cwt()
function, so as to get an output CWT whose columns match the time samples of a given signal and whose rows correspond to the desired frequencies (or scales that map directly to my given frequency vector). In pseudo-code, this would look like:But instead, the shape of the SSQ_CWT array is the default shape of
( len(scales), len(data) )
, rather than my expected( len(f_vect), len(data) )
. As I understood the documentation, passing a np.ndarray into thessq_freqs
option should map the CWT scales onto the desired synchrosqueeze frequencies. What am I missing here?