My problem is pretty basic but fundamental. It relates to the way discrete wavelet transform behaves for biorothognal 4.4 or CDF wavelets. When using most wavelets (e.g., CDF 9/7 or bio4.4 or Daubechies higher order wavelets) the size of the returned approximation and detail matrices is not a power of two. For my application (Embedded Zero Tree compression), this presents a problem because I want to construct a quad tree decomposition of the transformed image which requires all decompositions (LL, LH, HL and HH) to be of size a power of two. For example, consider the Mathematica code:
data = RandomReal[{0, 1}, {16, 16}];
dwd = DiscreteWaveletTransform[data, CDFWavelet[]];
dwd["Dimensions"]
(*output*)
{{0} -> {12, 12}, {1} -> {12, 12}, {2} -> {12, 12}, {3} -> {12,
12}, {0, 0} -> {10, 10}, {0, 1} -> {10, 10}, {0, 2} -> {10,
10}, {0, 3} -> {10, 10}, {0, 0, 0} -> {9, 9}, {0, 0, 1} -> {9,
9}, {0, 0, 2} -> {9, 9}, {0, 0, 3} -> {9, 9}, {0, 0, 0, 0} -> {9,
9}, {0, 0, 0, 1} -> {9, 9}, {0, 0, 0, 2} -> {9, 9}, {0, 0, 0,
3} -> {9, 9}}
Here the dimensions of various decomposition levels is given as rules, e.g., $\{1\}\rightarrow \{12, 12\}$ means that the first LH decomposition matrix is of size $12 \times 12$.
What should I do? Should I simply truncate the matrices to nearest 2's power? or something else.