Coding wavelets the easy way

Recursion of the decomposition/reconstruction scheme


If the following diagram yields perfect reconstruction

reconstruct

then the following diagram also yields perfect reconstruction

Bancs de filtres récursifs

Indeed, the subsystem in the red rectangle yields perfect reconstruction, by recursion, the whole diagram does.
We now observe a dissymmetry in this recursion: the filter g is used twice (at each level of recursion, actually) to produce two outputs, while h (used twice in series) yields one output. There must be a difference between the two filters.
In fact, h is a discrete low pass filter, and g a discrete band pass filter. The idea behind that lies in the Littlewood-Paley decomposition: without going into deep mathematical details, and switching to continuous time, the Littlewood-Paley decomposition uses a low pass filter γ with a transfer that looks like

LowPass

and a band pass filter β with transfer

BandPass

such that the sum of their transfers is actually a dilation of the transfer of the low pass γ with a factor 2. Recursively, we can build a low pass filter γn whose transfer has value 1 on an interval that can be arbitrary large; this done by adding to the filter γ successive dilations by powers of 2 of the filter β.
This idea (and others, including translation in time) was developed by Yves Meyer when he built the first modern wavelets with a theoretical background; since then, a considerable effort has been made to transform frequency scaling into time scaling (which is not a problem, actually) and switching from compactly supported functions in the Fourier domain to compactly supported functions in the time domain (the two properties being mutually exclusive).
A consequence of this work is that we can implement discrete wavelet transforms with Mallat's algorithm using compactly supported wavelets, which means, for us, FIR filters.

What we shall do


Beyond the mathematical explanation, we shall implement the recursive scheme above for an unlimited number of scales.