# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# dbaux

Daubechies wavelet filter computation

The `dbaux` function generates the scaling filter coefficients for the "extremal phase" Daubechies wavelets.

## Syntax

``W = dbaux(N)``
``W = dbaux(N,SUMW)``

## Description

````W = dbaux(N)` is the order `N` Daubechies scaling filter such that ```sum(W) = 1```. NoteInstability may occur when `N` is too large. Starting with values of `N` in the 30s range, function output will no longer accurately represent scaling filter coefficients. ```

example

````W = dbaux(N,SUMW)` is the order `N` Daubechies scaling filter such that ```sum(W) = SUMW```. `W = dbaux(N,0)` is equivalent to ```W = dbaux(N,1)```.```

## Examples

collapse all

This example shows how to determine the Daubechies extremal phase scaling filter with a specified sum. The two most common values for the sum are and 1.

Construct two versions of the `db4` scaling filter. One scaling filter sums to and the other version sums to 1.

```NumVanishingMoments = 4; h = dbaux(NumVanishingMoments,sqrt(2)); m0 = dbaux(NumVanishingMoments,1);```

The filter with sum equal to is the synthesis (reconstruction) filter returned by `wfilters` and used in the discrete wavelet transform.

```[LoD,HiD,LoR,HiR] = wfilters('db4'); max(abs(LoR-h))```
```ans = 4.2636e-13 ```

For orthogonal wavelets, the analysis (decomposition) filter is the time-reverse of the synthesis filter.

`max(abs(LoD-fliplr(h)))`
```ans = 4.2636e-13 ```

This example demonstrates that for a given support, the cumulative sum of the squared coefficients of a scaling filter increase more rapidly for an extremal phase wavelet than other wavelets.

First, set the order to 15 and generate the scaling filter coefficients for the Daubechies wavelet and Symlet. Both wavelets have support of length 29.

```n = 15; [~,~,LoR_db,~] = wfilters('db15'); [~,~,LoR_sym,~] = wfilters('sym15');```

Next, generate the scaling filter coefficients for the order 5 Coiflet. This wavelet also has support of length 29.

`[~,~,LoR_coif,~] = wfilters('coif5');`

Confirm the sum of the coefficients for all three wavelets equals .

`sqrt(2)-sum(LoR_db)`
```ans = 2.2204e-16 ```
`sqrt(2)-sum(LoR_sym)`
```ans = -4.4409e-16 ```
`sqrt(2)-sum(LoR_coif)`
```ans = 2.2204e-16 ```

Plot the cumulative sums of the squared coefficients. Note how rapidly the Daubechies sum increases. This is because its energy is concentrated at small abscissas. Since the Daubechies wavelet has extremal phase, the cumulative sum of its squared coefficients increases more rapidly than the other two wavelets.

```plot(cumsum(LoR_db.^2),'rx-') hold on plot(cumsum(LoR_sym.^2),'mo-') plot(cumsum(LoR_coif.^2),'b*-') legend('Daubechies','Symlet','Coiflet') title('Cumulative Sum')```

## Input Arguments

collapse all

Order of Daubechies scaling filter, specified as a positive integer.

Data Types: `single` | `double`

Sum of coefficients, specified as a positive scalar. Set to `sqrt(2)` to generate vector of coefficients whose norm is 1.

Data Types: `single` | `double`

## Output Arguments

collapse all

Scaling filter coefficients returned as a vector.

The scaling filter coefficients satisfy a number of properties. As the example Daubechies Extremal Phase Scaling Filter with Specified Sum demonstrates, you can construct scaling filter coefficients with a specific sum. If {hk} denotes the set of order `N` Daubechies scaling filter coefficients, where n = 1, ..., 2N, then $\sum _{n=1}^{2N}{h}_{n}^{2}=1.$ The coefficients also satisfy the relation ${\sum }_{n}h\left(n\right)h\left(n-2k\right)=\delta \left(k\right).$ You can use these properties to check your results.

## Limitations

• The computation of the `dbN` Daubechies scaling filter requires the extraction of the roots of a polynomial of order `4N`. Instability may occur beginning with values of `N` in the 30s.

collapse all

### Extremal Phase

Constructing a compactly supported orthogonal wavelet basis involves choosing roots of a particular polynomial equation. Different choices of roots will result in wavelets whose phases are different. Choosing roots that lie within the unit circle in the complex plane results in a filter with highly nonlinear phase. Such a wavelet is said to have extremal phase, and has energy concentrated at small abscissas. Let {hk} denote the set of scaling coefficients associated with an extremal phase wavelet, where k = 1,...,N. Then for any other set of scaling coefficients {gk} resulting from a different choice of roots, the following inequality will hold for all J = 1,...,N:

`$\sum _{k=1}^{J}{g}_{k}^{2}\le \sum _{k=1}^{J}{h}_{k}^{2}$`
The inequality is illustrated in the example Extremal Phase. The {hk} are sometimes called a minimal delay filter [2].

## Algorithms

The algorithm used is based on a result obtained by Shensa [3], showing a correspondence between the “Lagrange à trous” filters and the convolutional squares of the Daubechies wavelet filters.

The computation of the order N Daubechies scaling filter w proceeds in two steps: compute a “Lagrange à trous” filter P, and extract a square root. More precisely:

• P the associated “Lagrange à trous” filter is a symmetric filter of length 4N-1. P is defined by

P = [a(N) 0 a(N-1) 0 ... 0 a(1) 1 a(1) 0 a(2) 0 ... 0 a(N)]

• where

• Then, if w denotes dbN Daubechies scaling filter of sum , w is a square root of P:

P = `conv`(`wrev`(w),w) where w is a filter of length 2N.

The corresponding polynomial has N zeros located at −1 and N−1 zeros less than 1 in modulus.

Note that other methods can be used; see various solutions of the spectral factorization problem in Strang-Nguyen [4] (p. 157).

## References

[1] Daubechies, I. Ten Lectures on Wavelets, CBMS-NSF conference series in applied mathematics, SIAM Ed., 1992.

[2] Oppenheim, Alan V., and Ronald W. Schafer. Discrete-Time Signal Processing. Englewood Cliffs, NJ: Prentice Hall, 1989.

[3] Shensa, M.J. (1992), “The discrete wavelet transform: wedding the a trous and Mallat Algorithms,” IEEE Trans. on Signal Processing, vol. 40, 10, pp. 2464-2482.

[4] Strang, G., and T. Nguyen.Wavelets and Filter Banks. Wellesley, MA: Wellesley-Cambridge Press, 1996.