Discrete wavelet transform explained

In numerical analysis and functional analysis, a discrete wavelet transform (DWT) is any wavelet transform for which the wavelets are discretely sampled. As with other wavelet transforms, a key advantage it has over Fourier transforms is temporal resolution: it captures both frequency and location information (location in time).

Examples

Haar wavelets

See main article: Haar wavelet. The first DWT was invented by Hungarian mathematician Alfréd Haar. For an input represented by a list of

2n

numbers, the Haar wavelet transform may be considered to pair up input values, storing the difference and passing the sum. This process is repeated recursively, pairing up the sums to prove the next scale, which leads to

2n-1

differences and a final sum.

Daubechies wavelets

See main article: Daubechies wavelet. The most commonly used set of discrete wavelet transforms was formulated by the Belgian mathematician Ingrid Daubechies in 1988. This formulation is based on the use of recurrence relations to generate progressively finer discrete samplings of an implicit mother wavelet function; each resolution is twice that of the previous scale. In her seminal paper, Daubechies derives a family of wavelets, the first of which is the Haar wavelet. Interest in this field has exploded since then, and many variations of Daubechies' original wavelets were developed.[1] [2] [3]

The dual-tree complex wavelet transform (DCWT)

See main article: Complex wavelet transform. The dual-tree complex wavelet transform (

C

WT) is a relatively recent enhancement to the discrete wavelet transform (DWT), with important additional properties: It is nearly shift invariant and directionally selective in two and higher dimensions. It achieves this with a redundancy factor of only

2d

, substantially lower than the undecimated DWT. The multidimensional (M-D) dual-tree

C

WT is nonseparable but is based on a computationally efficient, separable filter bank (FB).[4]

Others

Other forms of discrete wavelet transform include the Le Gall–Tabatabai (LGT) 5/3 wavelet developed by Didier Le Gall and Ali J. Tabatabai in 1988 (used in JPEG 2000 or JPEG XS),[5] [6] [7] the Binomial QMF developed by Ali Naci Akansu in 1990,[8] the set partitioning in hierarchical trees (SPIHT) algorithm developed by Amir Said with William A. Pearlman in 1996,[9] the non- or undecimated wavelet transform (where downsampling is omitted), and the Newland transform (where an orthonormal basis of wavelets is formed from appropriately constructed top-hat filters in frequency space). Wavelet packet transforms are also related to the discrete wavelet transform. Complex wavelet transform is another form.

Properties

The Haar DWT illustrates the desirable properties of wavelets in general. First, it can be performed in

O(n)

operations; second, it captures not only a notion of the frequency content of the input, by examining it at different scales, but also temporal content, i.e. the times at which these frequencies occur. Combined, these two properties make the Fast wavelet transform (FWT) an alternative to the conventional fast Fourier transform (FFT).

Time issues

Due to the rate-change operators in the filter bank, the discrete WT is not time-invariant but actually very sensitive to the alignment of the signal in time. To address the time-varying problem of wavelet transforms, Mallat and Zhong proposed a new algorithm for wavelet representation of a signal, which is invariant to time shifts.[10] According to this algorithm, which is called a TI-DWT, only the scale parameter is sampled along the dyadic sequence 2^j (j∈Z) and the wavelet transform is calculated for each point in time.[11] [12]

Applications

The discrete wavelet transform has a huge number of applications in science, engineering, mathematics and computer science. Most notably, it is used for signal coding, to represent a discrete signal in a more redundant form, often as a preconditioning for data compression. Practical applications can also be found in signal processing of accelerations for gait analysis,[13] [14] image processing,[15] [16] in digital communications and many others.[17] [18] [19]

It is shown that discrete wavelet transform (discrete in scale and shift, and continuous in time) is successfully implemented as analog filter bank in biomedical signal processing for design of low-power pacemakers and also in ultra-wideband (UWB) wireless communications.[20]

Example in image processing

Wavelets are often used to denoise two dimensional signals, such as images. The following example provides three steps to remove unwanted white Gaussian noise from the noisy image shown. Matlab was used to import and filter the image.

The first step is to choose a wavelet type, and a level N of decomposition. In this case biorthogonal 3.5 wavelets were chosen with a level N of 10. Biorthogonal wavelets are commonly used in image processing to detect and filter white Gaussian noise,[21] due to their high contrast of neighboring pixel intensity values. Using these wavelets a wavelet transformation is performed on the two dimensional image.

Following the decomposition of the image file, the next step is to determine threshold values for each level from 1 to N. Birgé-Massart strategy[22] is a fairly common method for selecting these thresholds. Using this process individual thresholds are made for N = 10 levels. Applying these thresholds are the majority of the actual filtering of the signal.

The final step is to reconstruct the image from the modified levels. This is accomplished using an inverse wavelet transform. The resulting image, with white Gaussian noise removed is shown below the original image. When filtering any form of data it is important to quantify the signal-to-noise-ratio of the result. In this case, the SNR of the noisy image in comparison to the original was 30.4958%, and the SNR of the denoised image is 32.5525%. The resulting improvement of the wavelet filtering is a SNR gain of 2.0567%.[23]

Choosing other wavelets, levels, and thresholding strategies can result in different types of filtering. In this example, white Gaussian noise was chosen to be removed. Although, with different thresholding, it could just as easily have been amplified.

See also: Discrete Fourier transform.

To illustrate the differences and similarities between the discrete wavelet transform with the discrete Fourier transform, consider the DWT and DFT of the following sequence: (1,0,0,0), a unit impulse.

The DFT has orthogonal basis (DFT matrix):

\begin{bmatrix} 1&1&1&1\\ 1&-i&-1&i\\ 1&-1&1&-1\\ 1&i&-1&-i \end{bmatrix}

while the DWT with Haar wavelets for length 4 data has orthogonal basis in the rows of:

\begin{bmatrix} 1&1&1&1\\ 1&1&-1&-1\\ 1&-1&0&0\\ 0&0&1&-1 \end{bmatrix}

(To simplify notation, whole numbers are used, so the bases are orthogonal but not orthonormal.)

Preliminary observations include:

\begin{align} (1,0,0,0)&=

1
4

(1,1,1,1)+

1
4

(1,1,-1,-1)+

1
2

(1,-1,0,0)    HaarDWT\\ (1,0,0,0)&=

1
4

(1,1,1,1)+

1
4

(1,i,-1,-i)+

1
4

(1,-1,1,-1)+

1
4

(1,-i,-1,i)    DFT \end{align}

The DWT demonstrates the localization: the (1,1,1,1) term gives the average signal value, the (1,1,–1,–1) places the signal in the left side of the domain, and the (1,–1,0,0) places it at the left side of the left side, and truncating at any stage yields a downsampled version of the signal:

\begin{align} &\left(1,
4
1,
4
1,
4
1\right)\\ &\left(
4
1,
2
1
2

,0,0\right)    2-termtruncation\\ &\left(1,0,0,0\right) \end{align}

The DFT, by contrast, expresses the sequence by the interference of waves of various frequencies – thus truncating the series yields a low-pass filtered version of the series:
\begin{align} &\left(1,
4
1,
4
1,
4
1\right)\\ &\left(
4
3,
4
1,-
4
1,
4
1
4

\right)    2-termtruncation\\ &\left(1,0,0,0\right) \end{align}

Notably, the middle approximation (2-term) differs. From the frequency domain perspective, this is a better approximation, but from the time domain perspective it has drawbacks – it exhibits undershoot – one of the values is negative, though the original series is non-negative everywhere – and ringing, where the right side is non-zero, unlike in the wavelet transform. On the other hand, the Fourier approximation correctly shows a peak, and all points are within

1/4

of their correct value, though all points have error. The wavelet approximation, by contrast, places a peak on the left half, but has no peak at the first point, and while it is exactly correct for half the values (reflecting location), it has an error of

1/2

for the other values.

This illustrates the kinds of trade-offs between these transforms, and how in some respects the DWT provides preferable behavior, particularly for the modeling of transients.

Definition

One level of the transform

The DWT of a signal

x

is calculated by passing it through a series of filters. First the samples are passed through a low-pass filter with impulse response

g

resulting in a convolution of the two:

y[n]=(x*g)[n]=

infty
\sum\limits
k=-infty

{x[k]g[n-k]}

h

. The outputs give the detail coefficients (from the high-pass filter) and approximation coefficients (from the low-pass). It is important that the two filters are related to each other and they are known as a quadrature mirror filter.

However, since half the frequencies of the signal have now been removed, half the samples can be discarded according to Nyquist's rule. The filter output of the low-pass filter

g

in the diagram above is then subsampled by 2 and further processed by passing it again through a new low-pass filter

g

and a high- pass filter

h

with half the cut-off frequency of the previous one, i.e.:

ylow[n]=

infty
\sum\limits
k=-infty

{x[k]g[2n-k]}

yhigh[n]=

infty
\sum\limits
k=-infty

{x[k]h[2n-k]}

This decomposition has halved the time resolution since only half of each filter output characterises the signal. However, each output has half the frequency band of the input, so the frequency resolution has been doubled.

\downarrow

(y\downarrowk)[n]=y[kn]

the above summation can be written more concisely.

ylow=(x*g)\downarrow2

yhigh=(x*h)\downarrow2

However computing a complete convolution

x*g

with subsequent downsampling would waste computation time.

The Lifting scheme is an optimization where these two computations are interleaved.

Cascading and filter banks

This decomposition is repeated to further increase the frequency resolution and the approximation coefficients decomposed with high- and low-pass filters and then down-sampled. This is represented as a binary tree with nodes representing a sub-space with a different time-frequency localisation. The tree is known as a filter bank.

At each level in the above diagram the signal is decomposed into low and high frequencies. Due to the decomposition process the input signal must be a multiple of

2n

where

n

is the number of levels.

For example a signal with 32 samples, frequency range 0 to

fn

and 3 levels of decomposition, 4 output scales are produced:
LevelFrequenciesSamples
3

0

to

{{fn}}/8

4

{{fn}}/8

to

{{fn}}/4

4
2

{{fn}}/4

to

{{fn}}/2

8
1

{{fn}}/2

to

fn

16

Relationship to the mother wavelet

The filterbank implementation of wavelets can be interpreted as computing the wavelet coefficients of a discrete set of child wavelets for a given mother wavelet

\psi(t)

. In the case of the discrete wavelet transform, the mother wavelet is shifted and scaled by powers of two

\psij,k(t)=

1
\sqrt{2j
} \psi \left(\frac \right)

where

j

is the scale parameter and

k

is the shift parameter, both of which are integers.

Recall that the wavelet coefficient

\gamma

of a signal

x(t)

is the projection of

x(t)

onto a wavelet, and let

x(t)

be a signal of length

2N

. In the case of a child wavelet in the discrete family above,

\gammajk=

infty
\int
-infty

x(t)

1
\sqrt{2j
} \psi \left(\frac \right) dt

Now fix

j

at a particular scale, so that

\gammajk

is a function of

k

only. In light of the above equation,

\gammajk

can be viewed as a convolution of

x(t)

with a dilated, reflected, and normalized version of the mother wavelet,

h(t)=

1
\sqrt{2j
} \psi \left(\frac \right) , sampled at the points

1,2j,2 ⋅ {2j},...,2N

. But this is precisely what the detail coefficients give at level

j

of the discrete wavelet transform. Therefore, for an appropriate choice of

h[n]

and

g[n]

, the detail coefficients of the filter bank correspond exactly to a wavelet coefficient of a discrete set of child wavelets for a given mother wavelet

\psi(t)

.

As an example, consider the discrete Haar wavelet, whose mother wavelet is

\psi=[1,-1]

. Then the dilated, reflected, and normalized version of this wavelet is

h[n]=

1
\sqrt{2
} [-1, 1], which is, indeed, the highpass decomposition filter for the discrete Haar wavelet transform.

Time complexity

The filterbank implementation of the Discrete Wavelet Transform takes only O(N) in certain cases, as compared to O(N log N) for the fast Fourier transform.

Note that if

g[n]

and

h[n]

are both a constant length (i.e. their length is independent of N), then

x*h

and

x*g

each take O(N) time. The wavelet filterbank does each of these two O(N) convolutions, then splits the signal into two branches of size N/2. But it only recursively splits the upper branch convolved with

g[n]

(as contrasted with the FFT, which recursively splits both the upper branch and the lower branch). This leads to the following recurrence relation

T(N)=2N+T\left(

N
2

\right)

which leads to an O(N) time for the entire operation, as can be shown by a geometric series expansion of the above relation.

As an example, the discrete Haar wavelet transform is linear, since in that case

h[n]

and

g[n]

are constant length 2.

h[n]=\left[

-\sqrt{2
}, \frac\right] g[n] = \left[\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2}\right]

The locality of wavelets, coupled with the O(N) complexity, guarantees that the transform can be computed online (on a streaming basis). This property is in sharp contrast to FFT, which requires access to the entire signal at once. It also applies to the multi-scale transform and also to the multi-dimensional transforms (e.g., 2-D DWT).[24]

Other transforms

See also: Adam7 algorithm.

{\bfy}=f{{\bfX}}

involving interactions of a positive regular function

f

and a multiplicative independent positive noise

X

, with

EX=1

. Denote

{\calW}

, a wavelet transform. Since

f{{\bfX}}=f+{f({\bfX}-1)}

, then the standard (additive) discrete wavelet transform

{\calW+}

is such that

{\calW+}{\bfy}={\calW+}f+{\calW+}{f({\bfX}-1)},

where detail coefficients

{\calW+}{f({\bfX}-1)}

cannot be considered as sparse in general, due to the contribution of

f

in the latter expression. In the multiplicative framework, the wavelet transform is such that

{\calW x }{\bfy}=\left({\calW x }f\right) x \left({\calW x }{{\bfX}}\right).

This 'embedding' of wavelets in a multiplicative algebra involves generalized multiplicative approximations and detail operators: For instance, in the case of the Haar wavelets, then up to the normalization coefficient

\alpha

, the standard

{\calW+}

approximations (arithmetic mean)

ck=\alpha(yk+yk-1)

and details (arithmetic differences)

dk=\alpha(yk-yk-1)

become respectively geometric mean approximations
\ast
c
k

=(yk x yk-1)\alpha

and geometric differences (details)
\ast
d
k

=\left(

yk
yk-1

\right)\alpha

when using

{\calW x }

.

Code example

In its simplest form, the DWT is remarkably easy to compute.

The Haar wavelet in Java:public static int[] discreteHaarWaveletTransform(int[] input) Complete Java code for a 1-D and 2-D DWT using Haar, Daubechies, Coiflet, and Legendre wavelets is available from the open source project: JWave.Furthermore, a fast lifting implementation of the discrete biorthogonal CDF 9/7 wavelet transform in C, used in the JPEG 2000 image compression standard can be found here (archived 5 March 2012).

Example of above code

This figure shows an example of applying the above code to compute the Haar wavelet coefficients on a sound waveform. This example highlights two key properties of the wavelet transform:

2N

, the coefficients in the range

[2N-j,2N-j+1]

represent a version of the original signal which is in the pass-band

\left[

\pi
2j

,

\pi
2j-1

\right]

. This is why zooming in on these ranges of the wavelet coefficients looks so similar in structure to the original signal. Ranges which are closer to the left (larger

j

in the above notation), are coarser representations of the signal, while ranges to the right represent finer details.

See also

References

[26]

External links

Notes and References

  1. A.N. Akansu, R.A. Haddad and H. Caglar, Perfect Reconstruction Binomial QMF-Wavelet Transform, Proc. SPIE Visual Communications and Image Processing, pp. 609–618, vol. 1360, Lausanne, Sept. 1990.
  2. Akansu, Ali N.; Haddad, Richard A. (1992), Multiresolution signal decomposition: transforms, subbands, and wavelets, Boston, MA: Academic Press,
  3. A.N. Akansu, Filter Banks and Wavelets in Signal Processing: A Critical Review, Proc. SPIE Video Communications and PACS for Medical Applications (Invited Paper), pp. 330-341, vol. 1977, Berlin, Oct. 1993.
  4. Selesnick, I.W.; Baraniuk, R.G.; Kingsbury, N.C., 2005, The dual-tree complex wavelet transform
  5. Web site: Sullivan . Gary . General characteristics and design considerations for temporal subband video coding . . . 8–12 December 2003 . 13 September 2019.
  6. Book: Bovik . Alan C. . The Essential Guide to Video Processing . 2009 . . 9780080922508 . 355 .
  7. Book: Gall . Didier Le . Tabatabai . Ali J. . ICASSP-88., International Conference on Acoustics, Speech, and Signal Processing . Sub-band coding of digital images using symmetric short kernel filters and arithmetic coding techniques . 1988 . 761–764 vol.2 . 10.1109/ICASSP.1988.196696. 109186495 .
  8. [Ali Naci Akansu]
  9. Said . A. . Pearlman . W. A. . A new, fast, and efficient image codec based on set partitioning in hierarchical trees . IEEE Transactions on Circuits and Systems for Video Technology . 1996 . 6 . 3 . 243–250 . 10.1109/76.499834 . 1051-8215 . 18 October 2019.
  10. S. Mallat, A Wavelet Tour of Signal Processing, 2nd ed. San Diego, CA: Academic, 1999.
  11. S. G. Mallat and S. Zhong, "Characterization of signals from multiscale edges," IEEE Trans. Pattern Anal. Mach. Intell., vol. 14, no. 7, pp. 710– 732, Jul. 1992.
  12. Ince, Kiranyaz, Gabbouj, 2009, A generic and robust system for automated patient-specific classification of ECG signals
  13. https://www.youtube.com/watch?v=DTpEVQSEBBk "Novel method for stride length estimation with body area network accelerometers"
  14. Nasir. V.. Cool. J.. Sassani. F.. October 2019. Intelligent Machining Monitoring Using Sound Signal Processed With the Wavelet Method and a Self-Organizing Neural Network. IEEE Robotics and Automation Letters. 4. 4. 3449–3456. 10.1109/LRA.2019.2926666. 198474004. 2377-3766.
  15. Web site: Wavelet Based Methods in Image Processing. Broughton. S. Allen. www.rose-hulman.edu. 2017-05-02.
  16. Chervyakov. N. I.. Lyakhov. P. A.. Nagornov. N. N.. 2018-11-01. Quantization Noise of Multilevel Discrete Wavelet Transform Filters in Image Processing. Optoelectronics, Instrumentation and Data Processing. en. 54. 6. 608–616. 10.3103/S8756699018060092. 2018OIDP...54..608C. 128173262. 1934-7944.
  17. Book: Akansu . Ali N. . Subband and Wavelet Transforms: Design and Applications . Smith . Mark J. T. . 31 October 1995 . Kluwer Academic Publishers . 0792396456.
  18. Book: Akansu . Ali N. . Wavelet, Subband and Block Transforms in Communications and Multimedia . Medley . Michael J. . 6 December 2010 . Kluwer Academic Publishers . 978-1441950864.
  19. A.N. Akansu, P. Duhamel, X. Lin and M. de Courville Orthogonal Transmultiplexers in Communication: A Review, IEEE Trans. On Signal Processing, Special Issue on Theory and Applications of Filter Banks and Wavelets. Vol. 46, No.4, pp. 979–995, April, 1998.
  20. A.N. Akansu, W.A. Serdijn, and I.W. Selesnick, Wavelet Transforms in Signal Processing: A Review of Emerging Applications, Physical Communication, Elsevier, vol. 3, issue 1, pp. 1–18, March 2010.
  21. Pragada. S.. Sivaswamy. J.. 2008-12-01. Image Denoising Using Matched Biorthogonal Wavelets. 2008 Sixth Indian Conference on Computer Vision, Graphics Image Processing. 25–32. 10.1109/ICVGIP.2008.95. 15516486.
  22. Web site: Thresholds for wavelet 1-D using Birgé-Massart strategy - MATLAB wdcbm. www.mathworks.com. 2017-05-03.
  23. Web site: how to get SNR for 2 images - MATLAB Answers - MATLAB Central. www.mathworks.com. 2017-05-10.
  24. Barina. David. 2020. Real-time wavelet transform for infinite image strips. 2020-07-09. Journal of Real-Time Image Processing. 18. 3. 585–591. Springer. 10.1007/s11554-020-00995-8. 220396648.
  25. Abdourrahmane M.. Atto. Emmanuel. Trouvé. Jean-Marie. Nicolas. Thu Trang. Lê. Wavelet Operators and Multiplicative Observation Models—Application to SAR Image Time-Series Analysis. 10.1109/TGRS.2016.2587626. IEEE Transactions on Geoscience and Remote Sensing. 2016. 54. 11. 6606–6624. 2016ITGRS..54.6606A. 1860049.
  26. Prasad. Akhilesh. Maan. Jeetendrasingh. Verma. Sandeep Kumar. 2021. Wavelet transforms associated with the index Whittaker transform. Mathematical Methods in the Applied Sciences. 44. 13. 10734–10752. en. 10.1002/mma.7440. 2021MMAS...4410734P. 235556542. 1099-1476.