SOURCE. Daubechies, I. (1992), Ten Lectures on Wavelets, CBMS-NSF
Regional Conference Series in Applied Mathematics 61, SIAM;
doi:10.1137/1.9781611970104. Chapter 5 is the multiresolution analysis
and the pyramid (Mallat) algorithm it implies: with scaling filter h
and quadrature mirror g_k = (-1)^k h_{L-1-k}, one level of the periodic
decomposition of a length-M sequence is
a_{j+1}[i] = sum_k h_k a_j[(2i+k) mod M] and
d_{j+1}[i] = sum_k g_k a_j[(2i+k) mod M], i = 0 ... M/2-1, repeated on
the approximation. The filters are those of Daubechies (1988),
doi:10.1002/cpa.3160410705, taken from Wave rather than
re-derived; that module carries the algebraic checks on them.
Value
List with details, approximation,
coefficients, energies, approximation_energy,
reconstruction, reconstruction_error, h,
g, n, level.
Details
The synthesis step is the exact adjoint,
a_j[(2i+k) mod M] += h_k a_{j+1}i + g_k d_{j+1}i, which
reconstructs exactly because analysis is orthonormal.
reconstruction_error is max |x - synth(analyse(x))|.
SCOPE. Periodic (circular) boundary handling only, and signal length a power of two. Both are this implementation's scope choices.
References
Daubechies, I. (1992). Ten Lectures on Wavelets. SIAM. doi:10.1137/1.9781611970104. Daubechies, I. (1988). Communications on Pure and Applied Mathematics 41(7):909-996. doi:10.1002/cpa.3160410705.
Examples
Wvltdb(c(1, 2, 3, 4, 5, 6, 7, 8), 2, "db1")$reconstruction_error
#> [1] 4.440892e-15
