I want to implement db2 to db20. Is there a specific formula for the wavelet function coefficients, which determine its shape and properties? How about the associated scaling function?
1 Answers
The scaling/refinement equation is $$\phi(x)=2\sum a_k\phi(2x-k).$$ For the (Laurent) polynomial $a(z)=\sum a_kz^k$ the integrability of $\phi$ requires $a(1)=1$. To get some degree of smoothness requires $a(z)=2^{-A}(1+z)^Ap(z)$ for some $A>0$.
Orthogonality of the integer-shifted copies of the scaling function requires $$ a(z)a(z^{-1})+a(-z)a(-z^{-1})=1. $$
One implication is that if $x=(-z+2-z^{-1})/4$ and $p_2(x)=p(z)p(z^{-1})$, then $$ (1-x)^Ap_2(x)=1+O(x^A)\implies p_2(x)=\sum_{k=0}^{A-1}\binom{A+k-1}{A-1}x^k $$ for the minimal variant.
Now reverse this construction, determine the roots of $p_2(x)$, from that the roots of the quadratic equation between $z$ and $x$, collect the ones with $|z|>1$ as roots from $p(z)$, normalize to $p(1)=1$, construct $a(z)$ as product.
Construct the wavelet filter as $b(z)=\pm z^Ka(-z^{-1})$ with sign and shift $K$ according to design requirements.
Example $A=2$. Then $p_2(x)=1+2x$, with root $x=-\frac12=-\frac14(z-2+z^{-2}$ or $0=z^2-4z+1=(z-2)^2-3$. The root outside the unit disk is $2+\sqrt3$ so $$ p(z)=\frac{z-2-\sqrt3}{1-2-\sqrt3}=\frac12((\sqrt3+1)-(\sqrt3-1)z) $$ and in consequence $$ a=\frac18((\sqrt3+1)+(\sqrt3+3)z+(-\sqrt3+3)z^2-(\sqrt3-1)z^3) $$ While for the next approximation orders an algebraic representation of the occurring roots and thus the coefficients is still possible, it becomes nearly impossible from $A=6$ onward. However, the above process can be carried out to arbitrary floating-point precision.
- 126,666