Haar wavelet
First known wavelet basis

In mathematics, the Haar wavelet is a sequence of rescaled "square-shaped" functions which together form a wavelet family or basis. Wavelet analysis is similar to Fourier analysis in that it allows a target function over an interval to be represented in terms of an orthonormal basis. The Haar sequence is now recognised as the first known wavelet basis and is extensively used as a teaching example.
The Haar sequence was proposed in 1909 by Alfréd Haar. Haar used these functions to give an example of an orthonormal system for the space of square-integrable functions on the unit interval [0, 1]. The study of wavelets, and even the term "wavelet", did not come until much later. As a special case of the Daubechies wavelet, the Haar wavelet is also known as Db1.
The Haar wavelet is also the simplest possible wavelet. The technical disadvantage of the Haar wavelet is that it is not continuous, and therefore not differentiable. This property can, however, be an advantage for the analysis of signals with sudden transitions (discrete signals), such as monitoring of tool failure in machines.
The Haar wavelet's mother wavelet function can be described as
Its scaling function can be described as
01Haar functions and Haar system
For every pair n, k of integers in , the Haar function ψn,k is defined on the real line
by the formula
This function is supported on the right-open interval In,k = [ k2−n, (k+1)2−n), i.e., it vanishes outside that interval. It has integral 0 and norm 1 in the Hilbert space L2(),
The Haar functions are pairwise orthogonal,
where represents the Kronecker delta. Here is the reason for orthogonality: when the two supporting intervals
and
are not equal, then they are either disjoint, or else the smaller of the two supports, say
, is contained in the lower or in the upper half of the other interval, on which the function
remains constant. It follows in this case that the product of these two Haar functions is a multiple of the first Haar function, hence the product has integral 0.
The Haar system on the real line is the set of functions
It is complete in L2(): The Haar system on the line is an orthonormal basis in L2(
).
02Haar wavelet properties
The Haar wavelet has several notable properties:
- Any continuous real function with compact support can be approximated uniformly by linear combinations of
and their shifted functions. This extends to those function spaces where any function therein can be approximated by continuous functions.
- Any continuous real function on [0, 1] can be approximated uniformly on [0, 1] by linear combinations of the constant function 1,
and their shifted functions.
- Orthogonality in the form
represents the Kronecker delta. The dual function of ψ(t) is ψ(t) itself.
- Wavelet/scaling functions with different scale n have a functional relationship: since
it follows that coefficients of scale n can be calculated by coefficients of scale n+1:
If
and
then
04Haar matrix
The 2×2 Haar matrix that is associated with the Haar wavelet is
Using the discrete wavelet transform, one can transform any sequence of even length into a sequence of two-component-vectors
. If one right-multiplies each vector with the matrix
, one gets the result
of one stage of the fast Haar-wavelet transform. Usually one separates the sequences s and d and continues with transforming the sequence s. Sequence s is often referred to as the averages part, whereas d is known as the details part.
If one has a sequence of length a multiple of four, one can build blocks of 4 elements and transform them in a similar manner with the 4×4 Haar matrix
which combines two stages of the fast Haar-wavelet transform.
Compare with a Walsh matrix, which is a non-localized 1/-1 matrix.
Generally, the 2N×2N Haar matrix can be derived by the following equation.
- where
and
is the Kronecker product.
The Kronecker product of , where
is an m×n matrix and
is a p×q matrix, is expressed as
An un-normalized 8-point Haar matrix is shown below
Note that, the above matrix is an un-normalized Haar matrix. The Haar matrix required by the Haar transform should be normalized.
From the definition of the Haar matrix , one can observe that, unlike the Fourier transform,
has only real elements (i.e., 1, -1 or 0) and is non-symmetric.
Take the 8-point Haar matrix as an example. The first row of
measures the average value, and the second row of
measures a low frequency component of the input vector. The next two rows are sensitive to the first and second half of the input vector respectively, which corresponds to moderate frequency components. The remaining four rows are sensitive to the four section of the input vector, which corresponds to high frequency components.
05Haar transform
The Haar transform is the simplest of the wavelet transforms. This transform cross-multiplies a function against the Haar wavelet with various shifts and stretches, like the Fourier transform cross-multiplies a function against a sine wave with two phases and many stretches.
Introduction
The Haar transform is one of the oldest transform functions, proposed in 1910 by the Hungarian mathematician Alfréd Haar. It is found effective in applications such as signal and image compression in electrical and computer engineering as it provides a simple and computationally efficient approach for analysing the local aspects of a signal.
The Haar transform is derived from the Haar matrix. An example of a 4×4 Haar transformation matrix is shown below.
The Haar transform can be thought of as a sampling process in which rows of the transformation matrix act as samples of finer and finer resolution.
Compare with the Walsh transform, which is also 1/-1, but is non-localized.
Property
The Haar transform has the following properties
- No need for multiplications. It requires only additions and there are many elements with zero value in the Haar matrix, so the computation time is short. It is faster than Walsh transform, whose matrix is composed of +1 and −1.
- Input and output length are the same. However, the length should be a power of 2, i.e.
.
- It can be used to analyse the localized feature of signals. Due to the orthogonal property of the Haar function, the frequency components of input signal can be analyzed.
Haar transform and Inverse Haar transform
The Haar transform yn of an n-input function xn is
The Haar transform matrix is real and orthogonal. Thus, the inverse Haar transform can be derived by the following equations.
- where
is the identity matrix. For example, when n = 4
Thus, the inverse Haar transform is
Example
The Haar transform coefficients of a n=4-point signal can be found as
The input signal can then be perfectly reconstructed by the inverse Haar transform
Sources and credits
This article is adapted from the Wikipedia article “Haar wavelet”, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.
Images, from Wikimedia Commons:
- Haar wavelet.svg by Unknown author, CC BY-SA 3.0
Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.