Haar Function

DOWNLOAD Mathematica Notebook

Define

 psi(x)={1   0<=x<1/2; -1   1/2<x<=1; 0   otherwise
(1)

and

 psi_(jk)(x)=psi(2^jx-k)
(2)

for j a nonnegative integer and 0<=k<=2^j-1.

HaarFns

So, for example, the first few values of psi_(jk)(x) are

psi_(00)=psi(x)
(3)
psi_(10)=psi(2x)
(4)
psi_(11)=psi(2x-1)
(5)
psi_(20)=psi(4x)
(6)
psi_(21)=psi(4x-1)
(7)
psi_(22)=psi(4x-2)
(8)
psi_(23)=psi(4x-3).
(9)

Then a function f(x) can be written as a series expansion by

 f(x)=c_0+sum_(j=0)^inftysum_(k=0)^(2^j-1)c_(jk)psi_(jk)(x).
(10)

The functions psi_(jk) and psi are all orthogonal in [0,1], with

int_0^1psi(x)psi_(jk)(x)dx=0
(11)
int_0^1psi_(jk)(x)psi_(lm)(x)dx=0
(12)

for (j,k)!=(0,0) in the first case and (j,k)!=(l,m) in the second.

These functions can be used to define wavelets. Let a function be defined on n intervals, with n a power of 2. Then an arbitrary function can be considered as an n-vector f, and the coefficients in the expansion b can be determined by solving the matrix equation

 f=W_nb
(13)

for b, where W is the matrix of psi basis functions. For example, the fourth-order Haar function wavelet matrix is given by

W_4=[1  1  1  0;  1  1 -1  0;  1 -1  0  1;  1 -1  0 -1]
(14)
=[1  1  0  0;  1 -1  0  0;  0  0  1  1;  0  0  1 -1][1  0  0  0;  0  0  1  0;  0  1  0  0;  0  0  0  1][1  1  0  0;  1 -1  0  0;  0  0  1  0;  0  0  0  1].
(15)

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.