Wavelet Transform Pass Node

Wavelet Denoising via Multi-Scale Decomposition — Series Input

AdvancedSignal ProcessingPass

Overview

The Wavelet Transform Pass Node decomposes a series input into multiple frequency scales using a discrete wavelet transform (DWT), then reconstructs the signal with high-frequency detail coefficients zeroed out — effectively a multi-scale low-pass filter with superior frequency selectivity compared to simple moving averages.

The wavelet approach is time-frequency localized: unlike a Fourier transform (which uses infinite sinusoids), wavelets have compact support and can identify short-duration high-frequency events. By discarding detail coefficients at the finest levels, the node produces a denoised signal that better preserves trend structure than traditional smoothing.

Algorithm

For each rolling window of 2^level bars:
1. Apply DWT (Haar/Daubechies-4) to produce approximation + detail coefficients at each level
2. Zero out detail coefficients at the finest decomposition levels
3. Reconstruct signal from approximation + remaining detail coefficients (IDWT)
4. Output the last reconstructed value for the current bar
Output: denoised values aligned to input. No fixed warm-up — uses a rolling window of 2^level bars.
level=4 → 16-bar window; level=5 → 32-bar window; level=6 → 64-bar window.

Parameters

ParameterDefaultDescription
level4Number of decomposition levels; window size = 2^level bars (e.g., level=4 → 16 bars)

Inputs & Outputs

SlotDirectionTypeDescription
inputInput{ values, timestamps }Any numeric series to denoise
valuesOutput(number | null)[]Wavelet-denoised (reconstructed) values aligned to input
timestampsOutputnumber[]Unix timestamps aligned to input

Use Cases

Multi-Scale Denoising

Apply Wavelet Transform Pass to price or volume series before indicator calculation. By removing fine-scale noise while preserving coarse trends, downstream indicators generate cleaner signals with fewer false crossovers and oscillations.

Trend Extraction at Different Scales

By using different levels (level=3 for short-term, level=6 for long-term), extract trend components at multiple scales simultaneously — enabling a multi-timeframe analysis within a single timeframe dataset using frequency decomposition rather than resampling.

Anomaly Detection via Residual

Subtract the wavelet-denoised output from the original series to get the high-frequency residual — the "noise" component. Sudden spikes in this residual indicate unusual micro-structure events (news, liquidity shocks) that may precede larger moves.

Tips & Best Practices

Level Determines Window Size

Each increment in level doubles the window size: level=3 → 8 bars, level=4 → 16 bars, level=5 → 32 bars. Choose level based on the frequency of noise you want to remove vs. the trend scale you want to preserve. Higher levels remove more noise but introduce more lag.

Boundary Effects at Start

The rolling window wavelet introduces artifacts in the first 2^level bars of the output — outputs during initial warm-up may be less accurate than steady-state. For level=4, discard or discount the first 16 bars of output when backtesting.

Combine with Kalman for Best Results

Wavelet denoising is a batch operation over a window; Kalman smoothing is purely recursive. For maximum denoising quality, apply Wavelet Transform Pass first, then feed its output into Kalman Smoother Pass — the combined filter removes both periodic and random noise components.

Related Indicators