This example shows how to take analysis and synthesis filters associated with a biorthogonal wavelet and make them compatible with Wavelet Toolbox™. Wavelet Toolbox requires that analysis and synthesis lowpass and highpass filters have equal even length. This example uses the nearly orthogonal biorthogonal wavelets based on the Laplacian pyramid scheme of Burt and Adelson (Table 8.4 on page 283 in [1]). The example also demonstrates how to examine properties of the biorthogonal wavelets.

Define the analysis and synthesis filter coefficients of the biorthogonal wavelet.

`Hd`

and `Gd`

are the lowpass and highpass analysis filters, respectively. `Hr`

and `Gr`

are the lowpass and highpass synthesis filters. They are all finite impulse response (FIR) filters. Confirm the lowpass filter coefficients sum to `sqrt(2)`

and the highpass filter coefficients sum to 0.

The *z*-transform of an FIR filter $$h$$ is a Laurent polynomial $$h(z)$$ given by $$h(z)=\sum _{k={k}_{b}}^{{k}_{e}}{h}_{k}{z}^{-k}$$. The degree $$|h|$$ of a Laurent polynomial is defined as $$|h|={k}_{e}-{k}_{b}$$. Therefore, the length of the filter $$h$$ is $$1+|h|$$. Examine the Laurent expansion of the scaling and wavelet filters.

PHd =
laurentPolynomial with properties:
Coefficients: [-0.0707 0.3536 0.8485 0.3536 -0.0707]
MaxOrder: 2

PHr =
laurentPolynomial with properties:
Coefficients: [-0.0152 -0.0758 0.3687 0.8586 0.3687 -0.0758 -0.0152]
MaxOrder: 3

PGd =
laurentPolynomial with properties:
Coefficients: [0.0152 -0.0758 -0.3687 0.8586 -0.3687 -0.0758 0.0152]
MaxOrder: 3

PGr =
laurentPolynomial with properties:
Coefficients: [-0.0707 -0.3536 0.8485 -0.3536 -0.0707]
MaxOrder: 2

Since the filters are associated with biorthogonal wavelet, confirm $$PHd(z)\phantom{\rule{0.16666666666666666em}{0ex}}\phantom{\rule{0.16666666666666666em}{0ex}}PHr(z)+PG(z)\phantom{\rule{0.16666666666666666em}{0ex}}\phantom{\rule{0.16666666666666666em}{0ex}}PGr(z)=2$$.

ans =
laurentPolynomial with properties:
Coefficients: 2
MaxOrder: 0

Wavelet Toolbox™ requires that filters associated with the wavelet have even equal length. To use the Laplacian wavelet filters in the toolbox, you must include the missing powers of the Laurent series as zeros.

The degrees of `PHd`

and `PHr`

are 4 and 6, respectively. The minimum even-length filter that can accommodate the four filters has length 8, which corresponds to a Laurent polynomial of degree 7. The strategy is to prepend and append 0s as evenly as possible so that all filters are of length 8. Prepend 0 to all the filters, and then append two 0s to `Hd`

and `Gr`

.

You can examine properties of the biorthogonal wavelets by creating DWT filter banks. Create two custom DWT filter banks using the filters, one for analysis and the other for synthesis. Confirm the filter banks are biorthogonal.

fb: isOrthogonal = 0 isBiorthogonal = 1

fb2: isOrthogonal = 0 isBiorthogonal = 1

Plot the scaling and wavelet functions associated with the filter banks at the coarsest scale.

Compute the filter bank framebounds.

analysisLowerBound = 0.9505

analysisUpperBound = 1.0211

synthesisLowerBound = 0.9800

synthesisUpperBound = 1.0528