Synchrosqueezing, wavelet transforms, and time-frequency analysis in Python
MIT License
Published by OverLordGoldDragon almost 3 years ago
freq_to_scale
& scale_to_freq
, experimentalscales
nan_checks
gamma
ssq_freqs
now correctly maps frequencies to corresponding rows of Tx
for ssq_cwt
, no longer requiring [::-1]
scales
returned as 1Dextract_ridges
: ridge_f
(formerly fridge
) now returns scales
rather than log(scales)
extract_ridges
: renamed: fridge -> ridge_f
, max_energy -> ridge_e
t
& fs
astensor
to scales
, ssq_freqs
visuals
: improve xticks
& yticks
handlingexperimental
: remove phase_squeeze
, phase_transform
visuals.imshow
: default cmap='turbo'
visuals
: added auto_xlims
, squeeze
Published by OverLordGoldDragon over 3 years ago
Adds a DOI for citation purposes
Published by OverLordGoldDragon over 3 years ago
Dramatic speed and memory improvements, along other changes; see changelog.
Published by OverLordGoldDragon over 3 years ago
A massive update.
FEATURES (major)
gmw
, morsewave
in _gmw.py
)ridge_extraction.py
_test_signals.py
, and examples
_cwt.cwt_higher_order
configs.ini
, used to control function defaults globallyscales
default improved to not over-represent low frequenciesFEATURES (other)
visuals
: added wavelet_filterbank
, viz_cwt_higher_order
, viz_gmw_orders
(first callable as wavelet.viz('filterbank')
)visuals.wavelet_tf
: autopicks scale
for scale=None
to give a nice visual for any wavelet
ssq_cwt
& ssq_stft
: added arg preserve_transform
to (see docstrings)padsignal
: 2D input support, of form (n_signals, signal_length)
(i.e. will pad every row vector).cwt
: support for padtype=None
maprange
: tuple of floats now supported (help(_ssq_cwt.ssq_cwt)
)Wavelet.info()
and @property
s of Wavelet
revamped for generality; added @property
s: wc_ct
, scalec_ct
.wavelets.center_frequency
: added kind='peak-ct'
utils.find_max_scale
now simpler and more effective, guaranteeing complete spectral coverage for low frequenciesBREAKING
utils.py
-> utils/*
: common.py
, cwt_utils.py
, stft_utils.py
'morlet'
to 'gmw'
ssq_cwt(mapkind=)
default change: 'maximal'
to 'peak'
scales
default change: implicit preset
from 'maximal'
to 'minimal'
for low scales, 'maximal'
for highssq_cwt
return order change: Tx, ssq_freqs, Wx, scales, w
to Tx, Wx, ssq_freqs, scales, w, dWx
(additionally returning dWx
)ssq_stft
return order change: Tx, ssq_freqs, Sx, Sfs, dSx, w
to Tx, Sx, ssq_freqs, Sfs, w, dSx
ssqueezing
& ssq_cwt
: renamed mapkind
to maprange
difftype
: 'direct'
-> 'trig'
_infer_scaletype
-> infer_scaletype
_integrate_analytic
-> integrate_analytic
find_max_scale
-> find_max_scale_alt
, but find_max_scale
is still (but a different) functionMISC
phase_cwt
: takes abs(w)
instead of zeroing negativeswavelet
in icwt
and issq_cwt
now defaults to the default waveletcwt
: added args order
, average
stft
& ssq_stft
: added t
argumentstft
default window
increased frequency resolutionvisuals.imshow()
: cmap
now defaults to 'jet'
instead of 'bone'
for abs=True
NOTICE.txt
: added jLabsetup.py
: added short & long description, copyright, keywordsFIXES
visuals.wavelet_heatmap
: string scales
now functionalvisuals
: w
overreached into negative frequencies for odd N
in wavelet_tf
, wavelet_tf_anim
, & wavelet_heatmap
icwt
: padtype
now functionalFILE CHANGES
ssqueezepy/
added: _gmw.py
, _test_signals.py
, ridge_extraction.py
, configs.ini
, README.md
ssqueezepy/
added utils/
, split utils.py
into common.py
, cwt_utils.py
, stft_utils.py
, __init__.py
, & moved to utils/
.tests/
added: gmw_test.py
, test_signals_test.py
, ridge_extraction_test.py
examples/
added: extracting_ridges.py
, scales_selection.py
, ridge_extract_readme/
: README.md
, imgs/*
MANIFEST.in
Published by OverLordGoldDragon almost 4 years ago
FEATURES:
stft
, istft
, ssq_stft
, and issq_stft
implemented and validatedutils.py
: buffer
, unbuffer
, window_norm
, window_resolution
, and window_area
numba.njit
with numba.jit(nopython=True, cache=True)
, accelerating recomputingBREAKING:
cwt()
no longer returns x_mean
padsignal
now only returns padded input by default; get_params=True
for old behaviorphase_cwt
& phase_cwt_num
from ssqueezing
to _ssq_cwt
cwt
and stft
will be changed to have Wx, dWx
and Sx, dSx
, and ssq_cwt
and ssq_stft
to have Tx, Wx
and Tx, Sx
MISC:
wavelet
positional argument in cwt
is now a keyword argument that defaults to 'morlet'
padsignal(padtype='wrap')
CHANGELOG.md
Published by OverLordGoldDragon almost 4 years ago
Synchrosqueezing arrives to Python:
Planned for v0.6.0:
Existing users: please review code anew; too many changes to note between Prerelease 2 and v0.5.0. This changes onward, with every change explicitly tracked.
Published by OverLordGoldDragon almost 4 years ago
Wavelet
classwfiltfn
setup.py
and requirementsPublished by OverLordGoldDragon almost 4 years ago
At last, SYNCRHOSQUEEZING is here.
Relative to MATLAB repo:
scales
opts
with Pythonic argument handling*: not every argument config works. I tested every option, and marked in comments what fails to deliver "good" results (marked with # !!!
and sometimes # TODO
). Unless explicitly stating otherwise, there may be nothing to 'fix' - simply the method is flawed, or thrives in specific settings.
**: I initially didn't realize the MATLAB code was jit-compiled; will run tests to compare speed & memory use.
To-do for first release:
Note that majority of code organization is subject to change by v0.6.0. This includes args placement and defaults, variable, function, and module names, and whether wavelets are functions or class instances.
Not reviewed/validated: synsq_stft.py
, stft_transforms.py
. I don't plan on reviewing these; others are welcome to, and I'll validate changes.
Published by OverLordGoldDragon about 4 years ago
Nothing new, just creating tag for sharing persistent URL's.
To any watchers, I'm actively working on the repo, and CWT should be done soon.