Skip to main content

Transforms Guide

This guide explains the major transforms implemented in IronWave, their properties, and when to choose each one.

It is organized by transform family:

  • Discrete wavelet transforms: DWT, MODWT, SWT, WPT.
  • Continuous transforms: CWT and dual-tree CWT.
  • Adaptive methods: EMD and EEMD.

For the math details, see MATHEMATICAL_VALIDATION.md. For streaming-specific notes, see STREAMING_SUPPORT.md.


1. Discrete Wavelet Transform (DWT)

What it does

The DWT decomposes a signal into approximation and detail coefficients at successively coarser scales, with downsampling by 2 at each level. It is critically sampled: the total number of coefficients equals the signal length (up to boundary effects).

Key properties

  • Critically sampled (no redundancy).
  • Fast (O(N) per level).
  • Shift-variant: small shifts in the input can change coefficients significantly.
  • Supports multiple boundary modes (Periodic, Symmetric, Zero, Constant, Reflect).

When to use

  • Compression or compact representations.
  • Situations where you care most about computational efficiency.
  • Educational or exploratory work where shift variance is acceptable.

Cautions

  • With non-periodic boundaries and certain wavelets (e.g., Db4) at higher levels, reconstruction and energy behavior can be complex; MODWT is generally safer for robust analysis.

2. Maximal Overlap DWT (MODWT)

What it does

MODWT is a non-decimated version of the DWT:

  • No downsampling; coefficient sequences remain the same length as the input.
  • Shift-invariant and suitable for any signal length.

Key properties

  • Redundant: redundancy grows with the number of levels.
  • Shift-invariant: better for interpretation and scaling analysis.
  • Works naturally with any length; boundary effects are easier to manage.
  • In IronWave, MODWT is the basis for:
    • Volatility estimation.
    • Hurst exponent and multifractal analysis (via wavelet variance and leaders).

When to use

  • Financial time series analysis (volatility, correlation, jumps).
  • Any application where phase / alignment matters.
  • Multiscale variance and scaling analysis.

Cautions

  • You must account for MODWT’s normalization when using wavelet variances; the library’s multifractal code applies the appropriate 2^j correction internally.

3. Stationary Wavelet Transform (SWT)

What it does

SWT is another redundant, shift-invariant transform (often described as the “à trous” algorithm):

  • Filter coefficients are upsampled at each level.
  • No decimation; outputs remain aligned with the input.

Key properties

  • Redundant and shift-invariant.
  • Often used for denoising and feature-preserving analysis.
  • Slightly different redundancy pattern than MODWT but conceptually similar.

When to use

  • Denoising where you want robust, shift-invariant coefficients.
  • Pattern detection where alignment and redundancy are helpful.

Cautions

  • Redundancy and computational cost can become significant for many levels; MODWT is often a good alternative for financial signals.

4. Wavelet Packet Transform (WPT)

What it does

WPT generalizes the DWT by decomposing both approximation and detail branches, creating a full binary tree of subbands. A best-basis procedure can be used to select an optimal subset of nodes.

Key properties

  • Flexible frequency tiling; not restricted to octave bands.
  • Tree structure enables rich frequency decompositions.
  • Best-basis selection can be based on cost functions (e.g., entropy).

When to use

  • Detailed frequency/microstructure analysis, especially when octave bands are too coarse.
  • Research-type work where you want to explore signal energy across a richer frequency partition.

Cautions

  • More configuration and interpretation complexity than DWT/MODWT.
  • No streaming WPT; it is a batch operation in IronWave.

5. Continuous Wavelet Transform (CWT)

What it does

CWT computes wavelet coefficients at many scales and positions, providing a time–frequency representation. With complex wavelets (e.g., Morlet) you can extract both magnitude and phase.

Key properties

  • Provides dense time–frequency information.
  • Redundant; not designed for minimal representations.
  • Edge effects and scale selection require care.
  • Implemented in IronWave with both direct and FFT-based variants (cwt and cwt_fft).

When to use

  • Exploratory time–frequency analysis and visualization.
  • Precursor to wavelet coherence (coherence uses CWT outputs).
  • Phase analysis and lead–lag relationships (with complex wavelets).

Implementation and performance

  • For small/medium signals and modest scale counts, direct CWT is fine.
  • For larger signals and many scales, the FFT-based implementation is preferred.
  • The coherence module includes a heuristic that automatically switches to cwt_fft when beneficial.

Cautions

  • CWT is batch-only in IronWave; streaming CWT variants are not implemented (see STREAMING_SUPPORT.md).

6. Dual-Tree CWT

What it does

The dual-tree complex wavelet transform uses pairs of filter banks to produce approximately shift-invariant and directional complex wavelet coefficients.

Key properties

  • Better directional sensitivity and phase properties than a single complex wavelet transform.
  • Particularly useful in multidimensional settings and for directional analysis.

When to use

  • Applications where phase and direction are important (e.g., some 2D or multi-channel problems).
  • Advanced time–frequency analysis where you want improved shift invariance.

7. EMD and EEMD

What they do

  • EMD (Empirical Mode Decomposition) decomposes a signal into Intrinsic Mode Functions (IMFs) based on local extrema and sifting.
  • EEMD (Ensemble EMD) improves robustness by averaging multiple EMD runs with added noise.

Key properties

  • Fully adaptive; no pre-selected basis or wavelet family.
  • Good for strongly non-stationary, nonlinear signals.
  • More computationally intensive than wavelet transforms.

When to use

  • When the underlying process is very nonlinear and standard wavelets are not capturing important structure.
  • When instantaneous frequency via Hilbert–Huang analysis is desired.

Cautions

  • Batch-only; EMD is not practical for tick-by-tick streaming (see STREAMING_SUPPORT.md).
  • Interpretation of IMFs can require domain expertise.

8. Summary Table

TransformRedundantShift-invariantStreaming supportTypical use
DWTNoNoYes (StreamingDWT)Compression, fast multi-scale analysis
MODWTYesYesYes (StreamingMODWT)Financial time series, scaling, volatility
SWTYesYesYes (StreamingSWT)Denoising, robust pattern analysis
WPTNo (per basis)NoNoDetailed frequency/microstructure analysis
CWTYesApprox.NoTime–frequency analysis, coherence
Dual-tree CWTYesApprox.NoDirectional/phase-sensitive analysis
EMD/EEMDN/AN/ANoNonlinear, non-stationary decomposition

For guidance on combining these transforms with specific wavelet families and advanced analysis modules, see docs/WAVELET_FAMILIES.md and docs/ADVANCED_ANALYSIS.md.