Advanced maths

Discrete wavelet transform calculator with inverse reconstruction

This discrete wavelet calculator decomposes a real signal into approximation and detail bands using orthonormal periodic filter banks.

Your numbers

Power-of-two count 2–256.
Each active band must fit the selected filter.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

This discrete wavelet calculator decomposes a real signal into approximation and detail bands using orthonormal periodic filter banks. Haar and four-tap db2 are supported. Each selected level transforms only the approximation band from the previous level, and synthesis reverses the complete chain without discarding coefficients.

THE FORMULAa[j]=Σh[k]x[(2j+k) mod n]; d[j]=Σ(−1)^k h[L−1−k]x[(2j+k) mod n].

A worked example

For Haar samples 1,1,3,3, the first approximation is sqrt(2),3sqrt(2) and both first-level details are zero. The next level gives approximation four and detail −two under this page’s declared sign convention. The coefficient energy is 16+4=20, equal to 1+1+9+9.

Good to know

Circular periodic boundary convention only, real power-of-two sample lengths 2–256. The active signal at every level must be at least the filter length. Sign and phase may differ from other software. No denoising, compression threshold, continuous wavelet transform or automatic padding.

A level separates scale rather than identifying a physical frequency

Haar combines neighboring samples into a scaled sum and difference. Repeating the operation on the sums produces a hierarchy of coarser descriptions. Detail bands retain the information removed from the approximation at each stage, so a full coefficient collection represents the same data as the original signal.

The db2 choice uses a longer four-tap filter and supports a different balance between localization and smoothness. It cannot be decomposed down to a two-sample active band with this implementation. The level validation follows the actual filter length rather than assuming every wavelet can use every Haar decomposition depth.

Two Haar levels retain the sample energy in separate bandsSamples: 1, 1, 3, 3A1: √2, 3√2D1: 0, 0A2 = 4; D2 = −24² + (−2)² = 20
Samples (1,1,3,3) produce first approximation (sqrt(2),3sqrt(2)), zero first details, final approximation 4 and second detail −2. Energy is 20 in either representation.

The Discrete Fourier transform calculator for complex sequences covers a related task. This page focuses on discrete wavelet transform calculator with inverse reconstruction with the method limits and worked example described below.

Boundary and phase conventions are part of the result

Indices wrap modulo the current band length. This joins the last signal sample to the first and can create a boundary discontinuity when the original series is not periodic. It is a deliberate mathematical extension rule, not a claim that the measured process repeats forever.

Other libraries may reverse a filter, shift the starting index or flip detail signs. Such coefficients can be equally valid when paired with the matching synthesis convention. The formula printed here defines the exact operation, allowing comparison through reconstructed samples and energy instead of relying on an unexplained coefficient ordering.

Reconstruction and energy provide independent checks

The inverse distributes each approximation and detail coefficient through the transpose of its analysis filters, then reverses the level order. The maximum sample difference reports roundoff in that round trip. Since no thresholding occurs, a material discrepancy indicates a failed transform rather than intended information loss.

Orthonormality also preserves the squared Euclidean norm. The result includes both input energy and the sum of squares across every detail band plus the final approximation. This differs from the discrete Fourier transform, which expands the signal in global sinusoids instead of a multiscale localized basis.

A few questions, answered

Does this remove noise?

No. It exposes bands and reconstructs them unchanged. Thresholding needs a separate, justified noise model.

Why do detail signs differ from my software?

Filter orientation and phase conventions differ; compare the declared formulas and reconstruction.

Find your calculator

Start typing to explore the library.