FerroWave · guides

Analysis

Denoising, coherence, and multifractal analysis primitives in ferro-wave.

Three analysis primitives sit on top of the transform layer — denoising, wavelet coherence, and multifractal / Hurst — each reading coefficients only, never the raw signal. See the sanitized analysis API for callable signatures and types.

Denoising

denoise and denoise_modwt apply Donoho–Johnstone threshold shrinkage over a DWT, MODWT, or SWT basis. Threshold-then-reconstruct preserves discontinuities — jumps and regime shifts come through intact while gaussian micro-noise is attenuated.

  • Methods — soft, hard, and garrote thresholding.
  • Rules — Universal, SURE, Minimax, and BayesShrink, validated against Donoho–Johnstone (1994).
  • Noise estimation — robust MAD scale on the finest detail level (estimate_noise_mad), pinned to scipy.
use ferro_wave::{Signal, Daubechies, DaubechiesType};
use ferro_wave::analysis::denoising::{denoise_modwt, DenoiseConfig,
    ThresholdMethod, ThresholdRule};
 
let config = DenoiseConfig {
    method: ThresholdMethod::Soft,
    rule:   ThresholdRule::Universal,
    levels: 4,
    ..DenoiseConfig::default()
};
let clean = denoise_modwt(&signal, &Daubechies::new(DaubechiesType::Db4), config)?;
# Ok::<(), ferro_wave::WaveletError>(())

Wavelet coherence

wavelet_coherence computes localized correlation between two signals across scale and time via the wavelet cross-spectrum (Liu–Torrence–Grinsted), returning coherence and phase surfaces. The per-period mean_coherence is a cross-spectral-power-weighted average.

Multifractal & Hurst

estimate_hurst_exponent fits a power-law slope to wavelet-leader scaling and returns a typed HurstResult with the Hurst exponent and a bootstrap confidence interval. H0.5H \approx 0.5 is martingale; H<0.5H < 0.5 mean-reverts; H>0.5H > 0.5 trends. The full multifractal spectrum H(q)H(q) is available via the wavelet-leader estimator.

Use it

  • Denoise — strip noise without softening the jumps.
  • Regime / Hurst — classify trending vs mean-reverting with a rolling Hurst exponent.