| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Wavelet Toolbox |
| Contents | Index |
Fast Wavelet Transform (FWT) Algorithm
In 1988, Mallat produced a fast wavelet decomposition and reconstruction algorithm [Mal89]. The Mallat algorithm for discrete wavelet transform (DWT) is, in fact, a classical scheme in the signal processing community, known as a two-channel subband coder using conjugate quadrature filters or quadrature mirror filters (QMFs).
This section addresses the following topics:
Filters Used to Calculate the DWT and IDWT
For an orthogonal wavelet, in the multiresolution framework (see [Dau92] in Using Wavelet Packets), we start with the scaling function
and the wavelet function
. One of the fundamental relations is the twin-scale relation (dilation equation or refinement equation):
All the filters used in DWT and IDWT are intimately related to the sequence
Clearly if
is compactly supported, the sequence (wn) is finite and can be viewed as a filter. The filter W, which is called the scaling filter (nonnormalized), is
For example, for the db3 scaling filter,
load db3 db3 db3 = 0.2352 0.5706 0.3252 -0.0955 -0.0604 0.0249 sum(db3) ans = 1.0000 norm(db3) ans = 0.7071
From filter W, we define four FIR filters, of length 2N and of norm 1, organized as follows.
| Filters |
Low-Pass |
High-Pass |
| Decomposition |
Lo_D |
Hi_D |
| Reconstruction |
Lo_R |
Hi_R |
The four filters are computed using the following scheme.
where qmf is such that Hi_R and Lo_R are quadrature mirror filters (i.e., Hi_R(k) = (-1) k Lo_R(2N + 1 - k)) for k = 1, 2, ..., 2N.
Note that wrev flips the filter coefficients. So Hi_D and Lo_D are also quadrature mirror filters. The computation of these filters is performed using orthfilt. Next, we illustrate these properties with the db6 wavelet. The plots associated with the following commands are shown in Figure 6-8.
% Load scaling filter. load db6; w = db6; subplot(421); stem(w); title('Original scaling filter'); % Compute the four filters. [Lo_D,Hi_D,Lo_R,Hi_R] = orthfilt(w); subplot(423); stem(Lo_D); title('Decomposition low-pass filter Lo{\_}D'); subplot(424); stem(Hi_D); title('Decomposition high-pass filter Hi{\_}D'); subplot(425); stem(Lo_R); title('Reconstruction low-pass filter Lo{\_}R'); subplot(426); stem(Hi_R); title('Reconstruction high-pass filter Hi{\_}R'); % High and low frequency illustration. n = length(Hi_D); freqfft = (0:n-1)/n; nn = 1:n; N = 10*n; for k=1:N lambda(k) = (k-1)/N; XLo_D(k) = exp(-2*pi*j*lambda(k)*(nn-1))*Lo_D'; XHi_D(k) = exp(-2*pi*j*lambda(k)*(nn-1))*Hi_D'; end fftld = fft(Lo_D); ffthd = fft(Hi_D); subplot(427); plot(lambda,abs(XLo_D),freqfft,abs(fftld),'o'); title('Transfer modulus: lowpass (Lo{\_}D or Lo{\_}R') subplot(428); plot(lambda,abs(XHi_D),freqfft,abs(ffthd),'o'); title('Transfer modulus: highpass (Hi{\_}D or Hi{\_}R')
Figure 6-8: Four Wavelet Filters for db6
Algorithms
Given a signal s of length N, the DWT consists of log2N stages at most. Starting from s, the first step produces two sets of coefficients: approximation coefficients cA1, and detail coefficients cD1. These vectors are obtained by convolving s with the low-pass filter Lo_D for approximation, and with the high-pass filter Hi_D for detail, followed by dyadic decimation.
More precisely, the first step is
The length of each filter is equal to 2n. If N= length (s), the signals F and G are of length N+ 2n - 1, and then the coefficients cA1 and cD1 are of length
The next step splits the approximation coefficients cA1 in two parts using the same scheme, replacing s by cA1 and producing cA2 and cD2, and so on.
So the wavelet decomposition of the signal s analyzed at level j has the following structure: [cAj, cDj, ..., cD1].
This structure contains for J = 3 the terminal nodes of the following tree.
This kind of two-dimensional DWT leads to a decomposition of approximation coefficients at level j in four components: the approximation at level j + 1 and the details in three orientations (horizontal, vertical, and diagonal).
The following charts describe the basic decomposition and reconstruction steps for images.
So, for J = 2, the two-dimensional wavelet tree has the following form.
Finally, let us mention that, for biorthogonal wavelets, the same algorithms hold but the decomposition filters on one hand and the reconstruction filters on the other hand are obtained from two distinct scaling functions associated with two multiresolution analyses in duality.
In this case, the filters for decomposition and reconstruction are, in general, of different odd lengths. This situation occurs, for example, for "splines" biorthogonal wavelets used in the toolbox. By zero-padding, the four filters can be extended in such a way that they will have the same even length.
Why Does Such an Algorithm Exist?
The previous paragraph describes algorithms designed for finite-length signals or images. To understand the rationale, we must consider infinite-length signals. The methods for the extension of a given finite-length signal are described in Dealing with Border Distortion.
Let us denote h = Lo_R and g = Hi_R and focus on the one-dimensional case.
We first justify how to go from level j to level j+1, for the approximation vector. This is the main step of the decomposition algorithm for the computation of the approximations. The details are calculated in the same way using the filter g instead of filter h.
Let
be the coordinates of the vector Aj:
and
the coordinates of the vector Aj+1:
is calculated using the formula
This formula resembles a convolution formula.
The computation is very simple.
The sequence
is the filtered output of the sequence
by the filter
.
We have to take the even index values of F. This is downsampling.
The sequence
is the downsampled version of the sequence
.
The initialization is carried out using
, where s(k) is the signal value at time k.
There are several reasons for this surprising result, all of which are linked to the multiresolution situation and to a few of the properties of the functions
j,k and
j,k.
Let us now describe some of them.
is formed of orthonormal functions. As a consequence for any j, the family
is orthonormal.
is orthonormal.
are orthogonal to
.
Twin-Scale Relation for ![]() | |
This relation introduces the algorithm's h filter (
). For more information, see Filters Used to Calculate the DWT and IDWT.
and
functions. Between two successive scales, we have the following twin-scale fundamental relation.Twin-Scale Relation Between and ![]() | |
We will focus our study on the first sum
; the second sum
is handled in a similar manner.
The calculations are easily organized if we note that (taking k = 0 in the previous formulas, makes things simpler)
If we transform the (
n) sequence into a new sequence
defined by
...,
-1, 0,
0, 0,
1, 0,
2, 0, ... that is precisely
and
sequences by upsampled versions
and
inserting zeros.
One-Dimensional Wavelet Capabilities
Basic One-Dimensional Objects.
Analysis-Decomposition Capabilities.
| Purpose |
Input |
Output |
M-File |
| Single-level decomposition |
s |
cA1, cD1 |
dwt |
| Single-level decomposition |
cAj |
cAj+1, cDj+1 |
dwt |
| Decomposition |
s |
[cAj, cDj, ..., cD1] |
wavedec |
Synthesis-Reconstruction Capabilities.
Decomposition Structure Utilities. .
To illustrate command-line mode for one-dimensional capabilities, see One-Dimensional Analysis Using the Command Line.
Two-Dimensional Wavelet Capabilities
Basic Two-Dimensional Objects.
Dk stands for
, the horizontal, vertical, and diagonal details at level k.
The same holds for cDk, which stands for
.
The two-dimensional M-files are the same as those for the one-dimensional case, but with a 2 appended on the end of the command.
For example, idwt becomes idwt2. For more information, see One-Dimensional Wavelet Capabilities.
To illustrate command-line mode for two-dimensional capabilities, see Two-Dimensional Analysis Using the Command Line.
| Provide feedback about this page |
![]() | General Concepts | Dealing with Border Distortion | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |