Closed ARBolton96 closed 3 years ago
Thanks for the report. I'm unable to reproduce the error; please include minimal code that errors.
Hello,
The below code gets the error on my machine.
import ssqueezepy as ssq import numpy as np
N = 8401 t = np.linspace(0, 10, N, endpoint=False)
xo = np.cos(2 np.pi 2 * (np.exp(t / 2.2) - 1))
fc1 = 1/80; fc2 = 1/3; df = 0.025; width = 0.07; dt = 10
iterator = np.arange(np.log10(fc1), np.log10(fc2), df) fcm = np.zeros_like(iterator)
nkfil = 0 for kfil in iterator: fc1 = 10(kfil-width) fc2 = 10(kfil+width) fcm[nkfil] = (fc2 + fc1) / 2 nkfil += 1
SSQ_Tvst, Sxo, ssq_freqs, scales = ssq.ssq_stft(xo, fs=10, t=t) # Runs
SSQ_Tvst, Sxo, ssq_freqs, scales = ssq.ssq_stft(xo, fs=dt, t=t, ssq_freqs=fcm) # Doesn't run
I noticed today that my fcm
parameter seems to be causing the issue - if I replace the parameter with iterator
, the ssq_stft
works fine. My assumption is that this is because fcm
is equally spaced in log-space, rather than linear-space. Thanks.
Confirming this is expected behavior, but should error more informatively. I've never seen nor thought of a use case for logscale ssq_stft
; could you describe the application? I might implement it in the future, but currently only linear ssq_freqs
is supported for ssq_stft
.
Note STFT will remain linear along frequencies (by definition), so you'll be reassigning a linear distribution onto an exponential.
In seismology, surface wave dispersion group velocities are often computed using frequency windows that are evenly-space in log. In all honesty though, I was completely misusing the ssq_stft
- I learned that it's not applicable to the problem I was trying to force it to solve.
windows that are evenly-space in log
This is exactly CWT (so use ssq_cwt
).
P.S. if this is an ML task, I also recommend scattering.
Hello,
You may be aware of this, and I apologize if this is redundant or if I'm using the code improperly. I upgraded from ssqueezepy 0.6.0 to 0.6.1 today but am running into an issue with
ssq_stft
input parameterssq_freqs
. I am using a numpy ndarray of frequencies of interest, but in 0.6.1 I get the following error:I did some poking around in
algos.py
and to me it looks like**params
has avlmin
anddvl
, rather than thevmin
anddv
required for the_ssq_stft
function. However, if I simply change the input parameter names to match (akavmin
-->vlmin
anddv
-->dvl
), I get the same error as above with the added errors:I wasn't sure what to do with this error. Thanks!