Module sswt
Expand description
Synchrosqueezed Wavelet Transform (SST / SSWT).
SST (Daubechies, Lu & Wu, Applied and Computational Harmonic Analysis,
2011) reassigns the energy of a Continuous Wavelet Transform from the
scale axis onto an instantaneous-frequency axis derived from the local
CWT phase. The result is a time-frequency representation that sharpens
ridges much like reassignment, but — uniquely among reassignment-type
transforms — admits a clean ridge-based reconstruction because of the
a^{-3/2} Jacobian weight (Daubechies-Lu-Wu, §3). On signals composed of
well-separated mode-type components SST has been proved to converge to
the true instantaneous frequency as the wavelet bandwidth shrinks, which
makes it the wavelet-side analog of EMD with rigorous theory backing it.
The pipeline is
- Compute the CWT
W(a, b)viacrate::transform::cwt_fft. - Form the one-step forward phase-difference
C(a, b) = W(a, b+1) · conj(W(a, b))(backward fallback atb = n−1). - For each
(a, b)with|W(a, b)| > γ, take the instantaneous frequencyω̂(a, b) = −arg(C(a, b)) · fs / (2π)in Hz (the leading minus accounts for ferro-wave’sΣ x[t]·ψ(t−b)CWT convention). This covers(−fs/2, fs/2)without aliasing. Cells belowγare masked asf64::NANand excluded from the reassignment sum. - Sum
T(ω_ℓ, b) = Σ_{a : ω̂(a,b) ∈ bin ℓ} W(a, b) · a^{-3/2} · Δaover the frequency grid{ω_ℓ}.
Two free functions accompany the transform:
sswt_extract_ridgetracks the dominant frequency ridge in time using a greedy max-energy walk inside a per-step±band_widthwindow. The walk seeds at the global SST argmax and walks both directions from there (robust to CWT edge artifacts). This is not the Carmona-Hwang-Torrésani optimal ridge — that is scoped as a follow-up. The greedy variant is sufficient for single-component signals and for the acceptance tests in issue #35.sswt_extract_componentinverts SST along a ridge by summingT(ω_ℓ, b)across±band_widthneighboring frequency bins and dividing by the wavelet’s SST inversion constantR_ψ = ∫₀^∞ Ψ̂*(ω) dω / ω(seesuper::cwt::ContinuousWavelet::sst_inversion_constant). This yields an EMD-like single component reconstructed from one ridge.
§Why one-step discrete phase-difference
Three candidate IF estimators on W(a, b) and the trade-offs that
pin our choice:
- Centered finite-diff of
W, thenIm((∂_b W)/W) / (2π)— has a multiplicativesinc(f/fs)bias that becomes visible well below Nyquist (~6% atf/fs = 1/10). - Centered two-step phase product
arg(W[b+1]·conj(W[b−1])) / (2·Δt)— bias-free butargaliases at|f| > fs/4(the two-step baseline limits the unambiguous range to half-Nyquist). - One-step forward phase product
arg(W[b+1]·conj(W[b])) / Δt— bias-free and unambiguous up to full Nyquist (only the one-sample baseline keeps the principal-value range from wrapping). This is the form used here.
Differencing arg W along b and unwrapping is a fourth option, but
atan2 unwrap fails precisely where SST cares most — near |W| ≈ γ,
where phase jumps by random multiples of 2π. All three phase-product
forms above sidestep unwrap entirely.
§Gamma default
SSWTConfig::gamma is Option<f64>. When None, sswt resolves it
to 1e-6 · ‖x‖₂, where ‖x‖₂ = sqrt(Σ x[i]²) is computed once over
signal.data() before the CWT. The resolved value is exposed on
SSWTResult::gamma_used for diagnostics and regression pinning. The
amplitude-scaled form is sample-rate / amplitude invariant; the bare
literal 1e-6 would fail catastrophically on signals with very small or
very large amplitudes.
§Out of scope (deferred follow-ups)
- Carmona-Hwang-Torrésani optimal-ridge extractor.
- Multi-component simultaneous ridge tracking.
- Full inverse SST (
isswt) integrating over all bins. - Second-order SST (Oberlin 2015) and time-rescaling variants.
- Serde deserialize of
SSWTConfig— the boxeddynwavelet prevents derive-basedDeserialize; serde derives are omitted on the config and present only on the result types.
§References
- Daubechies, I., Lu, J., & Wu, H.-T. (2011). Synchrosqueezed wavelet transforms: An empirical mode decomposition-like tool. Applied and Computational Harmonic Analysis, 30(2), 243–261. https://doi.org/10.1016/j.acha.2010.08.002 — the canonical paper.
- Thakur, G., Brevdo, E., Fučkar, N. S., & Wu, H.-T. (2013). The synchrosqueezing algorithm for time-varying spectral analysis: robustness properties and new paleoclimate applications. Signal Processing, 93(5), 1079–1094. https://doi.org/10.1016/j.sigpro.2012.11.029 — robustness analysis.
- Auger, F., Flandrin, P., Lin, Y.-T., McLaughlin, S., Meignen, S., Oberlin, T., & Wu, H.-T. (2013). Time-frequency reassignment and synchrosqueezing: An overview. IEEE Signal Processing Magazine, 30(6), 32–41. https://doi.org/10.1109/MSP.2013.2265316.
Structs§
- Greedy
Ridge Config - Configuration for
sswt_extract_ridge. - SSWT
Config - Configuration for
sswt. - SSWT
Plan - Reusable SSWT execution plan.
- SSWT
Plan Options - Options for building an
SSWTPlan. - SSWT
Result - Result of
sswt.
Enums§
- SSWT
Plan Memory Mode - Planned SSWT memory/performance policy.
Functions§
- sswt
- Forward Synchrosqueezed Wavelet Transform.
- sswt_
extract_ component - Reconstruct an EMD-like time-domain component from a ridge.
- sswt_
extract_ ridge - Greedy max-energy ridge extractor over time.
- sswt_
into - Forward SST writing into a caller-supplied result. Reuses every Vec in
out(coefficients,frequencies,instantaneous_frequency,time), so rolling-window callers can amortize their cost across windows. Scalar metadata fields are overwritten unconditionally.