Two dimensional wavelet packet analysis is done with wpa2,7 synthesis with wps2. A basis can be selected with bestbas2, bestlvl2, fixlvl2, or wavbase2 (compare with the previous section ).
The data-structure returned by wpa2 is a structure with fields wp and sel (an incidence matrix as before for wpa1). If the input is a 2n by 2n matrix, these fields are 2n by 2nby n, the third index being the level.
The matrices are partitioned as follows:
Let H1 be the low-pass filter (followed by downsampling)
corresponding to
,
acting columnwise (independently on
different columns), G1 the high-pass filter corresponding to
;
H2 and G2 act row-wise.
Then the level one submatrix (i.e., wp(:,:,1)) is computed as
follows:
Figure 8 shows a two dimensional wavelet packet. The
picture is from wp2demo, which is similar to wav2demo, see
figure 4. The diagram on the left corresponds to how the
matrix is partitioned (the resolution level is selected at the
bottom). The cost function used was
.
Operators can be represented in wavelet packet bases, this is done in the demo wpoperd (compare with wavoperd in the section on fwt2). Figure 9 shows an example.