Integer type:** int32**** int64**** nag_int** show int32 show int32 show int64 show int64 show nag_int show nag_int

C09 — Wavelet Transforms

This chapter is concerned with the analysis of datasets (or functions or operators) in terms of frequency and scale components using wavelet transforms. Wavelet transforms have been applied in many fields from time series analysis to image processing and the localization in either frequency or scale that they provide is useful for data compression or denoising. In general the standard wavelet transform uses dilation and scaling of a chosen function, ψ(t)$\psi \left(t\right)$, (called the mother wavelet) such that

where a$a$ gives the scaling and b$b$ determines the translation. Wavelet methods can be divided into continuous transforms and discrete transforms. In the continuous case, the pair a$a$ and b$b$ are real numbers with a>0$a>0$. For the discrete transform, a$a$ and b$b$ can be chosen as a = 2^{ − j}$a={2}^{-j}$, b = k2^{ − j}$b=k{2}^{-j}$ for integers j$j$, k$k$

ψ _{a,b}
(t)
=
1/(sqrt(a))
ψ
((t − b)/a)
$${\psi}_{a,b}\left(t\right)=\frac{1}{\sqrt{a}}\psi \left(\frac{t-b}{a}\right)$$ |

ψ _{j,k}
(t)
=
2^{j / 2}
ψ
(2^{j}t − k)
.
$${\psi}_{j,k}\left(t\right)={2}^{j/2}\psi ({2}^{j}t-k)\text{.}$$ |

The continuous real valued, one-dimensional wavelet transform (CWT) is included in this chapter. The discrete wavelet transform (DWT) at a single level together with its inverse and the multi-level DWT with inverse are also provided for one, two and three dimensions. The choice of wavelet for CWT includes the Morlet wavelet and derivatives of a Gaussian while the DWT offers the orthogonal wavelets of Daubechies and a selection of biorthogonal wavelets.

The CWT computes a time-frequency analysis of a signal, x(t)$x\left(t\right)$, which can yield high localization in time of the high frequency features present. It is defined as

where ψ^{*}${\psi}^{*}$ denotes the complex conjugate of the wavelet function, a$a$ is the dilation parameter and b$b$ is the localization parameter. (Currently only the real valued transform is offered.)

C(a,b)
=
∫ _{ − ∞}^{ + ∞}
1/(sqrt(a))
ψ^{*}
((t − b)/a)
dt
$$C(a,b)={\int}_{-\infty}^{+\infty}\frac{1}{\sqrt{a}}{\psi}^{*}\left(\frac{t-b}{a}\right)dt$$ |

The discrete wavelet transform (DWT) is defined by a mother wavelet function ψ(t)$\psi \left(t\right)$, and a related scaling function, φ(t)$\varphi \left(t\right)$, where

$$\begin{array}{c}\varphi \left(t\right)=\sum _{k}\phantom{\rule{0.25em}{0ex}}{g}_{k}\sqrt{2}\varphi (2t-k)\text{.}\\ \psi \left(t\right)=\sum _{k}\phantom{\rule{0.25em}{0ex}}{h}_{k}\sqrt{2}\varphi (2t-k)\text{.}\end{array}$$ |

These in turn are represented as a pair of filters with finite support. They can be viewed as a high pass filter, {h_{k}}$\left\{{h}_{\mathit{k}}\right\}$, for k = 1,2, … ,m$\mathit{k}=1,2,\dots ,m$, paired with a low pass filter, {g_{k}}$\left\{{g}_{\mathit{k}}\right\}$, for k = 1,2, … ,n$\mathit{k}=1,2,\dots ,n$. The DWT at a single level is carried out by convolution of the filter with the input data, followed by downsampling by two. In order to obtain exact reconstruction of the original input these filters must satisfy certain conditions. For orthogonal wavelets, n = m$n=m$, these are,

for all nonzero integers, l$l$.

$$\begin{array}{ccc}\sum _{k=1}^{m}{h}_{k}=0\text{,}& \sum _{k=1}^{m}{h}_{k}^{2}=1\text{,}& \sum _{k=-\infty}^{\infty}{h}_{k}{h}_{k+2l}=0\text{,}\\ \sum _{k=1}^{m}{g}_{k}=\sqrt{2}\text{,}& \sum _{k=1}^{m}{g}_{k}^{2}=1\text{,}& \sum _{k=-\infty}^{\infty}{g}_{k}{g}_{k+2l}=0\text{.}\end{array}$$ |

The reconstruction algorithm convolves the inverse filters with the wavelet coefficients previously computed together with upsampling and summation to return to the original input. For orthogonal wavelets the inverse filters are the same as those for the forward DWT.

In the simplest case, the Haar wavelet, the nonzero filter coefficients are

while for the Daubechies wavelet with two vanishing moments and four nonzero coefficients, the filter coefficients are

$$\begin{array}{c}\left\{h\right\}=\{\frac{-1}{\sqrt{2}},\frac{1}{\sqrt{2}}\}\\ \left\{g\right\}=\{\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}\}\end{array}$$ |

$$\begin{array}{c}\left\{h\right\}=\{\frac{-(1+\sqrt{3})}{4\sqrt{2}},\frac{3+\sqrt{3}}{4\sqrt{2}},\frac{-3+\sqrt{3}}{4\sqrt{2}},\frac{1-\sqrt{3}}{4\sqrt{2}}\}\\ \left\{g\right\}=\{\frac{1-\sqrt{3}}{4\sqrt{2}},\frac{3-\sqrt{3}}{4\sqrt{2}},\frac{3+\sqrt{3}}{4\sqrt{2}},\frac{1+\sqrt{3}}{4\sqrt{2}}\}\end{array}$$ |

In the orthogonal case the same filters are used for both decomposition and reconstruction.

Relaxing the orthogonality requirement allows for biorthogonal wavelets which consist of two dual wavelet bases. For example, the biorthogonal 2.2 filters are,

$$\begin{array}{c}\left\{h\right\}=\sqrt{2}\{\frac{1}{4},-\frac{1}{2},\frac{1}{4}\}\text{,}\\ \left\{g\right\}=\sqrt{2}\{-\frac{1}{8},\frac{1}{4},\frac{3}{4},\frac{1}{4},-\frac{1}{8}\}\\ \left\{{h}^{\prime}\right\}=\sqrt{2}\{\frac{1}{8},\frac{1}{4},-\frac{3}{4},\frac{1}{4},\frac{1}{8}\}\\ \left\{{g}^{\prime}\right\}=\sqrt{2}\{\frac{1}{4},\frac{1}{2},\frac{1}{4}\}\text{.}\end{array}$$ |

Note that there are several possible interpretations of orthogonal and biorthorgonal wavelet filters which satisfy the requirements. These differ in the sign of the coefficients and the ordering of the filters.

In order to obtain exact reconstruction when applying the DWT and its inverse to a finite dataset, say {x_{t}}$\left\{{x}_{\mathit{t}}\right\}$, for t = 1,2, … ,N$\mathit{t}=1,2,\dots ,N$, some method of extending the input at its end is required. Several methods which are in general use are: periodic extension, half-point symmetric extension, whole-point symmetric extension and zero end extension where the added data points are taken to be zero. The two types of symmetric end extension reflect the given data values from the end points for whole-point extension or else by repeating the end points and reflecting from points halfway between the end point and its repeat for half-point extension.

Rather than simply applying the wavelet transform at a single level the process is commonly repeated to give a multiresolution analysis. For the DWT, multiresolution is implemented as the pyramid (or cascade) algorithm. Applying the DWT at a given level, L$L$, the detail coefficients (which are the output from the high pass filter) are stored while the approximation coefficients resulting from convolution with the low pass filter are passed to the next level and the processs is repeated. When the length of the initial data input is an array of length N = 2^{J}$N={2}^{J}$, for some integer J$J$ (and assuming that the dataset is extended by periodic repetition) this can be continued until, at level J$J$, there is a single detail coefficient from the high pass filter. The final coefficient from the action of the low pass filter is also stored. The result is an array of coefficients of the same length, N$N$, as the input.

For two-dimensional data sets the DWT is computed as a series of one-dimensional DWTs, first over columns of the input data, and then over rows of the intermediate result. This produces four types of output coefficients: one set of approximation coefficients and three types of detail coefficients, containing information about the horizontal, vertical and diagonal components of the input data. The approximation coefficients are the result of applying convolution and downsampling with the low pass filter over both columns and rows;
the horizontal detail coefficients are the result of applying convolution and downsampling with the high pass filter over columns and then the low pass filter over rows; the vertical detail coefficients are the result of applying convolution and downsampling with the low pass filter over columns and the high pass filter over rows; and the diagonal detail coefficients are the result of applying convolution and downsampling with the high pass filter over both columns and rows. An example of the single level decomposition of an image performed using nag_wav_2d_sngl_fwd (c09ea) is given in Figure 1.

Similarly, for three dimensional data sets the DWT is also computed as a series of three one-dimensional DWTs, first over columns of the input data, and then over rows of the intermediate result and finally over frames of the second intermediate result. This produces eight types of output coefficients: one set of approximation coefficients (labelled LLL since the low pass filter is applied over columns, rows and frames) and seven types of detail coefficients, labelled similarly according to whether the low pass (L) or high pass filter (H) is applied in each of the three dimensions.

As in the one-dimensional case, the multi-level DWT in two and three dimensions is also implemented as the pyramid (or cascade) algorithm, where at a given level, L$L$, all detail coefficients are stored, while the approximation coefficients are passed as input to the next level.

The one-dimensional real valued continuous wavelet transform is provided by nag_wav_1d_cont (c09ba). It is useful for resolving discontinuities and high frequency features in a signal. It is a redundant representation of the input data containing repeated information and the set of coefficients produced as output is larger than the input data set.

The one-dimensional discrete wavelet transform at a single level is performed by nag_wav_1d_sngl_fwd (c09ca). The inverse or reconstruction is carried out by nag_wav_1d_sngl_inv (c09cb).

The one-dimensional multi-level discrete wavelet transform is computed by nag_wav_1d_multi_fwd (c09cc) and the inverse or reconstruction is given by nag_wav_1d_multi_inv (c09cd).

nag_wav_1d_init (c09aa) is provided to determine some of the input parameters for the one-dimensional discrete wavelet transform functions and must be called before the one-dimensional transform functions.

The two-dimensional discrete wavelet transform at a single level is performed by nag_wav_2d_sngl_fwd (c09ea). The inverse or reconstruction is carried out by nag_wav_2d_sngl_inv (c09eb).

The two-dimensional multi-level discrete wavelet transform is computed by nag_wav_2d_multi_fwd (c09ec) and the inverse or reconstruction is given by nag_wav_2d_multi_inv (c09ed).

nag_wav_2d_init (c09ab) is provided to determine some of the input parameters for the two-dimensional discrete wavelet transform functions and must be called before the two-dimensional transform functions.

The three-dimensional discrete wavelet transform at a single level is performed by nag_wav_3d_sngl_fwd (c09fa). The inverse or reconstruction is carried out by nag_wav_3d_sngl_inv (c09fb).

The three-dimensional multi-level discrete wavelet transform is computed by nag_wav_3d_multi_fwd (c09fc) and the inverse or reconstruction is given by nag_wav_3d_mxolap_multi_inv (c09fd).

nag_wav_3d_init (c09ac) is provided to deteermine some of the input parameters for the three-dimensional discrete wavelet transform functions and must be called before the three-dimensional transform functions.

Daubechies I (1992) *Ten Lectures on Wavelets* SIAM, Philadelphia

Mallat S G (1998) *A Wavelet Tour of Signal Processing* Academic Press

Percival D B and Walden A T (2000) *Wavelet Methods for Time Series Analysis* Cambridge University Press

Strang G and Nguyen T (1996) *Wavelets and Filter Banks* Wellesley-Cambridge Press

Vidakovic B (1999) *Statistical Modeling by Wavelets* John Wiley and Sons Inc.

Wickerhauser M V (1994) *Adapted Wavelet Analysis from Theory to Software* A K Peters Ltd

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013