Closed OverLordGoldDragon closed 3 years ago
I see this paper's possibly main rationale (though unstated) for ssqueezing according to a Lebesgue measure (ones(Sx.shape)
): stability. The STFT implementation takes FFTs along columns rather than rows; this creates extreme sensitivity to imperfections in the phase transform: for a given column, values in rows plot into wavelet-like oscillations, meaning upon summation (ssqueezing), exclusion of even a single value greatly impacts final value in a given Tx
location.
I've verified this with a perfectly set up pure sinusoid (no shadow frequencies); perhaps the remedy is in also using a perfect window, but this many perfections are hardly realistic (or generalizable). Since Lebesgue sets all values in Sx
to 1
, exclusion of any one value is no big deal, and we see a dramatic improvement:
lebesgue
's main strength is also its main weakness: values away from ridge (STFT max row) are (as should be) much smaller, but are counted as equals, which exacerbates noise energy and general perturbations. A simple compromise, then, is to sum abs(Sx)
- which seems to work ideally:
Problem is, we may lose invertibility, but not necessarily by a lot. I've yet to gauge effectiveness for other kinds of signals.
'Modified' STFT solves the problem quite neatly.
FEATURES:
stft
,istft
,ssq_stft
, andissq_stft
implemented and validatedutils.py
:buffer
,unbuffer
,window_norm
,window_resolution
, andwindow_area
numba.njit
withnumba.jit(nopython=True, cache=True)
, accelerating recomputingBREAKING:
cwt()
no longer returnsx_mean
padsignal
now only returns padded input by default;get_params=True
for old behaviorphase_cwt
&phase_cwt_num
fromssqueezing
to_ssq_cwt
cwt
andstft
will be changed to haveWx, dWx
andSx, dSx
, andssq_cwt
andssq_stft
to haveTx, Wx
andTx, Sx
MISC:
wavelet
positional argument incwt
is now a keyword argument that defaults to'morlet'
padsignal(padtype='wrap')